You are on page 1of 10

Assiqmm ent -1L

Opercatng Systerm

Name Sakshi
Roll No. = 222/29

8zramch CoE CSE) 4 Sem

ues 1 =a) Dbcuss the concept of victual machinne


Ans A vort ual 97machime (VM) a vitual envinonment
Nhich functions s a Victuok co7mput er Systenm u t h

CPU, memorty, netwo7tk imtercface, ancl Storage


Cteatec on ap hysical hovrawote System.
VMs arce isolateol om the 7est of the ystem ,
amol multiple VMS Com exist 07 Simg piece o
harclwcte Like a Sertve. That mm eam8, tas
Stmulatedd image OF appeication 0ftwane amcl opetatng
S-ystem Which is executed om a host compute or a

Setver
has t own op ercat inq System ancl 30ftware
that witt toacilitate the Jesowrces to victuak Computers

Victuok Machime encowtages thebeyO md user to q0

the limitat ions of


harrdwane to achieve th evt 9oals.
achiev es Vittualization with
he
The op ecating System
the help of
the
a Specializecl Softwate called a hyper
Client o r Ser vert Ce0,
Which emulates the pc
viso, harclware
hastal clusk e tuworck anel oth er
,
memoy
vioctual nachines
ouces, Completely, e nablirg
9es
to s hote cesoUTCes
to

b) Distinquish between Monolithic a MiooKetne Sttuctwte

Operating Systerm
nive helevant cliagrah
0

Ans Microkerne& Monolithic Kerrmel


n mioto ketme User Services MonoLt thic kertnel ,6ot6
us eeSerwices and kern et
a n c t kecm et Setices are
Sertvices arte kept 19 the
kept 2n Sepa ete adeote ss Sanme
Space a.clclress Space
) Oper.ating 8ystem is Comp lex) Opercattmg yste
to design casy to olest9n anod i

i7) Mcotokercnel ore SmouDlot in


Monoltthic kercnel
Size
Qrtqe than m/OTokenel,
iv)tasie to add
mew
Ltttes functiona- Difficult to aclol new
fumctionalittes
v)To clesigm a 2n ioro kert?m
972 0 t e
Codle el, LessCocle Nhen
S
Fequwe d. to mtookertnel. Compare
vi)Fcilwte 0f ome
conmponemE
odo es not effect the )faikure OFOne componend
of ioto k emel. wortking im a
nmonolithic kescmels
leod to the
entite Sustem
oilwre of the
Ste
vi
Execution Speead is ouw
Ste Executton pe e cl is bigh.
vut r s eosy to extend MioTo 92ot
ecusy to exlend
Kecnek 997 0nolithic
Kercr el.
St
x) Debugging s Simple.
) Debug9ing 4
oliPficult
x) 3imple t o main tain Extro tCme amcl resowT CLS
S6 ayce neeclec for mantenance.

fowocling and Message passeng ama


Ste xi) Messa ge Comtext Switchino ate
Switchimq te
Contex t not requuwred w fule
Ste t h e rmu oroKestmel the
requwted by Kernme s uOCking

offes The kercn ek contoims al


kern el only
xir) 7he evel device
the operatirng System 's
o w
(PC a n d Sercvces
Senvi Ces
m a n a g e m e n t
SuSteT
txamime the need of
Schecluulers ? Explaim
cltffertemt types of Scheclulimg
Criterta
The DIcOcess 77manaqers activty s prtocesS SCheou
ing, Which imvoves stemovim9 the UnNi mg
process promm the Cpu
ancl Selecting amothe
PcoceSS bosecd 0n a Specfic Ssateq u. 7he Scheclul et s
pwposes to fmplement the v7t tual mac ne So
that each DCOcess appeas to be TCUmn(779 O7 tS
Own omputer to the sert

Varttoustyp es of Schecluling uterio ae

)PU utilizotton it mQke Swre that the CPU Operoting


as ts peak and s busyH

Throughput the numbet of ptocess es that Complete


theu execution pert Unit of time.

lalting time it s the amoumt of watimg tme


tme in
the queue

Response tirme Time e tired Por gemetatir9 the kost


afterr Submisston.
Feque5t

Qm Oumt of ttme reqpred


lutnoztounaime-t
the
Specerc pruocess.
execute
a

Access the w ortkimg 0f process cltfferent


&ues 3:- with a neat tansitton diaa1am
StateS

are
7

States o PPocess :
Ans :-Thei o wNait state
) Block
New State
Tetmimated
Ot Comple ted

