You are on page 1of 34

1 Oper

ati
ngSy
stem

Oper
ati
ngsy
stem:
AnOper at
ingSy stem per f
ormsal lthebasict asksli
kemanagi ngfi
les,
processes, andmemor y
.Thusoper at
ingsy stem actsast hemanagerofal lt
he
resources,i.e.
 r
esour cemanager .Thus,theoper ati
ngsy stem becomesan
i
nterfacebet weenuserandmachi ne.
 
TypesofOper atingSy stems: Somewi del
yusedoper at
ingsy stemsar eas
foll
ows-  
1.BatchOper ati
ngSy st
em – 
Thistypeofoper ati
ngsy stem doesnoti nteractwiththecomput erdir
ectly
.
Thereisanoper atorwhi chtakessi mil
arjobshav ingthesamer equir
ementand
groupt hem intobatches.I ti
st heresponsibil
ityoftheoper at
ort osortjobswith
simil
arneeds.  

AdvantagesofBat chOper at
ingSy stem:  
 I
tisv erydiff
icul
ttoguessorknowt hetimer equi
redf
oranyjobtocompl
ete.
Processorsoft hebatchsy st
emsknowhowl ongthej
obwoul dbewheni
tis
i
nqueue
 Mu l
tipl
euser scanshar et
hebat chsy stems
 Thei dl
et i
mef orthebatchsyst em isv eryless
 I
tiseasyt omanagel ar
gewor kr epeatedlyinbatchsy
stems
Di
sadvantagesofBat chOperatingSy stem:  
 
 Thecomput eroperator
sshoul dbewel lknownwi t
hbatchsy
stems
 Batchsy stemsarehar dtodebug

Qur
banShar
if
2 Oper
ati
ngSy
stem

 Itissomet imescost ly
 T heot herj
obswi l
lhav etowai tf
oranunknownt imei fanyjobf ai
l
s
Exampl esofBat chbasedOper ati
ngSy stem: 
PayrollSystem, BankStat
ement s,
etc. 
2.Ti me- Shari
ngOper at
ingSy stems– 
Eacht askisgivensomet i
met oexecutesot hatallthetaskswor ksmoot hl
y.
Eachuserget st hetimeofCPUast heyuseasi nglesy stem.Thesesy st
emsar e
al
soknownasMul ti
taskingSy stems.Thet askcanbef r
om asi ngl
euseror
di
f f
er entusersal so.Thet i
met hateacht askgetstoexecut eiscalledquantum.
Aftert histi
mei ntervali
sov erOSswi tchesov ert
ot henextt ask. 

AdvantagesofTi me-Shar i
ngOS:  
 Eacht askgetsanequal opport
unit
y
 Fewerchancesofdupl icat
ionofsoftwar
e
 CPUi dletimecanber educed
Di
sadv antagesofTime- SharingOS: 
 
 Reliabi
lit
yproblem
 On emusthav et otakecareoft hesecur
it
yandi
ntegr
it
yofuserpr
ogr
amsand
data
 Da t
acommuni cati
onpr oblem

Qur
banShar
if
3 Oper
ati
ngSy
stem

Exampl esofTi me- SharingOSsar e: 


Mul t
ics, Unix,etc. 
3.Distr
ibut edOper ati
ngSy stem – 
Theset ypesoft heoper ati
ngsy stem i sarecentadv ancementi nt hewor l
dof
comput ert echnol ogyandar ebeingwi delyaccept edallov erthewor ldand, t
hat
too,wit
hagr eatpace.Var iousaut onomousi nterconnect edcomput ers
communi catewi theachot herusingashar edcommuni cationnet work.
Independentsy stemspossesst hei rownmemor yunitandCPU.Thesear e
refer
redt oas  l
oosel ycoupl edsy st ems ordi str
ibutedsy stems.Thesesy stem’s
processor sdi f
ferinsizeandf unct ion.Themaj orbenef i
tofwor kingwiththese
typesoft heoper ati
ngsy stem ist hati ti
salway spossi blet hatoneusercan
accesst hef il
esorsof twar ewhi char enotact uallypresentonhi ssystem but
someot hersy stem connect edwit hinthisnet worki.e.,
remot eaccessi senabled
withi
nthedev i
cesconnect edi nthatnet wor k. 
 

AdvantagesofDi str
ibutedOper atingSystem: 
 
 Fail
ureofonewi l
lnotaf f
ecttheot hernetwor
kcommuni cati
on,asal
l sy
stems
areindependentf r
om eachot her
 Electr
onicmai li
ncreasest hedat aexchangespeed
 Sinceresourcesar ebeingshar ed,computati
onishi
ghlyfastanddurabl
e
 Loadonhostcomput erreduces
 Thesesy st
emsar eeasilyscalableasmanysy stemscanbeeasi l
yaddedto
thenetwork
 De l
ayindatapr ocessingreduces

Qur
banShar
if
4 Oper
ati
ngSy
stem

Disadvant agesofDi st ri
but edOper atingSy stem:  
 
 F ai
lur eoft hemai nnet wor kwi l
l stopt heent irecommuni cati
on
 T oest abl ishdi str
ibutedsy st emst hel anguagewhi chisusedar enotwel l
defi
nedy et
 T heset y pesofsy stemsar enotr eadilyavai l
abl east heyar everyexpensive.
Notonl yt hatt heunder l
yingsof twar eishi ghl ycompl exandnotunder stood
well yet
Exampl esofDi stributedOper at ingSy stem ar e- LOCUS, et
c.  
4.Networ kOper at i
ngSy stem – 
Thesesy st emsr unonaser verandpr ovi
det hecapabi li
tytomanagedat a,users,
groups, secur i
ty,applications, andot hernet wor kingfunct i
ons.Theset ypesof
operatingsy stemsal lowshar edaccessoff i
l
es, pri
nters,secur i
ty,
appli
cations,
andot hernet wor kingf unct i
onsov erasmal lpr ivatenetwor k.Onemor eimpor t
ant
aspectofNet wor kOper atingSy stemsi st hatal ltheuser sar ewellawareoft he
underlyingconf iguration, ofall otheruser swi thint henet work,theiri
ndivi
dual
connect ions, etc.andt hat’swhyt hesecomput ersarepopul arl
yknownas  tight
ly
coupledsy st ems.  
 

AdvantagesofNetworkOperatingSystem: 
 
 Highlystabl
ecentr
ali
zedservers
 Securit
yconcernsarehandledthr
oughservers
 Ne wtechnologi
esandhardwareup-gradat
ionareeasi
l
yint
egrat
edintot
he
system
 Serveraccessispossi
bleremotelyf
rom dif
fer
entl
ocati
onsandtypesof

Qur
banShar
if
5 Oper
ati
ngSy
stem

syst ems
Disadv antagesofNet wor kOper atingSy st em:  
 
 S er versar ecostly
 Us erhast odependonacent rallocat ionf ormostoper ations
 Ma intenanceandupdat esar er equi redr egul arly
Exampl esofNet workOper ati
ngSy stem ar e:
 Mi crosof tWi ndowsSer ver2003,
Microsof tWi ndowsSer v
er2008, UNI X, Linux, MacOSX, Nov ell
Net War e,and
BSD, et c.
 
5.Real -TimeOper atingSy st em – 
Theset ypesofOSsser ver eal-ti
mesy stems.Thet imei nterval r
equiredt o
processandr espondt oinput sisv erysmal l.Thist i
mei nterv ali
scalled response
ti
me.  
Real-timesy stems ar eusedwhent her ear et imer equirement sthatarev erystri
ct
l
ikemi ssil
esy stems, airtrafficcont rol sy stems, robots, etc. 
Twot ypesofReal -TimeOper atingSy stem whi char easf oll
ows:  
 Ha rdReal -TimeSy stems:  
