0 ratings0% found this document useful (0 votes) 104 views71 pagesOperating System Notes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Untteducten
Sa emma _—
Gard wave) Seyyy©
Mechan foal Set ef Pxoqrams
Electeteal foes Cc Sy
Electtentc Apphtabten Syskem
(Spredheek, Db) Cos)
[> ——
nated Je
Inteemediatory
User J Syplerg H/us
“9
Mac, Windows , Andaid fos, LPrux° OS Goals
| L, Primary + Convenience | Ease feel
L (Easy fouse)
Secondary a E ffference , RelPable
Mana gemant-
* OStunckeng
@ Booting ; starb the computer & make
Pe Velaoky to work,
® Paveess Mgmt
® Memory Mgmt
@ Fle Mam
© T/o Device Maret
© Se custty
* Types of OS"
— Batch
7 Mullip mg tammad
—? Mule heske
~7oclustesed (Laur i = 41)
= Distel buted CE nvixonm ent J Se hemq)
SeNor centered ak point
C1 H1 xed /nareow a
SYyskM funct enaly he
SAC, Washing mic.
> Embedded (Spec LiI atch OS
Ul + fo] r
— >| Batch)
- | Geteh |
U2 —s> CRU
U3 T Com pu tee,
“5 [Batch a]
=
UN
Process
LO Time Ny
CPU Lilo
Gatend) =
J
TS
To L/o
CeuU URN 3aHEn KP Bane Baye
©
Padi hai: MulHprogvammt OS
— No preempt en [focus en move
Haan «4 px éeas
©
[eee{ TT
e\
(x40)
a preemphen : force fully
P Shoppinsy Py
“e & Stash other Py
Po
Ps
_7
2 Malt taski
CPreemahen arrowed)
Eqs Seiffee,
f BR OR PR oP R (10 seifice
MP) Tare 10 selfice with each®).
MT Take S setfee then next. Mul Hpwessing Os (7 ue need
- many Processors
ferut] oP uv 2[ —~ Nov ex tea “
A) ‘Alo )
“ )
o> Parallelism Treweadtal
- FWicteney Im proved)
oF Faster Peocessing
7 Relat itty
o Pwocess Ve Peo gwar)
a
fre =
coe e
Program Process Cdy namic aby)
Jf \ees entity)
v
Re ursiené
Tunetion
temp var
Dynam/,
3 7 Global &
Ao cahen Static a
Set o
Trsteuch 6x,° Rea | Time Os L Time limit _[ PD eloteyx |
— Ly ord {] stePot
L, Sofr 2 Yess Stefch
PR
D
& Steuckire of OS [ Cimpenenls of 08
axe owganizccl
— gimple ‘nteeconnacha|
Applicahen Frog var Easy
out
4 ; ; OS Crashey
Device | Orley, Cas Usex
Bios (Bevia P°g fails)
o> Fach Layer has aq
Specific te sg
= Hreravchy : Loyeg
Can use the Seru ce:
P»Dviclod by lower y
—_ Enettpenclonf° Miow keyne] Os |
Ls Removing au non- essenta|
Componen)s of keyne)
a a ee
G
k | ierpoeces.s gon | fepu iy
leat ™ Shectu \i
Communicahen 4 a
" + 7 Mfczpkerne|_ 4 ee
_ ee _ _ — Herdware
~ _ oF
—? Complex. | kernel Tntteface = OS|
“7 Usey
Os
Cora ma ve Graphical
lene. User
\. b
USE O » USer ferencl Ly
Command& ° Ive oh rycal
(TOO puch °Teons
Technical)°Sysko Col
en hanes
(ie jaa ca
{— a
Bre z
7 = haf
User ———s OS >) H/o
samy) Sc
— Process le Henny
§ Creake | SPEN, Close, delete 2 Veadl,
antes “Wsek & get file afr, }
F Device Mager
f Read eat be, FEQUERE | ve lease }
£e postHen
7 TEnformaren § GH System Hime & data ¥
{ geh Pe, gh attr? .
— Commun cafyen FOveat ycele ble cnnech®n, Ape f
4 Send, .eceKve &Mode —> User (m=')
(Applicat? operate hese )
(slave unpavile ged mode )
kernel Cm-=o)
(Core OS funchens)
C Ma stex/ privileged |eqstem rode)
—
(uM) Cem Ses
< Sys Kk cou
ee
& Relurn
Systen Context)
call o
YO execuke Swe
from Keonol
Print we ()
es Pore. =* bork System cade
O + chhld procege
l, { Fa vent PPOCOSS
PC)
fore.)
J 4 ferec)
Ls
antia Porenb techie
Pc )
q fore) 2 feck ()
fork OD ¥
Zz ny
chia 4 aoe
> e
: Re b
Child & child childs wre
sahilThee As _ _
[prea s q
J Mule
ingle
Cede Data Frles|
Reaister Steck fT Po
Pa
RS |e Ss les
af |s
Code Data Pe]
? Single
Proce as
Cuttiple tabs Paw
Boow see)
Need Creaking “new Hrtad in Cveronl
~~ PRWcess Veq re lego L'nee &
“pork than concn) a Ney
Pre ess
Threads an Share
&) Centexk switching, Is Quhc&.
4) com be tenuinaked in (eas Him
commen daly° Usey level +Hyseac}
: —
Ls AS tha name su qed
> threads ct usee level
Ve hese threads Veh
Manages User/appl™
—> faster coat
> VULT ge blocked entirely CPsvcess)
kernel level thread
Ls Threads) ver mamaqse} by
Opexah salem
—= Slowes - (Cs)
————
uP]
oj frat Me © Prigsi by
i State 5
Cea le Read cele Ving
2 Terminglid
d G, A
To
c a, Emp Hear te,
L/o To be. ve
Compye a walt e PCR
blockWw
° Sche dulers Tob sche cutie
L, long Terr Gud Reads)
Short Te R
bP Tam or CD sia Ren
Mecium Term
To -
Le cess a? CPU é) (P2) ) ¢ storoti,
Tiree
> 10 OY @ } rate
suv Sckeduhyg
CPU Schedule ~
soredulee Chat)
wo Swa wy Schedule
war tblocte> (mM) Cum )
ff CJ
walt (SM) Ready / com)©
otto} Dom
\essey Conkea
over Dom
Sh Recluces
+he Dom
lTs
¥
S
—e
Dom = 40 >
. Degree | Malki progmm mira,Cwiich (PE) ta Reody @ Ps atone
© CPU Shidul? el # ce
L, Pre empl ve. Nom Peeemph ve
"SRT eFCRS
PLRTE © STF
© Round Robi ° LOF
on © HRRN
7
. “roy
o> Shovkst Remalrf Time fifrse
o> Lergest Rematring Time frrer
es First Ceme fireb” eve
o> Shestest job frre
4 Longest Job firs
Highest Respese Rabio werf-
—
OMe Quake [t! unis for each ©]
D Arrival Time’ shen ® enter Hho Ready shale
© Bussh Time: Time wequirt, by © to execute ,
@ waiting Time: [TAT BT]
Damn axound Time: LcT- AT J
S) Completiert Time: peheon (2) Cornflele PIR execubien
© Response Time . \(P) gee cou time )— AT ]° Nen- PreempA've
@ FOFS _
fg Pre AT 87
PAL oO 3
Po 4 4
P3 2: 2
P4 3 4
TAT = CT-aAT
WT = TAT—@T
CT TAT wt
2
CT CTiavexse Right to dofh)
[ Py Po
° 3 %
Ps | Py }
J to
3 Oo
F G 2
3 fp 3
40 F 6
Problem : Starvation
@ STe Consider Shortest BT furst)
les | Py [Pe
[Pa] PafaPot Pe |
4 G6 \o
Pro ai TA
PL
SS Zz
PQ lo g
P2 6 4
PA 4 4
Op © off® LT F Ceonsicdve Loree BT CixsPy)
Pro AT Br cr TAT Cw
PL io Zz Z 3a 7a
P2 , 2 + . >.
P2 2 °
PY Zz 3 # 5S
~ L 10 £ é
A W)
Pri} po “PZ i PG
o 5S FG 10
@ HRRN
Response Ratio= WT + BT
BT
Pro AT BT
Pa Oy GF At £= 9 (P2) completes
Po 2 6 P3, 4 ‘e Ps available
e P, = (9-4)- 5
3 4 4 WIG carey =3
4 ° > Pp = (Q-eet
PS
RR PB = St4 - 2-25
ons \_, pq = ats
P Ju; a S45 \2¢
[Pifexprs [Ps] rs SEBS U6
og 3 12 [5 20 J+2 -
Ce
(P3) selectedp, » (13-6) =F
uno Ps
PS = (3-Y =5
RR ary = EPS . 24
QS f6 > 642 2 a5
Zz
(?5) select
e Preemphye_ makuee °
O sere
Ly Poo AT ST cr TAT Wh RT
PI of? = € ©
Pr 4 5 a
PR ge o ©
P4 4 a + L 1
P2 | P2
pr] Par | e 5 | + @ 3
4
\5
O
: YO Wap 5
itPhe AL Br CT TAT wT RI
e
p2 |e 5 14 JO
5
16 \4 see)
Pg 4 2 SF 15 4) 8
fer] P| [ps] erf 2 [eal el [PoP (P1 r2[e3]pq|
! 5 ug
5 | u (2 3 2
[pif p2] Ps] pa
1s 14 15 1 te
® Sound Rebhe/) CAT 4Q@ )
mMinCBT,Q) S @=2umtb
Eno AD Br CT TAT T
Pa oO 4 Ff + a
PIT 4 0 5 2
Pook 6 4%
Pg Z & ~ 4[pie fs Ot Paes
are _
[ri] e2 at if Po} ral
t pee
CS = 5
& ci (Preemphie )
Pro Priaritey AT 6T cr TAT wt
fr 2. ° 6° l6 16
Pe 4 | s* I 10
P3 6 o 1 $F 5 2
Py g 4 2 6 2 O
[ALE Pte Spee ——
1 2°34 5 6 oe
(en preemphie )
[ri | Panes | Bf
o 2 I 16oMul# Level Quewe SApalul
oe | Gy Ready Queue
Ss _ Sysem © CPriovity)
Priel | _Tnlevactt ve @® CR &)
_ Batch ® > (STF)
feedbact y
He —
~ > ate
- J demeton
| ree Preeten
Le° Process S nebo niza Her
io Mul ple PROCESSER CCU,
Access Shavecl wsoumee
without — fnkee-feri woth
€ach other fe Meu N teu ry
ake ESE ae
Process —> Trdepement (No affect)
Coopesa tye. Caffect
ather a
-\, get affected
dae dev 5) Resource eg Other)
Ly ®
Face CendiHen
cdata= 100
aS ©
Oo = data b= data
ea #50 bebr5
— Mp —Preempb—
Claka = a dake =b
data = 105
dake =1.5¢£4 Count +++ Count -—;
D umte Ri, Count © waite R2,Cownl
@® [Ne # ® DEC Ro.
@ wre Count Ry ® wee Court, R2.
“A
[,® .@
\
\ eo co | ee
—_
; a
Entey Sechen
c odtHeal se cken|
=
Exth S&cHsn> Cotteal Sch Or Preélem (s0/")
re Com HERR
eo
© Mubtal Exclusien
fos]
pot
(Pa) { at_a ume
~ @}
only? OF Process
@ Proevess
Inttesteo Process can po [es ]
Not Inteceattol PY should not step
in teers Hel CP) .
@) Goundeo) warttre CNot mandakecey )
A Bound ov lPmiF shew exitof for
a process to how ma HDB oe
precéss can enter trerrfCs].
esq
Cv) i 263 PD oO >
Cx) Wa - - 00 >© Soluvens
® Two Process Solutvon
*) Torn Valutible.
Pi &
whlle Cr) while Cu)
wh? le CTum | =0); ‘ while Turn) 21):
CS cos
Turn= 1 Turne 0°
— Ncs wINCS
f }
e Mukial Lx ctigien
° Progress he re Musk Go to
CS +hem paly
Pl cam. visi cs]
5) A reay [Flag J ath
oof
whe (Oo ove
while Cr)
Foy = Tue RB “True.
whele CF C41) while CF Lol )
cs GS
F [oJ= Fase. FCI} = False
NCS RaaP, Po
when [TF | T |
° \
“ ~
No pepcess oe
entee in Cp
aA we encounters)
“ Dead lock.”
solubion
°) felteson's solu
> use [Turn vanab fe |
[ Plag age f os ay |
P| Tye ete Pe)
while cv) while C1)
5 .
FLol= Tue ‘ees Tae
Turns 4 deine
while (Turnz=4 2 & exilet Ties :*
FLIP = Ta) c mene
ys a
F hetp= Fats ce
. € Nes
< ¢6 hock Vora ble <
oor Iso"
® while CLocke= | ); Entey
@ Lock=t
®cs
@ Leceso { ExSt
© Leck! =o
® sek Loc=|
@ Ene cs —
> = r<
@® Lock=o behowier (NO conflfct
A\ ag Nene)
Bub
@ lock): 2 ® lock| =o
Peeemph— Oelock 2 Il
CO selocks | O@CS
eos
@ ¥
Mukul exclusion Cx)o Tesh & seb
Hexen oe. combing O & @ ‘ancl
Make RE an abo mic indteuchron .
Camb) Ne
honce
Name whe
Jest & seh
® Teab | a
&
® se: locke =4
: . oy
[ chile C Testa cetC & lock); J
es
Leck = False
Nes
S$ Boolean Jeab& ser CBealeam + target )
Balear) B= * bavgeh
2 target =Twe
7 we barn = s)
Lock. Konget Ss
[aise <— | “f [forse]oS Ema proves _
es Dies tea C1965)
Managing Concuyet nt PPO cesses
Use “4 a Thtegek Youu ©
“ Cvana ble )
Riney semaphore Ca’ oe 0)
PCs) £ walt
VY CS) § si
» Sleep of down )
gral, Wa keep or up)
P ¢ Semaphore S) V (Semaphore 3)
whale (Ss <0); S++!
s- ,
; ©
code
PCs)
{es |
VCs)
XANes
Q>© @ @
oN oo worf as
tes (s=se)
S=f
Se 4 G)e Counhing _Semapheee (- 2c +o 00) €
Int vandbl evolu
PCS)
)S=5 [_e€s ~ (OC |
VCs) Block (sr
PCaemaehece S) V (.Semaphowe s)
i SG a— S = S+)
CS 0 (No @ in Block IPshD© Prrducee Censumek Problem -
Producer C) f Consumer ays
. tule (pueyf
wule (Te) { Wait CFO)
"Produce anfem walt Crate) °
. Consume ©)"
watt CEmpty)} ‘
walk ( Mut) | Signal Craw Ha J
Inseat): Sig nal (Empty);
Sig nal Crate)
Sig nal Chul), A
y
7 FUL O° Filled positions
: . SPICER
REmaphece —> Emply sy’ empky op acek
Ue > For mutttal excludsan> Readit- wate Preblare_
Car have IRead ee |
Gut ar fru
(w-w) &y
Nob
Reaolee ( df
waht Cmetex)
RO FE
FP (RC ==1)
Welt C wale)
signal Crufex)
Read C) VES
Walt (mupec)
RC ee
FE CRO==0)
Signal Cun'fee )
(0?) Cecry)
4% blocked .Dead lock flop pehle
a
Eh
Allocabed Request
1)
Rea (3 Allocaked
ZY
Coes 5
th 2 D
5
5
a
Fe
i Cond) PH eres fre doadloce
—> MuPhaal Exclusien
— Hole” & Walt
FM, Preemphen
rule wastBe nly Le Can Uae
Reasouva a & Lng
CNon- shaca a)
eHOlo % uch : : (Pi) heating a leaal-
CK Resousee & wail
te PVE VE SOUT
thet ake acgul xed ey
Offze x (F).
evo Preemplten : ® Cant ently release
the § Resource voluntorih
afte Completing He
(POLLS
eCfreilae werhy:
a
@. @)
7 ee
6) ——=(f
AU “Condi HENS priuch be holds
y© DeadlocK, Handling Method s
@ Prevent dts alweufs bette dren.
Cure:
Na Deadlock should not
happen.” very stefeL”
Drive. Slow & preven ace iden
\
© Mutual fxctusion © Nobalh we sources Can
~ be made Shereakda.
e Hold & webb + can Vilate TE
yp |
oo AY
Pocess Sheulot. To request foe Time ow
PVE atl repre adetitonal Risouree oe
~ wos .
Ye Source bgorve first weiease py “4
Renn,
Resource tak
€ ewe tS bej held.
NOF atloweal 40 Ruin "d
oho Pre €or PL Br: an voilake Tr
Gb Pree mphen can be. Seng
based en poonity
o SM artahay Was} 1 Sem vorlatt ie
/ : Process cam wee veh
wsource In higher /
inc seasi nq order> Avotdance 7 you can pre very
bu 40 avoid rEG
‘,
; CA pit tess, sel ch)
~" wtewe we Fey to peovidt ali infetd
*Bemeess wigatth SH
Teel = (5,5,5) Ri) & RH* ®
Aocatd = (5° 4 3)
Avollable= Co, 1, 2)
R\ Ro RB RIA Re RB
Po \ a | 4 Oo 32
Plo2 © \ O A 2
P2 a2 \ 4 2 0
LAtvocated | [weed / Reavestd)
SO we cam FeV GN the need of MH
Need» AO Y\ BD ancilable @ Oo 12
New Available = 2 © |
+O 42
a2|3
Next, Ro Nek ce)
NAs | 2) NAS B34
2 13. a2 2 |
334 ‘sss* Deteclon & Recover
CBankex’ M40 )
(Resource atiocahien
°
=
NU
Png thin Reco
deed Pro cess Terminals,
Resourey Preernphen
Graph)
Ta norance [ asterch Atgo rithm |
—
—~ Windows 7 Mae
NO Cencept alcadloce exists
Pofow Hees apprwacn
to hancie déadlock | Tg nor
* 7d
dB a Ram ever... ana the
Cosk requ red 6 hamd |e
Deadlock rs hig6.© Recoyurce MUocaten aaph -
node/ vertex
\
vo b
Process Resource
@ 1
v
Single Mul He Instance.
Tnstancy Jone
Assign Req vest
Le—>(P) OR
If Cy ha
Ry a exists
+s 7 Dead loc &
{ (Pag I< —(P| Moxy [ May Nob
or be present
Ry “S rf cycle doe's'b
Allocakeel Ree euch a
Ee RO CRay cas -cR2) Deadlock
Po A oO O 4 Ao es f
¢| ° 1 1 O ecisht
Avculable LO,O] 1 Po Pix
THE TS aAAdsad\ecke sftaaHen-an Manag enw |) Proper |e front fopih eal
\s te Lut izaiten sf PRY
2) Mull prog raring Me
_ out
CPU
Thme_ Cleas)
gis
ey
meneey hlerare
rs)
ae)
_O ae ® Process LL Ho
Degvee x cpu |
Of uP UH isa Vy> NO <\ process in MM ()
Me MO
Non - Contiguous
7
Fog? ay mentahen Seg mented Fixed Varta bie
"t pag tng Pas HHeA portthen
a] w> CF)
m <=:
|
\
} OS Os
~ Combate ud [ Adar. Trad lahen |
(Relocation Regis te)
PA =. DA + BA [|
7 ,*
Physical Lo gical Base
Adar. Addy addy
Copy CGiven)
ey
cpu)° Fixed part Hening
\ -
Ls fixed no: e] porten s
> Port len Size may be du Ff exent
—> Spannin Not Atlowed .
> Wasteae eo
CIF)
Ly Size Grits Porn CY boyve max BB)
TI §=OeReTr
Unequal Equal Fant Honing
Poss H enir :
Prvcees sing | CNob atlowed )
ofa TL)
Porton IF
Size
> Degree of Malh pre grorem ing is
‘ot ffected here
> Exteenal fre gary Falher exPe}g
C Have space ark Coun! Re
Uocalke 4e @) /
Due to Comba vous Cenc Hen\
© Vartobly fake iat
fay H Heng
C Dynamic Nature)
NO Yoternal Traq menbahior
Exter rok Prag mental Bry &xtsp
No affect en Dom.
NO Regttichon en Process
Size.
wee NOW +0. Remove tre ER preblem
J Proce ag Shiflira bub Vamable si
LTV
frm start Toy ¢
P| PS=4MB (Picot Pep)
SMa [ Last atlocaHen Search)
P2 E = br Pee BMG C Next i)
loma
—% = 8mMB (Best eft)
P3 Qless Wwosyed 6} sPace)
Cless TF) “CEnttve 'M’ scsi
15Me
—F8 = SMB Cwerst ppt)
Pg OS Cmost wastage 64 space)
(More TE)& Kon Contiguous “mony AUocaHten
\
Ls Used te Fix CER)
SO herve oluweuls wire e to
curahy at he no eh holex
H their (aise +0 partiHen
Hu Proc eXxs accordinaky
Fag es .
, =
mF Framex,Frfo ot)
J
o\o i 2 3/
\\4_ 5 6 +) PLo]
2\8 3 wu
B 213 14 15 PL
4 [ie Tes
5S |e 2 22 23] Pl2q
© | 24 25 26 oe
z
2891 solar T PLSI
Process Stags =16ER
Page Sig § = 4B= ~ Frome stag
MM sige = ase
Noe pages= 16 = 4pogen
No: of
homes Se = 36nd
regical aad Framsiien Phystcal Addy
Pte] 2
bik 2bPE ae a
MoOO oosits figoo-S
Geo | O15 ae [ :
Ie o 1 0234R ;
PLY} | | (ap ae
eed 5” Byte = Logical addy moo
@1 [ot
er)
Physteah addr oe
no pyit alge:ig e Table > deka Dae Shuck &
— process hak Ah
Stpavale PT ,storecl ?n MM
— > No G] Wo Entties
| Pages of Im PT
Lys Page Table No:
en cy Size ~ Soles.
°
fea
2
eB
P.
lreblem ; need 2 Access
Ly Porge Table
Ly Ac tttal oyke Hake
@ Storage OFT Read (To store PT)
@. T0AlaH En Ps COMPLEX FLAK