OS-Assignment-1
OS-Assignment-1
Joni (22cfo4f)
AssIGNMENT 1 (os)
1. whot oxe the two maln unctions os an
operating system? Briesly czplain :
an extended ochine :
Ly Hides the Hordware comple zily provide s
Simple UI.
4 Presents to Usen with an equivalent of
extended machine that is eosier to praqram
than. unde nlying hordware.
L Abstrac tion - Disk contain s a collection ot name d
Siles Aes
il ResouTCe manaqen:
Provides an orderly and controlled allocation
resources such as me mory_ond T/O devices
among al the px0CeSse s.
2, Brieíly ezplain mlipogramming,
and Distributed o.s. :
multitasking
visicw
with computer,
’ Multitosking 0S
visicw
Hayd disk
Card
neode n CPU Printee
Advonced personol computers will Iikely
cantinve to vse spooling especiolly on
monoging print jobs & other Ilo operations.
while devices are getting saster, spooling
still helps in esficiently managing tasks
and resouYCeS
It ensures
res that CPr doesn't nem qin Idle
wbile. Ilo operations OceUYe.
visicN
5. Can the
Covnt ead (d, bu[ter , nbytes )
call retuYn any Valve in covnt other thon
nbytes ? 15 se, why
Cownt write l sd, buster, nbytes)
call eturn qny va lve in coun t other than
nbytes ? 15 s0, why
visic
7. In siquYe -1a multithreade d web sen vet is
shown. IÍ the only way to ead S1om a sile
1S the moYmal
mal bl ocking syste m call, Do you
think use level thre ads Kernel leve threads
are being used for the web ser VeY ? why
Basic strveure?
Miceokernel model ?
Suggests client Server model.
The idegl is to acheive high relia bílíty
by splitking into Small modules only
one of which, micro key nals un qs relabively
powersul ordinary
ordinayy use processes.
visicw
’ Basically kernmel handle the conm nica tion
betweem clients and senvers, handlinq inter1vpt
I/O and mini mul process and no1y monagenent.
Advoy ta qes:
Oisadvontoge:
’ Less esficient beavse fnequ ant mode chonge nequire d.
ii) Layered os:
’ 0s i s desiqned as hierarc hy of layers eoch
constrvcted upon One below it
Each layer con be think 0s an object which
hos its data and functions.
visioN
Laye Function
5 The sero
4 Ilo mqndgemen t
3
Opera tor- process com mVnica ti on
2
oTY manaqe men t
memoTY
Proces alloca tion multipiogsamming
Adyontagesi
’ Debugging iseasy
Mo delaity
Easy ch0nge sunction ality of any layets.
Protection,
Disadvanta gei
Care fulL detinition of layexs.
’2ess eficient.
g. Compore
process ond thneads briefly, Explain
user space , kernel spuce and hy brid impleme ntot on.
Process Threads :
’ An instance of program Smalles unit of
exe cvtion. execv tion within a proesS,
visic
Proccss Threads
User space
where applicotíon. code mns, sep0T4 te
Som kese spae
’ This isolation prevents diret acce S5 to CIitical
JoUICe S enhomcing seccurity and stobility
o Application in uses space interQct with
Kernel via sy stem
Kerne Spoce:
visicw
Hybid implementation:
Com bines Vsen leve and Kernel level thre adin g.
Uses many to many model.
Beniit is low
lo ovex head along with obvst
persOTmonce.
Eq. Solaris and Windouws NT.
Steps
’ Para meters are pushe d into a stack
Save the curYent state on stack.
Srop imstt, exeu te d. to suiteh to kernemode.
’ os identiied System cal
’ Hondleo performs the. regueste d aperation.
Restore the previovs State from staeh.
CPU suwitch back to sey mode
ErToT co de is returned i system
syste call Can't
be eeuted
visic