TheseOSsar emeantf orappl i
cationswher et i
meconst raint
sar ever ystri
ct
andev ent heshor testpossi bledel ayi snotaccept able.Thesesy stemsar e
builtforsav inglif
el i
keaut omat icpar achut esorai rbagswhi char erequiredto
ber eadilyav ail
ableincaseofanyacci dent .Vi rtualmemor yisrarel
yf oundin
thesesy st ems.
 S of tReal-TimeSy stems:  
TheseOSsar eforappl icationswher ef ortime- const r
ainti sl
essst r
ict.
 

Adv
antagesofRTOS: 
 
 Maximum Consumpti
on:
 Maxi
mum ut
il
izat
ionofdev
icesandsy
stem,
thus

Qur
banShar
if
6 Oper
ati
ngSy
stem

mor eout putf rom al lther esour ces


 T askShi fti
ng:  
Thet imeassi gnedf orshi fti
ngt asksinthesesy stemsar ev ery
l
ess.Forexampl e,inol dersy st ems, ittakesabout10mi crosecondsi n
shifti
ngonet askt oanot her ,andi nt hel atestsy stems, ittakes3
micr oseconds.
 F ocusonAppl icat i
on:  
Focusonr unni ngappl icationsandl essi mpor tancet o
applicat ionswhi char ei nt hequeue.
 Re al-time  oper atingsy st em in  the  embeddedsy stem: Sincet hesi zeof
progr amsar esmal l
, RTOScanal sobeusedi nembeddedsy stemsl ikei n
tr
anspor tandot her s.
 E rrorFr ee:  
Theset ypesofsy stemsar eer ror-
free.
 Me mor yAl locat ion:  
Memor yal locat ioni sbestmanagedi nt heset ypesof
systems.
Disadv ant agesofRTOS:   
 L imit edTasks:  Ver yf ewt asksr unatt hesamet i
meandt heirconcent rat
ioni s
veryl essonf ewappl icat ionst oav oider ror s.
 Us eheav ysy stem r esour ces: Somet imest hesy stem resour cesar enotso
goodandt heyar eexpensi veaswel l
.
 Co mpl exAl gor ithms:  Theal gor i
thmsar ev erycompl exanddi ffi
cultf orthe
designert owr iteon.
 De vi
cedr i
verandi nt er r
uptsi gnal s:  
Itneedsspeci f
icdev icedr i
versand
i
nter rupt ssignal stor espondear l
iestt oi nterrupts.
 T hreadPr iority: 
Itisnotgoodt osett hreadpr i
or i
tyast hesesy stemsar ev ery
l
esspr onet oswi t
chi ngt asks.
Exampl esofReal -Ti meOper at
ingSy stemsar e:
 Scientif
icexper i
ment s, medi cal
i
magi ngsy stems, indust ri
al cont rol sy stems, weaponsy stems, robots,ai rtr
af f
ic
control syst ems, etc.

Pr
oper
ti
esofoper
ati
ngsy
stem:
ThePr
oper
ti
esofOper
ati
ngSy
stem ar
e:

1.Batchpr ocessi
ng
2.Multi
tasking
3.Multi
-programmi ng
4.Int
eractivi
ty
5.Real-
Ti meSy st
em
6.Distr
ibutedEnvironment
7.spooling

Qur
banShar
if
7 Oper
ati
ngSy
stem

1.
Bat
chPr
oce
ssi
ng
I
nBat chProcessing,t
heOSf ir
stgat
herst
hedat
aandpr ogr
amst oget
herina
batch,t
henprocessingstart
s.
Theoperati
ngsy stem per
formsvari
ousty
pesofact
ivi
ti
esrel
atedtobatch
processi
ng:

 I
nt hi
s,t
he 
operati
ngsy stem defi
nesthesetofj obsthatarere-
assignedto
acommandsequence, data,
andpr ogramswi t
hinasi ngl
eunit.
 Theoperat
ingsystem keepst hel
istofjobsinthememor ythenexecutesi
t
onebyoneaccordingtot hescheduli
ngal gor
it
hm.
 I
nt hi
s,t
hejobisprocessedbasedon  FCFSschedul i
ng meansf i
rst
-come,
fi
rst-
ser
ve.

Adv
ant
ageofBa
tchPr
oce
ssi
ng
 Theper
for
mancei
sincr
easedbecauseanewjobisst
art
edear
lywhent
he
ol
djobget
scompl
etedwit
houtanymanuali
nter
fer
ence.
 Smallscalebusinesscanusebatchprocessi
ngsyst
em forexecut
ingsmal
ltasks
totheirbenefi
ts.
 Forgivingresttosystem’
sprocessor
s,yourbatchsyst
em iscapablet
owor kin
off
-li
nemode.

Di
sadv
ant
age
sofBa
tchPr
oce
ssi
ng
 Someti
mesjobsar
eenteredinani
nfi
nit
eloop.
 Debuggi
ngt
heprogram i
stough

Qur
banShar
if
8 Oper
ati
ngSy
stem

 I
tpr
ovest
obecost
lysomet
i .
mes.
2.
Mul
t
it
ask
ing
Mul t
it
askingisat echniqueinwhichtheCPUexecutesanumberofj obswit
hin
thesamet i
mebyswi t
chingamongt hejobs.Thetaskofswit
chi
ngt hejobi
sso
frequentthattheuserwi l
lbeabletocommuni cat
ewi t
heachprogram whenthe
program isrunning.
Theoper ati
ngsy stem perf
ormsthefoll
owingacti
viti
esint
hecontextof
mul t
it
asking.

 Inthi
s,theuserdi rectl
yinstruct
st heOSort heprogram,andthenobtai
na
fastr
esponse.
 TheOper ati
ngsy stem managesmul ti
taskinginsuchawaysot hat
multi
pleoper ati
onscanbehandl edatt hesamet ime.
 Iti
salsoknownasat i
me- shari
ngsy stem.
 Multi
taskingoper ati
ngsy stemsar edev elopedsot hatwecanusethe
comput ersystem inter
activelyatalesspr ice.

Advant
agesoft
hemul
ti
taski
ngoper
ati
ngsy
stem (
MOS)

Ti
meshar
ing:

Ti
me-shar
ingist
hemai
nconceptandbenef
itofMOS.Al
ltasksar
egi
venasui
tabl
e
amountofti
meandnowai
ti
ngtimeoccursfort
heCPU.

Qur
banShar
if
9 Oper
ati
ngSy
stem

Handl
emul
ti
pleuser
s:

Mult
ipl
euser
srunni
ngmulti
pleprogr
amscanbebesthandl
edbyMOS.All
programsrun
smoothl
ywit
houtagli
tchi
nperformance.Al
luser
sofOSar
egiv
enasui
tableamountof
ti
me.

Pr
otect
ed 
memor
y:

Memor
yisbet
termanagedi
nMOS.Unaut
hor
izedappl
i
cat
ionsar
enotgi
venper
missi
on
t
oover
usememory.

Di
sadvant
agesoft
hemul
ti
taski
ngoper
ati
ngsy
stem (
MOS¬)

Ther
ear
esomedr
awbacksofMOSal
so.Someoft
hem ar
edi
scussedbel
ow:

Li
mit
ati
onofmemor
y:

Whenacomput eruseropensmanypr ogramsatat i


me,thecomputerbecomessl
ow.
Thereasonbehi ndist
hatmanypr ogr
amsar eloadedint
omainmemor yandCPU
cannotgi
v egoodt i
meforeachprogram andresponseti
meofcompl eti
ngthej
ob
becomeshi gher.Computer
swithlowRAM usual l
yfacethi
sprobl
em.Onesolut
ionto
thi
sistoincreaseyourRAM capacit
y.