Reacly S t a t e )Suspemol ieady


biockecd
Suspend Reody

Suspendlecd
Newr Resurme
Process Great ecl

Ready
Process Schedule
APriority
uatum
(Runmin

1/o Reouest
Woit
Process Comp lete d
Suspem ded
Resume (Terminat fon
Suspendl
Wait

New State This is the fout state of the


LWhen process Cteation
process f e
Cycle 5
takir9 Place, the ptocess
C neur state

Keady State - Nhen the pTOCessOeat con


2. takene plec
r e t s Comple tea the pscoCesS Comes 7to a
eacy
Durccmg thu State the pzCess
(oaed ndo the
State
memory o AbePacecl m hhea
hmain queae of
sses whic h ate waiter fot the C PU olocation

tate Nhenevet theCPU


: wher s
lococt ecl
Runming
3. om t hthe
e 7eacly 9e ue he
ptocess
ce ss
prro
the /m9
Chang to Ku797n
s tate
eck o2 Wait tats LWhen the
process s executemo
he Cmatuctton, the pzocess miq t
reguue CoUeyin9 out
feur tosks which mig ht not reauure Cpu the
process requwes perfornmrmomput -Output tas k ort the
pocess neecs Somne 7tesOuwt ces which ane OTte acly acouted
bu othert prrocesses, dlurimg Such Conclctions ptocess

DPLO ught back Tnto the main memoty, and the State is
Chamged to Blocking or w a i t o the 8tate

imstructio
lercminated or Completedl When the entire Set of
Connpletecl 7he
Cxecutecd an ol the DrcOcess
s

to t minat e c
Prco cess L Completed. dhcl Chamgec
Completecl State. Dwuimq this state the PCB Othe
process

As also dleleted.

Suspenl Reacly: So Nhemeveet the maim memozty sFu

the p7tOCess Which t a


7eady 3tat e 2wapp ed
om nmaun memozty to s econclasty 9m e?mmorty. T l7e
out
C a 7teacly State when gees through th
DTOCess
Tainsition Of novin9 9atn 0 e n m orty to SeCOm dlay
cOm
to
memony, the State of that pnocessas Chanq ecl
Suspemol Ready State. Once the maun memOry w i

have enough Spacefor the ptoCess, the process uwik


be brought back to the maim memorty amcl w i l l be

(m a 9teacly State

)Suspemcl Walt o Suspenc Blocked Whemeverc the process


block Stcute m main
thot Cn waittng o State o0r
memoTy qe ts to Swap Out to Seconclarty memoty du
the p r o c e s S
to mmem ony betm9 Completelu ull,
mln

State 8Cha7ngec to Suspemd uwalt o r Suspenel


hlo ckeol
State
4 Illustrate SJF Scheclukinq algorttthm wrth the help
Cn Pre- emptive amdl Non Pre- empttve
0f example
Schecdulinq
m Luhie h
Shorctest Job Fist (sJE) s am alqonithrm
executcon tlme
theptO Cess havimg the Smallest
executton Tho Schecluling
ChosenF0 the next

Can be preemptve O m0n- pree7ptve t


meth0c
esthe av erage
scecluc
5igmificontly executton.
Qwaltimg
Other ptocesS es
o SJE 9nethoos
SUF nnetho
bovsicaly tuwo types O
There one

Non-Breemptive Su F
reemptive SJF

Non- Pxeemptive SJ
CPUCyoe
Schedultng 0mce th e
In mon preemptive
holols t EC2 ( t
okocated to pococess t h e pocess

reaches waitimg State o r tern/mate


a
cess es each having its
Comsicler the folowimg five pro
aeival time.
Own Uniaue bwst tCme a n d

Arotval timne
Pcocess ueue Bust time

P1

Step 0 At tmme =
O, P4 a t ives anel Statt executCon
p4

But P4 stel
1)

At tme 1 , b r o c e s s P3 aeuves wte


Step execution uni to Complete. /
n eecls
2

Continue executton

Ps

6 Qddect
ttves aml
Step 2) At time 2 , PtOcesS P
to the wartin9 uede p4 w ContineuL execub
time-3, prrocess p4 will finbh d executon
The burst ime o f p3 and PL s Compoan ed Pr ocess
ess
executecd because its buwst timne
P
Commporecd to Pz. Which s Smnollrt Jo 6
Pz or P7
P3 P

acdoled
anol s
time- 4, pocessP5 arvives
Step 4) AA
urtl conltnue
executton.

to the waltCng aueue. Pz


to
Pa Ps

P4 P
added
Omd As
aruives
time = 5, prro cess P2 w L O C o n t i n u e
execUtton
Step 5)At w a t i n g L e ue
P1 .