Li
mit
ati
onoft
hepr
ocessor
:

Iftheprocessori
sslowinthecomputert
henitcanpr ocesspr
ogramssl
owandmanage
mul t
ipl
eprogramstakeslongert
ime.Someheav yprogramscannotr
unsmoot
hlyont
he
slowprocessorbecausetheyneedmoreprocessingpowers.

CPUheatup:

Bydoingmulti
taski
ng,thepr
ocessorbecomesbusyallt
hetimeandCPUheat sup.To
sol
vethispr
oblem youhavetoatt
achthecoolingsy
stem t
oy ourCPU.Thi
snormall
y
happenswheny ouplayheav
ygamesony ourPC.

Exampl
esofmul
ti
taski
ngoper
ati
ngsy
stem

 Unix
 WindowsXP,
Vist
a,7,
8,10

3.
Mul
t
i-
progr
ammi
ng
Mul
ti
-pr
ogr
ammi
ngi
sdef
inedasshar
ingoft
hepr
ocessorwhent
woormor
e

Qur
banShar
if
10 Oper
ati
ngSy
stem

progr
amsexi stinthememor yatatime.Wit hthehel
pofmul t
i-pr
ogrammi ng,t
he
CPUut i
li
zat
ionef f
ici
encycanbeincreased.Inotherwords,
Mul ti
-pr
ogrammi ngis
defi
nedasthecapabi l
ityofanOperati
ngsy stem t
orunmor ethanonepr ogram
onasingleprocessor. 
Exampleof 
Mul t
i-
progr amming:
 Acomput ercanrunexcel
andfir
eboxbr owsersimult
aneousl
y.

Adv
ant
age
sofMul
t
i-
progr
ammi
ng
 Effi
cientCPUutil
i
zati
on.
 Theuser sassumethatCPUi
ssi
mul
taneousl
ywor
kingonmul
ti
ple
programs.
 Shortt
imej obsarecompl et
edfast
erthanlongtimejobs
 Multi
programmingsy stemssupportmult
iplyusers
 Resourcesareusedni cel
y
 Totalr
eadt i
met akentoexecut
eprogram/ j
obdecreases

Di
sadv
ant
age
sofMul
t
i-
progr
ammi
ng
 I
tneedsCPUschedul
i
ng.
 Memorymanagementisneededt
oaccommodat
edi
ff
erentj
obsi
n
memory.
 I
tisdiff
icul
ttopr ogr
am asyst
em becauseofcomplicat
edschedul
e
handli
ng
 Tracki
ngalltasks/pr
ocessesi
ssomet i
mesdiff
icul
ttohandl
e.

4.
Int
era
cti
vi
ty
I
nter
act
ivi
tymeanst
heuser
’sabi
l
ityt
oint
eractwi
thacomput
ersy
stem.

Qur
banShar
if
11 Oper
ati
ngSy
stem

Theoper
ati
ngsy
stem per
for
msv
ari
ousact
ivi
ti
esr
elat
edt
oint
eract
ivi
ty.

 Handlinginputdevi
cesi
nor dert
ot aketheinputfr
om theuser.Example:
-
keyboard.
 Ital
sohelpst ohandl
eoutputdevicestodisplayoutputt
otheuser.
Exampl e:
-Moni t
or.
 Itpr
ovidesani nt
erf
acet
ot heuser,sothattheusercaninter
actwi t
hthe
system.

Adv
ant
ages:
 I
nteract
ivesyst
emsareeasyt
ouse.
 Thesesystemsareusedi
ntest
ingphaseal
sol
i
ket
est
ingi
nter
faceel
ement
sand
bef
orel
aunchi
ngpr
oductal
li
temscanbecheckedaccur
atel
y.

Di
sadv
ant
ages:
 I
nteract
ivesyst
emsmaycauseext ranoi
sepoll
uti
oninthesyst
em.
 Thesesystemsar eeasyt
obreakandgetscrat
chedbytouchi
nginter
face.
 Designi
ngcompl exandni
cegraphi
cali
nter
acti
vesyst
emsar edi
ffi
cultandtake
l
ongert
ime.

5.
Rea
l-
Ti
meSy
ste
m
Wecanunder
standtheReal-
ti
mesy st
em asthededi
cat
ed embeddedsyst
ems,
Anoper
ati
ngsystem per
for
msv ar
ioustasksr
elat
edtoareal
-t
imesyst
em.

 I
nar eal
-t
imesyst
em,
theoper
ati
ngsy
stem r
eadsandr
eact
swi
tht
hehel
p
ofsensordat
a.

Qur
banShar
if
12 Oper
ati
ngSy
stem

 TheOper
atingsyst
em pr
ovidest
heassurancethatt
heev enti
scompl
eted
wit
hinaf
ixedint
erval
ofti
met oprov
ideaccur
ateperfor
mance.

6.
Dis
tri
but
edEnv
ir
onme
nt
ADist
ri
butedenvir
onmentdef i
nesasetofmul t
ipl
eindependentpr
ocessor
sor
CPUsinasingl
ecomput ersystem.
TheOperat
ingsystem per
for
msv ar
iousact
ivi
ti
es,suchas:

 TheOper ati
ngsy stem handl
esthecommunicat
ionsbetweenpr ocessors,
andcommuni cati
oni sdonewit
hthehel
pofcommuni cati
onli
nes.
 Operatingsystem sharecomputati
onl
ogi
c'
samongdi ffer
entphysical
processors.
 Thepr ocessorswillnotshar
ethememory;r
ather,eachprocessorhasits
ownl ocalmemor y.

Adv
ant
agesofdi
str
ibut
edoper
ati
ngsy
stems:
-

 Giv
emor eperformancethansingl
esyst
em
 I
fonepci ndist
ribut
edsystem malf
unct
ionorcorr
upt
sthenot
her
nodeorpcwi l
ltakecareof
 Moreresour
cescanbeaddedeasi ly
 Resour
ceslikeprint
erscanbesharedonmulti
plepc’
s.

Di
sadv
ant
agesofdi
str
ibut
edoper
ati
ngsy
stems:
-

 Secur
it
yprobl
em duet oshari
ng
 Somemessagescanbel osti
nt henetworksyst
em
 Bandwidt
hisanotherprobl
em ifther
eislargedatat
henal
lnet
wor
k
wir
estobereplacedwhichtendst obecomeexpensive

Qur
banShar
if
13 Oper
ati
ngSy
stem

 Ov
erl
oadi
ngi
sanot
herpr
obl
em i
ndi
str
ibut
edoper
ati
ngsy
stems

7.
Spool
i
ng
Spoolingstandsf or 
Simultaneousper ipheraloperationonline.Spool
ingisa
processinwhi chjobsar eputintoabuf f
er,disk,oraparti
cularareainthe
memor ysothatadev icecanaccesst hesej obswheni ti
sr eady.
Spoolingiseffecti
vebecause, withthehel pofspool i
ngdev icescanaccesst he
datawi t
hdifferentrat
es.Buf f
eroffersawai ti
ngstati
onsot hatdatacanr espit
e
atthet i
mewhent heslowerdev i
cecat chesup.Theappl icationofspooli
ngis
PrintSpooli
ng.
Theoper ati
ngsy stem perf
ormsv arioust asksr el
atedtospool i
ng:

 I
tmanagest heI/Odevi
cedataspooli
ngwhendeviceshavemulti
pledat
a
accessrates.
 Handlesparall
elcomputati
onbecausethepr
ocessofspooli
ngisdoneI/O
i
napar all
elway .
 Handlesthespoolingbuff
erthatpr
ovi
desthewait
ingstat
ionfort
hedata
totakerestinthatti
mewhent hesl
owerdevi
cecatchesup.