to the
P Ps
P4 Pa
unish ds execuGor
P wll
Step 6) At time =9 , prtocess Compateo
buwst t i m e of P3, P5, anol PPo
The
The ttme s the
executed because ts bwst
Process P2
lowest Smaller Jo6:
Whuch 6
Ps Ps P
Pz Ps

P P

5 ae
Step 7) At Lime =lo, P s ex ec utimg amcl P an ol
im the aiting queue

10 Ps
P+ P

Step S)At time - 1 1 , process P wtil fim/sh rts executton


The burst time o f Pa a m d P Compar eclProcess
ProcesS
s executed becawe t buwst time owet
Lwhich 4 mnal ob

PPs

Pe
fn sh ts executio
ts n
executio9
Ps will
process
time =
15,
Step9) At

15
P
Pt 11
executton.
i
P3
wtl inis h
23 pocess
Stepio) At tinme

23 Ps Ps
Pa

aD0ve

wottimg time or
the a v e r t a ge
Step 1) Let 's CoLLCulte

example.

NoLt tme

P40-0 -0
P1-3-2-1
P9-5 -4
Ps l-4 7

Ps-15-3-14
Avetage waitin9 me =
Of1+4 + 7+14/5 26/5 - 5.2
Preemptive SJF
m Preemptive SJF Schecdultmg, Tob8 are put into the
SPhon tes t
eacly queue o they come Apocess wrth
burst tme wives, the cwwtent process 2 temoved
pneemptedtom executi on Q770 the shottert Tob

allocatect CpU Cycie

Considlertthe olouwing ive process


UvOktCme

Step o) At time =
O, P4 awtives OLmo Stoct3 executton.
Process Bwust Avival
Que ue ttme ttme
PL
P2
3
O
Ps

P+

Shorter
1, Pcocess P vives But ,P4 has a
Step 1) At time =

burst time. t us contimue executton

P4

uith bwst time 6

Pz avtives
Step 2) 4t tnme 2 , prtocess
bTSt tme mo7te than that of P4. Hence
The
Pa wLConinue executton

Space Qclclress Space.


tep )At time :3, prrocess P willinish ts exec otiom .

The bwst tme oP Pamel Pi s COmpored tocess P


s executed because bwst timne Lowe1
P3 P
Pe

Step 4) At tume = 4 ptocess Ps uwll CUuve


The busEtime of Pa Ps amol P Compoureol Ptocess Ps
L exe cuted because r low est
bwst time ProceSS
P1 peemmpted.

Step 5) At
tme 5, ptocess PwIl owuve The busst trme
of Pi, 2Pa anol Ps s Compot ed rocess P2 s
ex ecut ed beca use burst tme s
least Brocess P
S Dheemptec

Step 6) At time =6, h s executin


9
Step 7) At time =7, P2inishes i executCon The bwst
mme of Pa, PLmol Ps Comport ed. Pocess Ps
sexecutecd because rts bwst time 8 lesS CH
Step 9) AE me o Ps wut
Fimsf ts
ProcesS P executecd becaus e execution
its
amd
less busst time

At me =
15, P1 hes it
9)
Ste
Step
Omy LO cessLePt t wtt execution
Staut
eOn p s
Pa tre
the
exec ut
ton
lmez- . 23, 3
time ms h es
Step lo)
At executio
e the av
Step 11)
Let's
Calculate
ercage ualteng tme
above Cxample or

wait ime
Averto9e wot tmg
P4 0-0-0
TTme
+ 6-7 O+ 1+0+
PL
(3-2) 214 23/5
P25-5-O 4,6
Ps4-4+22
P a 1 5 - 2 / 4

You might also like