Qur
banShar
if
14 Oper
ati
ngSy
stem

 
Adv
ant
age
sofSpool
i
ng
 Spool
ingcanov erl
aptheI/Ooperat
ionf
oroneprocesswithpr
ocessor
oper
ationsforanotherpr
ocess.
 I
tusesdi skasahugebuf f
erfort
hespooli
ngoperat
ions.
 Thespool ingoper ati
onusesadi skasav eryl
argebuffer,
soitisvery
usefultosendl ar
gedat a.
 S pooli
ngishowev ercapableofoverl
appingIOoperati
onofonej ob
withprocessoroper ati
onsforanotherjob.
Di
sadv ant
agesOfSpool ing:
 T hemai ndisadvantageofSpoolingisthatiti
sverydiff
icul
ttodebug.
 Du etolackofpr tecti
onscheme, onebatchjobcanaf f
ectthepending
j
obs.
 S pooli
ngisv eryusefulconceptandithinkthi
sarti
cleisveryuseful
forOSSt udents.

Oper
ati
ngSy
stem Funct
ions–
Al
lOper
ati
ngsy
stem f
unct
ionsar
eshar
edbel
ow–

1.DEVICEMANAGEMENT–
Operati
ngSystem managesdev
icecommuni
cat
ionv
iat
hei
r
respect
ivedr
iver
s.

I
tdoest
hef
oll
owi
ngact
ivi
ti
esf
ordev
icemanagement−

Keepst r
acksofalldevi
ces.I
/Ocontr
oll
eri
sresponsibl
efort
hist
ask
Decideswhi chpr
ocessgetsthedevi
cewhenandf orhowmuchtime.
Al
locatest hedev
iceinaneff
ici
entway.
De-all
ocatesdevi
ces.

2.FI
LEMANAGEMENT–
Theoper at
ingsystem all
ocatesandde-all
ocatesresour
ces.It
regul
ateswhichpr ocessgetsthefil
eandf orwhatdurat
ion.Also,
it
keepstrackofinformati
on,locat
ion,uses,st
atusetc.

Thecol
lect
ivefaci
li
ti
esareoft
enknownasafi
lesystem.OSal
so
per
for
mst asksli
kecreat
ingdi
rect
ori
esandf
il
es,copyi
ng/mov
ing

Qur
banShar
if
15 Oper
ati
ngSy
stem

t
hem andr
enami
ng/
del
eti
ngf
il
es.

3.MEMORYMANAGEMENT–
Memor ymanagementref
erstothemanagementofpri
maryormain
memor y.Mai
nmemor yprov
idesfastst
oragewhi
chcanbeaccessed
di
rect
lybyCPU.

Whent hepr ogr


am isexecut edandf i
nished,t
hememor yareai
sfr
eed
whichcanbeusedf orot herprograms.Comput ermemor yis
arr
angedsucht hatfastestregi
sterscome1stf oll
owedbyt heCPU
cache,random accessmemor y,andthendiskstorage.
Theoper ati
ngsy st
em’ smemor ymanagercoor di
natestheuseof
vari
oust ypesofmemor y,whichistobeal l
ocatedorde-al
locat
edand
howt omov edatabetweent hem

4.PROCESSMANAGEMENT–
Everyprogr
am runningonacomputerisapr ocesswhetheri
tisi
nthe
backgroundorinfront
end.Theoperat
ingsystem i
sresponsi
blef
or
makingmul t
ipl
etaskstorunatthesamet i
me( multi
taski
ng)
.

Operat
ingsyst
em fi
ndsthestatusofprocessorandprocesses,
choosesjobandit
sprocessorall
ocat
espr ocessort
oprocessandde-
al
locat
esprocesswhenit’
sexecuted.

5.STORAGEMANAGEMENT–
Oper ati
ngSy stem cont rol
sal l
StorageOper ati
ons.Someoft hese
i
nclude–howt ost or
edat aorf i
l
esintothecomput er
sandhowuser s
willaccesst hefiles.Theoper ati
ngsy st
em isResponsibl
ef orStor
ing
andAccessi ngt heFi l
es.Cr eati
onofFi l
es,CreationofDi
rector
iesand
Readi ngandWr it
ingt hedataofFi l
esandDi rectori
esandalsoCopy
thecont entsoft heFilesandt heDi r
ectori
esf r
om OnePlacet o
Anot herPlace.

Qur
banShar
if
16 Oper
ati
ngSy
stem

Whati
sapr
ocessi
nOSwi
thexampl
e?

 IntheOperat
ingSy st
em,aProcessi
s somethi
ngt
hatiscurr
ently
underexecuti
on.So,anacti
veprogr
am canbecal
ledaProcess.For
example,wheny ouwantt
osearchsomet hi
ngonwebthenyoustarta
browser.So,
thiscanbeprocess

Pr
ocessSt
ates
St
ateDi
agr
am

Theprocess,f
rom i
tscreati
onto compl
eti
on,passest
hroughv
ari
ousst
ates.The
mini
mum numberofst
atesisfi
ve.

Thenamesoft
hest
atesar
enotst
andar
dizedal
thought
hepr
ocessmaybei
noneof

Qur
banShar
if
17 Oper
ati
ngSy
stem

t
hef
oll
owi
ngst
atesdur
ingexecut
ion.

1.New
Aprogram whichi
sgoi
ngt
obepi
ckedupbyt
heOSi
ntot
hemai
nmemor
yiscal
l
eda
newprocess.

2.Ready
Wheneverapr
ocessiscreat
ed,i
tdir
ect
lyent
ersi
nthereadystat
e,i
nwhich,i
twai
tsf
or
theCPUtobeassigned.TheOSpickst
henewprocessesfrom t
hesecondar
ymemory
andputal
loft
hem inthemainmemory.

Thepr
ocesseswhichar ereadyfort
heexecut
ionandr esi
deinthemainmemoryare
cal
l
edreadyst
ateprocesses.Ther
ecanbemanyprocessespresenti
nther
eadyst
ate.

3.Runni
ng
Oneofthepr ocessesfr
om t
hereadystat
ewi l
lbechosenbytheOSdependi
nguponthe
schedul
ingalgorit
hm.Hence,i
fwehav eonlyoneCPUi noursy st
em,thenumberof
runni
ngprocessesf orapar
ti
cul
artimewi l
lalwaysbeone.Ifwehav enpr
ocessor
sin
thesyst
em thenwecanhav enprocessesrunningsi
mult
aneousl
y.

4.Bl
ockorwai
t
From theRunningstat
e,aprocesscanmakethetransi
ti
ontot heblockorwaitst
ate
dependingupontheschedul
i
ngalgor
it
hm ort
heint
ri
nsicbehav
ioroftheprocess.

Whenapr ocesswaitsforacert
ainr
esourcetobeassi
gnedorfort
heinputfr
om t
he
usert
hentheOSmov et
hispr
ocesst
ot heblockorwai
tst
ateandassi
gnstheCPUto
theot
herprocesses.

5.Compl
eti
onort
ermi
nat
ion
Whenapr ocessfi
nishesi
tsexecut
ion,i
tcomesi
ntheter
mi nat
ionst
ate.Allt
hecontext
ofthe process (
Process Cont
rolBlock)wi
llal
so be delet
ed t
he process wi
llbe
ter
minat
edbyt heOperati
ngsyst
em.

6.Suspendr
eady
A pr
ocessi
nt hereadystate,whi
chi
smov edtosecondar
ymemoryf
rom t
hemai n
memoryduetolackoftheresour
ces(
mai
nlypri
mar
ymemor y)i
scal
l
edi
nthesuspend

Qur
banShar
if
18 Oper
ati
ngSy
stem

r
eadyst
ate.

I
fthemainmemor yisful
landahigherpri
orit
ypr
ocesscomesf ortheexecut
ionthen
t
heOShav etomaket heroom fortheprocessi
nthemai nmemor ybythrowingthe
l
owerpr
iori
typr
ocessoutintothesecondarymemory.Thesuspendreadyprocesses
r
emaini
nthesecondarymemoryunti
lthemainmemorygetsavai
l
able.

7.Suspendwai
t
Inst
eadofremovi
ngthepr ocessfrom thereadyqueue,i
t'
sbettertor emovetheblocked
processwhichi
swai t
ingforsomer esourcesinthemainmemor y.Sincei
tisalready
waiti
ngforsomeresourcetogetav ail
ablehenceiti
sbetterifitwai t
sinthesecondary
memor yandmakeroom forthehigherpriori
typr
ocess.Thesepr ocessescomplet
et hei
r
executi
ononcet
hemai nmemor ygetsavail
ableandthei
rwaitisf i
nished.

Oper
ati
onsont
hePr
ocess
1.Cr
eat
ion
Oncet
heprocessiscreat
ed,itwil
lber eadyandcomei
ntot
her
eadyqueue(
mai
n
memor
y)andwil
lbereadyf
ortheexecut
ion.

2.Schedul
i
ng
Outofthemanyprocessespresenti
nthereadyqueue,theOper
ati
ngsy
stem chooses
oneprocessandst
artexecut
ingit
.Sel
ect
ingtheprocesswhichi
stobeexecutednext
,
i
sknownasscheduli
ng.

3.Execut
ion
Oncet hepr ocessisscheduledfortheexecuti
on,theprocessorst
art
sexecut
ingit
.
Processmaycomet ot heblockedorwaitst
ateduri
ngtheexecuti
ontheni
nthatcase
theprocessorstar
tsexecut
ingtheotherpr
ocesses.

4.Del
eti
on/
kil
l
ing
Oncethepurposeoftheprocessgetsov
erthentheOSwillkil
ltheprocess.TheCont
ext
oftheprocess(PCB)wil
lbedeletedandtheprocessget
st erminat
edbyt heOperat
ing
syst
em.

Qur
banShar
if
19 Oper
ati
ngSy
stem

1.Mult
iprogr amming– Acomput err
unningmor ethanonepr
ogr
am atat
ime
(
li
kerunni ngExcelandFirefoxsimult
aneously)
.
2.Mult
iprocessing– Acomput erusi
ngmor ethanoneCPUatatime.
3.Mult
itasking– Tasksshar i
ngacommonr esource(li
ke1CPU)
.
4.Mult
ithreading 
isanextensionofmul t
it
aski
ng.

Qur
banShar
if
20 Oper
ati
ngSy
stem

Wha
tisThr
ead
At hreadmeansal i
ght weightpr ocess.Thr eadi st hebasi cuni tofCPUexecut i
on,
whi chconsi stsoft hreadI D, Progr am count er,
setofr egi sterst ohol dt he
i
nfor mat ionofcur rentwor kingv ariable,andSt ack, whichi ncludest hehi st
oryof
execut i
on.
At hreadshar essomei nformat i
ont oitsassoci atedt hreadandt heinformat i
on
consi stsofopenf il
es, t
hedat asegment ,andcodesegment s.Ifat hreadchanges
acodesegmentmemor yitem, thent heot herthreadscanseet hechangesi nthe
thread.
Inot herwor ds, thethreadi sdef inedasaf lowofexecut i
onv iat hepr ocesscode.
Thr eadi mpr ov estheper f
ormanceofappl icat i
onswi t
ht hehel pofpar all
eli
sm
becauset hr
eadsar eexecut edi napar all
el manner .
Ever ythreadi sr el
atedt oasi nglepr ocess, andwi thoutpr ocess, thr
eadcannot
exist.Ev eryt hreadshowsadi sti
nctf l
owofcont r
ol .Threadsar eusedi n
i
mpl ement i
ngwebser versandnet workser v er
s.Par all
el execut ionoft he
appl i
cationi sal sopossi bleint hr eads, whichcanbeshar edamongt hememor y
mul tipr
ocessor s.
Thebel owf igur eshowst hewor ki ngofaSi ngle-t
hr eadedandaMul tithreaded
process.

Qur
banShar
if
21 Oper
ati
ngSy
stem

Di
ff
erencebet
weenPr
ocessandThr
ead
 
  
  
  
 Pr
ocess  
  
  
  
  
  
 Thr
ead
At hr
eadcanbedefi
nedast
he
 
Apr ocesscanbedef
inedasapr
ogr
am i
n
fl
owofexecutionv
iathe
executi
on.
processcode.

I
nthr
eadswitching,
ther
eisno
I
ntheprocess,
switchi
ngr
equi
resi
nter
act
ion
r
equi
rementtointer
actwit
h
wi
ththeoperat
ingsyst
em.
t
heoperat
ingsystem.

I
tisheav
ywei
ght
. I
tisl
i
ght
wei
ght
.

Inapr ocess,ifapr
ocessisblockeddueto
I
nat hr
ead,i
fonethreadis
somer easons,t
hentheotherprocesses
bl
ocked,t
hentheotherthr
ead
cannotbeexecut edunti
ltheprocesswhichi
s
i
sabletodothesamet ask.
blockedwi ll
notbeunblocked.

Threadconsumesf
ewer
ThePr
ocessconsumesmor
eresour
ces.
resour
ces.

Cont
extswi
tchi
ngr
equi
resmor
eti
mei
n Cont
extswi
tchi
ngr
equi
res

Qur
banShar
if
22 Oper
ati
ngSy
stem

pr
ocess. l
esst
imei
nthr
ead.

TheThreadtakesl
esst
imef
or
ThePr
ocessneedsmor
eti
mef
ort
ermi
nat
ion.
ter
minati
on.

TheThreadtakesl
esst
imef
or
ThePr
ocesst
akesmor
eti
mef
orcr
eat
ion
execut
ion.

Inter
msofcommuni
cat
ion,
thepr
ocessi
sless I
ntermsofcommuni
cation,
eff
ici
ent
. t
hethreadi
smoreef
fi
cient.

I
nProcessswi
tchi
ng,
thei
nter
facei
nthe Int
hreadswit
ching,noneedt
o
oper
ati
ngsyst
em i
sused. cal
lanoperat
ingsystem.

I
tisI
sol
ated. I
tshar
esmemor
y.
Adv
ant
age
sofThr
ead
1.Bet terCPUut il
izati
on:- Ifmul ti
plethreadsar eexistingi nonepr ocess, they
canbeschedul edondi f
fer entprocesses, whichmakest hepr ocess
execut ionqui cker.
2.Increasedt hroughputoft hesy stem:-  
Ifaprocessi sbr okeni ntodifferent
threads, andeacht hreadt aski sconsideredasonej ob, andt henumberof
j
obsdonei si ncreasedperuni tofti
me.Thus, thet hroughputoft hesy stem
alsoi ncreases.
3.Communi cat i
on:- I
nt het hread,communi cati
oni squi tesi mplebecause
eacht hreadshar esacommonaddr essspace.Buti nt hepr ocess, weuse
somespeci fi
ccommuni cat i
onmet hodsf orcommuni cat ionbet weent he
process.
4.Resour ceshar ing:- 
Resour cecanbeshar edeasilybet weenal l
threads
withinapr ocesssuchasdat a,fi
l
es,andcode.
5.Responsi v eness:-  
Whent hepr ocessi sbrokenint odiffer entthreadsandi f
anyf i
lefinishedi tsexecut ion,theoutputoft hethr eadi sr eturnedinst antl
y.
6.Qui ckCont extSwi t
ch:- Thet i
meofcont extswitchingi nt hreadsi sless
thant hecont extswitchingt imeoft hepr ocess.

Ty
pesofThr
ead
Ther
ear
etwot
ypesofThr
eads

1.User-l
evelThr
eads
2.Kernel-
lev
elThreads

Qur
banShar
if
23 Oper
ati
ngSy
stem

3.User -
LevelThreads:-  
User -l
ev elt
hreadsar ethosetypesofthr
eadt hatare
createdintheuser -
levellibrary.Theset hreadsarenotimplementedwi t
h
thehelpoft hesystem cal ls.Ifwewantt oswitchthread,t
henthereisno
needt oint
errupttheker nel andcal loperati
ngsy st
em.I nt
heuser-l
evel
thread,t
hereisnoneedf ort hekernel t
oknowaboutt heuser-
lev
el t
hread
andhandl ethreads,ifapr ocesscont ai
ningasi ngl
ethread.

Exampl
esofaUser
-l
evel
thr
eadsar
e POSI
Xthr
eads,
javat
hreads.

Adv
ant
age
sofUs
er-
Lev
elThr
eads
 User-
levelthr
eadi
seasyt ocreatebecauseinthi
s,thereisnoinv
olv
ement
ofkernel.
 I
tisfastbecausether
ei snoneedf oroper
ati
ngsy stem cal
ls.
 I
tiseasyt orunauser
-level
threadinanyoperati
ngsy stem.

Di
sadv
ant
age
sofUs
er-
Lev
elThr
eads
 Ifi
nonet hreadpageFaul ti
scaused,thenthewhol epr
ocessisblocked.
 IntheUser-l
evelthr
ead,thereisnocoor di
nat
ionbetweenthreadsandthe
kernel
.
 Kernel
-LevelThreads:-
 Kernel-
lev
elt
hr eadsarethosethr
eadsthatare
dir
ectl
ymanagedbyt heoper at
ingsy
st em,andthekerneldoesthe
managementoft hethr
ead.
Qur
banShar
if
24 Oper
ati
ngSy
stem

 Inthis,r
athercreat
ingat hreadt abl
eforeachprocess,kernel hasitsown
tabl
et hatisamast ertablethatisusedtokeept r
ackofal lthet hr
eadsin
thesy st
em.I ti
salsokeepi ngtrackoftheclassi
calprocesst ableto
maint ai
ntrackofthepr ocesses.TheOper ati
ngsystem kernel off
ersa
system calltohandleandi mplementat hread.

Exampl
eofaker
nel
-l
evelt
hreadi
swi
ndowSol
ari
s.

Adv
ant
age
sofKe
rne
l-
Lev
elThr
ead
 
  
  
  
Theadv
ant
agesofKer
nel
-l
evel
thr
eadar
e:

 Kernel-
levelt
hreadisusefulf
orappl
i
cat
ionsthatareblockedf
requent
ly.
 Becauset hekernel
hascompl et
eknowledgeofthesystem’st
hreads,
the
schedulermaydecidet ogiv
emor et
imetothoseprocesseswhichhavea
dif
ferentnumberoft hr
eads.

Di
sadv
ant
age
sofKe
rne
l-
Lev
elThr
ead
 
  
  
  
Thedi
sadv
ant
agesofker
nel
-l
evel
thr
eadar
e:

 Ker
nel
-l
evel
thr
eadsaresl
ow
 Ker
nel
-l
evel
thr
eadsarenotef
fi
cient
.
 Ker
nel
-l
evel
thr
eadisover
headbecausei
tneededat
hreadcont
rol
block.

Qur
banShar
if
25 Oper
ati
ngSy
stem

Di
ff
erencebet
weenUser
-Lev
elThr
eadsandKer
nel
-Lev
elThr
ead:
 
  
  
  
  User
-Lev
elThr
ead  
  Ker
nel
-Lev
elThr
ead
Thethreadwhichi
screat
edwi
th Thethr
eadswhichar
ecreat
edwit
hthe
thehelpofauseri
sknownas hel
pofanoperati
ngsyst
em ar
eknownas
User-
level
thr
ead. Ker
nel-
Level
thr
ead.

I
ntheUser-l
evelthr
ead,
theti
me Inthekernel
-l
evelt
hreads,
thet
imeof
ofcont
extswitchi
ngisl
ess. contextswit
chingi
smor e.

Theoperat
ingsy
stem cannot Theoper
ati
ngsyst
em canr
ecogni
zet
he
recogni
zet
heUser-l
evelt
hreads ker
nel
-l
evel
thr
eads.

InUser-
lev
elthreads,
forcontext
Inker
nel-l
evelt
hreadsf
orcontext
switchi
ng,t
hereisnoneedf or
swit
ching,har
dwaresuppor
tisrequi
red.
hardwaresupport.

ExamplesofUser
-l
evelt
hreads Anexampl
eofaker
nel
-l
evel
thr
eadi
s
arePOSIXthr
eads,j
avathr
eads. wi
ndowSolar
is.

TheUser
-Levelt
hreadsar
e TheKer
nel
-Lev
elt
hreadsar
edi
ff
icul
tto 
i
mplementedinaneasyway. I
mplement
.

Inthekernel-
level t
hread,whenoneker nel
-
I
nt heUser-
Level
-Thr
ead,i
fanyof
l
ev elt
hreadperfor msblockingoper at
ion,
thethr
eadperfor
mst heblocking
thenduet oofbl ockingoperat
ions,other
operat
ions,t
henduetoblocking
threadwill
notaf fecttheotherthreadso,
operat
ion,t
hewholeprocesswi l
l
theremainingthr eadconti
nuesi t
s
beblocked.
 
executi
on.

Whati
sPr
eempt
iveSchedul
ing?
Preempt iveScheduli
ngisascheduli
ngmet hodwherethetasksar emostl
y
assignedwi ththei
rpri
ori
ti
es.Sometimesitisimpor
tantt
or unat askwi
tha
hi
gherpr iori
tybefor
eanotherlowerpri
ori
tytask,
evenift
hel owerpri
ori
tyt
ask
i
sst il
lrunning.

Att
hatt
ime,
thel
owerpr
ior
it
ytaskhol
dsf
orsomet
imeandr
esumeswhen

Qur
banShar
if
26 Oper
ati
ngSy
stem

t
hehi
gherpr
ior
it
ytaskf
ini
shesi
tsexecut
ion.

Whati
sNon-Pr
eempt
iveSchedul
ing?
Inthist
ypeofschedulingmethod,theCPUhasbeenall
ocat
edt
oaspecif
ic
process.TheprocessthatkeepstheCPUbusywil
lrel
easet
heCPUei
therby
switchi
ngcontextorterminat
ing.

I
tistheonlymet hodthatcanbeusedforv
arioushardwar
eplat
for
ms.That
’s
becauseitdoesn’tneedspeci
ali
zedhar
dware(forexampl
e,ati
mer)l
i
ke
preempti
veSchedul i
ng.

Non-Pr
eempti
veSchedul
i
ngoccur
swhenapr
ocessv
olunt
ari
l
yent
erst
hewai
t
st
ateorter
minat
es.

Pr
ocessSchedul
ersi
nOper
ati
ngSy
stem
Thepr ocessschedul i
ngistheactivi
tyofthepr ocessmanagert hathandlesthe
remov alofther unningprocessfrom theCPUandt hesel
ecti
onofanot her
processont hebasisofapar ti
cularstrat
egy.
Processschedul ingisanessentialpartofaMul ti
programmingoper at
ing
systems.Suchoper ati
ngsy st
emsal l
owmor ethanonepr ocesstobeloadedi nt
o
theexecutabl ememor yatati
meandt heloadedpr ocesssharestheCPUusi ng
ti
memul ti
plexing.
Ther
ear
ethr
eet
ypesofpr
ocessschedul
er.
 
 
1.LongTer m orjobscheduler: 
Itbri
ngst henewpr ocesstothe‘ReadyState’.I
tcontrol
s DegreeofMul ti
-
programmi ng,i
.e.
,numberofpr ocesspresentinr eadystat
eatanypoi ntof
time.Itisimpor t
antthatthel
ong- t
erm schedulermakeacar eful
select
ionof
bothIOandCPUboundpr ocess.IOboundt asksar ewhichusemuchoft hei
r
timeininputandout putoper
ationswhileCPUboundpr ocessesar ewhich
spendt heirti
meonCPU.Thej obschedulerincreaseseffi
ciencyby
maintainingabal ancebetweent hetwo.
 

Qur
banShar
if
27 Oper
ati
ngSy
stem

2.Shor tterm orCPUschedul er: 


Itisresponsi blef orselect i
ngonepr ocessf rom r eadyst ateforschedul ingit
ont her unningst ate.Note: Shor t
-ter
m schedul eronlysel ect
st hepr ocesst o
schedul ei tdoesn’ tloadt hepr ocessonr unning.  Her
ei swhenal l t
he
schedul ingal gor i
thmsar eused.TheCPUschedul erisr esponsi blef or
ensur i
ngt her eisnost arvationowi ngt ohi ghbur stti
mepr ocesses.
Dispatcher  
isresponsi bleforl oadingt hepr ocesssel ect edbyShor t-term
schedul eront heCPU( Readyt oRunni ngSt ate)Cont extswi tchingi sdoneby
dispatcheronl y.Adi spatcherdoest hef oll
owi ng: 
1.Swi t chingcont ext.
2.Swi t chingt ousermode.
3.Jumpi ngt othepr operlocat i
oni nthenewl yl oadedpr ogram.
3.Medi um- term schedul er: 
Itisresponsi blef orsuspendi ngandr esumi ngt heprocess.I tmai nlydoes
swappi ng( mov ingpr ocessesf r
om mai nmemor ytodi skandv icev ersa) .
Swappi ngmaybenecessar yt oimpr ov ethepr ocessmi xorbecauseachange
i
nmemor yrequi rement shasov ercommi tt
edav ail
ablememor y ,requiring
memor yt obef reedup.I tishel pfulinmai ntai
ni ngaper fectbal ancebet ween
theI/Oboundandt heCPUbound.I treducest hedegr eeofmul ti
progr ammi ng.

Pr
ocesscont
rolbl
ock:
ProcessCont r
olBlockisadat astr
uct
urethatcont
ainsi
nfor
mationofthepr ocess
rel
atedtoit.Theprocesscont
rolbl
ocki
salsoknownasat askcontr
olbl
ock,entryof
theprocesstabl
e,et
c.
I
tisver
yimpor
tantf
orprocessmanagementasthedatast
ruct
uri
ngf orpr
ocessesi
s
donei
nter
msofthePCB.Ital
sodef
inest
hecurr
entst
ateoft
heoperat
ingsyst
em.

St
ruct
ureoft
hePr
ocessCont
rolBl
ock
Theprocesscont
rolst
oresmanydatai
temst
hatar eneededforef
fi
cientprocess
management.Someoft hesedat
ait
emsareexpl
ainedwiththehel
poft hegiven
di
agr
am −

Qur
banShar
if
28 Oper
ati
ngSy
stem

Thef
oll
owi
ngar
ethedat
ait
ems−

Pr
ocessSt
ate
Thi
sspeci
fi
est
hepr
ocessst
atei
.e.new,
ready
,runni
ng,
wai
ti
ngort
ermi
nat
ed.

Pr
ocessNumber
Thi
sshowst
henumberoft
hepar
ti
cul
arpr
ocess.

Pr
ogr
am Count
er
Thiscontai
nst
headdr
essoft
henexti
nst
ruct
iont
hatneedst
obeexecut
edi
nthe
process.

Regi
ster
s
This specif
ies the registersthatare used by the pr
ocess.They may i
ncl
ude
accumulators,
indexregisters,
stackpoi
nter
s,gener
alpur
poseregi
ster
set
c.

Li
stofOpenFi
les
Thesear
ethedi
ff
erentf
il
est
hatar
eassoci
atedwi
tht
hepr
ocess

CPUSchedul
ingI
nfor
mat
ion
The pr
ocess pr
ior
it
y,poi
nter
sto schedul
i
ng queues et
c.i
sthe CPU schedul
i
ng

Qur
banShar
if
29 Oper
ati
ngSy
stem

i
nformat
ionthati
scont
ainedi
nthePCB.Thi
smayal
soi
ncl
udeanyot
herschedul
i
ng
paramet
ers.

Memor
yManagementI
nfor
mat
ion
Thememor ymanagementi
nformati
oni ncl
udesthepagetabl
esorthesegmentt
ables
dependingont hememor
ysystem used.Ital
socontai
nstheval
ueofthebaser
egi
sters,
l
imitregist
ersetc.

I
/OSt
atusI
nfor
mat
ion
Thi
sinf
ormat
ioni
ncl
udest
hel
i
stofI
/Odev
icesusedbyt
hepr
ocess,
thel
i
stoff
il
eset
c.

Account
ingi
nfor
mat
ion
Theti
mel i
mit
s,accountnumbers,amountofCPUused,pr
ocessnumber
set
c.ar
eal
la
par
tofthePCBaccountingi
nfor
mat i
on.

Locat
ionoft
hePr
ocessCont
rolBl
ock
Thepr ocesscontr
olblockiskepti
namemor yareathati
spr ot
ectedf r
om thenormal
useraccess.Thisisdonebecauseitcont
ainsimport
antprocessinformati
on.Someof
theoper at
ingsystemspl acethePCB att hebegi
nningoft heker nelst
ackf orthe
processasi ti
sasafelocati
on.

Whatist
hecont
extswi
tchi
ngi
ntheoper
ati
ng
sy
stem?
TheCont extswitchi
ngisat echniqueormet hodusedbyt heoperatingsystem toswi t
ch
apr ocessfrom onestatetoanot hert oexecut eit
sf uncti
onusingCPUsi nt hesystem.
Whenswi t
chingperfor
mi nt hesy stem,itstorestheol drunni
ngpr ocess'
sst atusinthe
form ofregister
sandassi gnst he CPU  t
oanew pr ocesst oexecuteitstasks.Whi l
ea
newpr ocessisrunninginthesy stem, thepr evi
ousprocessmustwai tinar eadyqueue.
Theexecut i
onoft heoldprocessst art
satt hatpointwher eanotherprocessst oppedi t
.
Itdefinesthechar acter
ist
icsofamul ti
taskingoper at
ingsy stem inwhi chmul t
iple
processes shared the same  CPU  to perf
or m mul t
ipl
et asks withoutt he need f or
additi
onalprocessorsi
nt hesystem.

Theneedf
orCont
extswi
tchi
ng
Acont extswi
tchinghelpstoshar easingleCPUacrossallprocessestocompleteit
s
executi
onandst orethesystem'stasksst
atus.Whent
heprocessr el
oadsinthesyst
em,
theexecuti
onoft heprocessstart
satthesamepointwher
et hereisconf
li
cti
ng.

Qur
banShar
if
30 Oper
ati
ngSy
stem

Cont
extswi
tchi
ngt
ri
gger
s
Fol
l
owi
ngar
ethet
hreet
ypesofcont
extswi
tchi
ngt
ri
gger
sasf
oll
ows.

1.I
nter
rupt
s
2.Mul
ti
taski
ng
3.Ker
nel
/Userswi
tch

I
nter
rupt
s:A CPU r equest
sf orthedat atoreadfrom adi sk,andi
ft hereareany
i
nter
rupt
s,the contextswitchi
ng automati
c swi
tches a partofthe hardwar
ethat
r
equir
eslesst
imet ohandletheint
err
upts.

Multit
asking:Acontextswit
chingist
hecharact
eri
sti
cofmultitaski
ngthatal
lowst
he
processt obeswi t
chedf r
om t heCPU sothatanotherpr
ocesscanber un.When
switchi
ngt hepr
ocess,theoldstat
eissavedtor
esumet heprocess'
sexecuti
onatt
he
samepoi ntint
hesystem.

Kernel
/UserSwi
tch:I
tisusedintheoper
ati
ngsy
stemswhenswi
tchi
ngbet
weent
he
usermode,andt
hekernel
/usermodei
sper
for
med.

Cr
it
eri
a Ker
nelMode UserMode

Qur
banShar
if
31 Oper
ati
ngSy
stem

Cr
it
eri
a Ker
nelMode UserMode

Inkernelmode, t
heprogr
am has Inusermode,the
dir
ectandunr est
rict
edaccesst
o appli
cati
onprogram
Kernel
-modev
s system resour
ces. executesandstart
sout
.
Usermode

I
nKernelmode,t
hewhole I
nusermode, asingl
e
oper
ati
ngsyst
em mightgodown processfai
l
sifanint
err
upt
i
fanint
err
uptoccur
s occurs. 
I
nter
rupt
ions

Usermodeisalsoknown
Kernelmodeisalsoknownas astheunpri
vi
legedmode,
themast ermode,pr
ivi
l
eged rest
ri
ctedmode,orsl
ave
mode, orsyst
em mode. mode.
Modes

Inkernelmode,
allprocesses Inusermode,
allpr
ocesses
shareasingl
evir
tualaddress getsepar
atevi
rt
ualaddr
ess
Vir
tualaddr
ess space. space.
space

Inker
nelmode,theappl
i
cat
ions Whileinusermodethe
havemorepri
vi
legesas appli
cati
onshavefewer
Levelof comparedt
ousermode. pri
vi
leges.
pri
vil
ege

Asker nelmodecanaccessboth Whileusermodeneedst o


theuserpr ogr
amsaswellasthe accesskernelprogr
amsas
kernelprogramst
her
ear eno i
tcannotdirectl
yaccess
restr
icti
ons. them.
Rest
ri
cti
ons

Themodebi
tofker
nel
-modei
s Whi
le;
themodebi
tofuser
-
0. modeis1.
Modebi
tval
ue
Thei
nterf
acebetweenaprocessandanoperati
ngsy stem i
sprovidedbysy st
em cal
ls.
I
ngeneral
,syst
em cal
lsareavai
l
ableasassemblylanguageinstr
uctions.Theyar
ealso
i
ncl
udedinthemanualsusedbytheassembl
ylevel
pr ogrammers.

Uni
xSy
stem Cal
ls
System call
sinUni xareusedf orf
ilesystem cont
rol,pr
ocesscontrol
,int
erprocess
communi cati
onetc.AccesstotheUnixker neli
sonlyavail
abl
ethr
ought hesesy st
em
cal
ls.General
ly,
syst
em call
saresimi
lart
of uncti
oncal
ls,t
heonlydi
ff
erenceisthatthey

Qur
banShar
if
32 Oper
ati
ngSy
stem

r
emov
ethecont
rol
from t
heuserpr
ocess.
Ther
earearound80syst
em cal
l
sintheUni
xint
erf
acecur
rent
ly.Det
ail
saboutsomeof
thei
mport
antonesar
egivenasfol
l
ows-

Sy
stem Cal
l Descr
ipt
ion

access(
) Thi
schecksi
facal
l
ingpr
ocesshasaccesst
other
equi
redf
il
e

chdi
r(
) Thechdi
rcommandchangest
hecur
rentdi
rect
oryoft
hesy
stem

chmod(
) Themodeofaf
il
ecanbechangedusi
ngt
hiscommand

chown(
) Thi
schangest
heowner
shi
pofapar
ti
cul
arf
il
e

ki
l
l() Thi
ssy
stem cal
lsendski
l
lsi
gnal
tooneormor
epr
ocesses

l
i
nk(
) Anewf
il
enamei
sli
nkedt
oanexi
sti
ngf
il
eusi
ngl
i
nksy
stem cal
l
.

open(
) Thi
sopensaf
il
efort
her
eadi
ngorwr
it
ingpr
ocess

pause(
) Thepausecal
lsuspendsaf
il
eunt
ilapar
ti
cul
arsi
gnal
occur
s.

st
ime(
) Thi
ssy
stem cal
lset
sthecor
rectt
ime.

t
imes(
) Get
sthepar
entandchi
l
dpr
ocesst
imes

al
arm(
) Theal
arm sy
stem cal
lset
stheal
arm cl
ockofapr
ocess

f
ork(
) Anewpr
ocessi
scr
eat
edusi
ngt
hiscommand

Qur
banShar
if
33 Oper
ati
ngSy
stem

Sy
stem Cal
l Descr
ipt
ion

chr
oot
() Thi
schangest
her
ootdi
rect
oryofaf
il
e.

exi
t(
) Theexi
tsy
stem cal
li
susedt
oexi
tapr
ocess.

Wi
ndowsSy
stem Cal
ls
System cal
lsinWi ndowsareusedforf
il
esystem control,
processcontrol
,interprocess
communi cati
on,mai nmemor ymanagement ,I/O devicehandli
ng,secur i
tyet c.The
programsinteractwiththeWindowsoperati
ngsy stem usingthesy st
em cal ls.Since
system cal
lsaretheonlywaytoaccessthekernel
,allt
hepr ogr
amsr equir
ingr esources
mustusesy stem call
s.
Det
ail
saboutsomeoft
hei
mpor
tantsy
stem cal
l
sinWi
ndowsar
egi
venasf
oll
ows-

Sy
stem Cal
l Descr
ipt
ion

Cr
eat
ePr
ocess(
) Anewpr
ocessi
scr
eat
edusi
ngt
hiscommand

Exi
tPr
ocess(
) Thi
ssy
stem cal
li
susedt
oexi
tapr
ocess.

Cr
eat
eFi
l
e() Af
il
eiscr
eat
edoropenedusi
ngt
hissy
stem cal
l
.

ReadFi
l
e() Dat
aisr
eadf
rom t
hef
il
eusi
ngt
hissy
stem cal
l
.

Wr
it
eFi
l
e() Dat
aiswr
it
teni
ntot
hef
il
eusi
ngt
hissy
stem cal
l
.

Cl
oseHandl
e() Thi
ssy
stem cal
lcl
osest
hef
il
ecur
rent
lyi
nuse.

Set
Timer
() Thi
ssy
stem cal
lset
stheal
arm ort
het
imerofapr
ocess

Cr
eat
ePi
pe(
) Api
pei
scr
eat
edusi
ngt
hissy
stem cal
l

Qur
banShar
if
34 Oper
ati
ngSy
stem

Sy
stem Cal
l Descr
ipt
ion

Set
Fil
eSecur
it
y() Thi
ssy
stem cal
lset
sthesecur
it
yforapar
ti
cul
arpr
ocess

Set
Consol
eMode(
) Thisset
stheinputmodeoroutputmodeoftheconsol
e’
s
 
inputbuf
feroroutputscr
eenbuf
ferr
espect
ivel
y.

ReadConsol
e() Thi
sreadst
hechar
act
ersf
rom t
heconsol
einputbuf
fer
.

Wr
it
eConsol
e() Thi
swr
it
est
hechar
act
ersi
ntot
heconsol
eout
putbuf
fer
.

Qur
banShar
if

You might also like