0% found this document useful (0 votes)
52 views27 pages

Os Module 3 Theory

operating system vtu notes 3

Uploaded by

bnsagar27
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
0% found this document useful (0 votes)
52 views27 pages

Os Module 3 Theory

operating system vtu notes 3

Uploaded by

bnsagar27
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
You are on page 1/ 27
7 OS bodule -03 ') What in a oltadlock ? ushat ave the neea Condi Hon fon the duadtock to Occur: ) A 6c o. pxotesses tha deddlocked state sshtu (Vary proltss inte but ip wolth ran tvent thed Sawn” Be Cored only by amothtr” protess tn Hu set. Necessary Coudthfon xt oltad lock ) Mutuat tecluston AE least One sesourte must be held th a Men Shavable moodle +o ip Only One Procus Ata time Cm use the sesourd . 2 amothi, pwren Bua the VSouwe , the vequELti Procuw thet be delayed until He yesource hag “been releasecl 2) Hold aud wait : az process must ~ be holel’ng at least One seSourie Gud WOiting to acpuire "tonal mpoures that art Lonuarrentty beng held by other d PrOcenmep - 3) No pcemption : Resources Cannot be preempted , that 3, a vesourle Can We atleosed, only velontinty a we (te nied it, alta tho, prow completedk Tt tagk . . u) verter wost i A set PP Pa Po J fen” PO (essa must téist Such thot Po i. 7 3 for soourte hdd by PiP *s woitieg fr . aeousce Hula by Pr 7 Pn-i iP coat Hing for yuoure held by Pa and Pn ip voutting Kor o you ve held by Po. 1s) ushot bs Paging 2 Explain ptvudwe. 4 page todols + Poging bo rumor ~ Mawog ues oduman Hock puruich he Pupieal Oskdourm spoee 4 pri» te be nen -tniiquour Srebewee OF Peas Theis + Theos ratheods we “ }) Hivwttatal mis man rat Et 2) Honud Progr taller 3) Inuanted poge taal ) Hivwdutad pagivg : + Bruck up th, Lagiead oddvun Anca Into mukiple page tober + A simple technique & lwo dul poge til . + Wk Ham pinge tm page table . ben ‘ {| a ‘ 0% 4 aa RS : |N Tr: | table age 308 L : rage tabu. : page babe. ne Pony « + A logitol addum by diutdid into: Ao pange raandoen Comndrting of 22 bity ra page apt lowsting | 10 bi - Bint, Hae page table in paged, ta page ruaniben o floutur divided into: ao 1a bie page rmsd. sg tonite page Hp Lotus 0 logical addowm i on follouss : page mumbea page aypet pe pa a 10 10 ras OO ———_———_———— 2 ) Horted pane Tolole * Common im add Apaty Te urrtul, page number b —* Tha page bob. wonbsins O drain tun Aw. \otakion - “7 Eat daw sovotwa (1) tae urrued page numaoos (2) value q mapped page fame (3) % pointes fo wut UWouwwuk + 7 THe algoritim woes Or Tw wntund page oso bu Hus, wnbuah askdsuns O has iW te hor tohle - | | — The uirtunl page number tora pos with fad £ mM Hus Post Oawauk de the dinnd ust» . ho mokth , WH Lomenpowsi ng poge promt dusiad puyleal addourr . wukiur oe tue Untied > Ba bit: follows * Ny teu. jp wad te form he — Y twu b ne nakth , subsequent Ust ow rancid pr a MaLOLUA Wala page weed. physical oddruw | hard table D trusted page tol - Ow - + entiy eta vas mal poge 9 memory ww Ma ints tush ac ec he poo vrarnony Location 1 wit informaston abou ton thal owna Hak POQe- ®*D bie non, madd to Ato iu eine wudad te Arar * Doge reruuee OCCL9Ly * ye doth Poge tobe , He toh. vole pruysicol odd propia memory Z 2) How to paevent the ocurente Cxplatn Tn deta?! a) Mutual excluston: —— of dtadtock , * The mutual exclusion Condition must hold for "On -Shorable gesources For ewomple , a printn @mnot be Simultancous ly Shancol by several protases * Shosable wesouriey « do not ~vequive mutually exche ~ Give access amd rw cannot be Tnvolvedl Pn a Aeodto ck *¥ We Cannot Prevent deacltocks by denyt tha mutual exclusion Concdtton becare Some Aesources Oe non sharable . b) Hold qucl wast 1 eet *% TO ensure tH told ond usatt Conolftion tv Octurg in He System , we must ( wavant ee that ushinevir & pweress Mequest a vesoure, it does hot wold Clap othe Resources © One protocol that Can be usec neguirr tach protuy +0 mequeart and be allocated UL PH yexourcey before it begins evewti On * Both Mn Altunalive protocol allows a procem To pequese yeouwtes only when PE hat mons re poth ThUC Prfo.ols have two main disadvantages Fixst, waource ublizaton be Low . Sewn, Stoaveat’on 7S possible. 7) Noo pumpbtonrt—“‘sS™*”!”T NN ¢) No- prtemph On A The third necotary Condition fon clead locks ix thos tho be no prem pHon of megourcey thot have abrody che been allocated . pot . hololin Bek method ! ay A pH iny ~veg-evotl Some YUOUmY aequat cmothy, xuoure that Cannot b¢ Pmmecl« ce allotateol to Pt then al rtsouries Garven ty “ held are. Preempted & ond method : 2 w& . cher tf apwtess yvequuk Some wesourley , a bist Check ushetho, they are avatlable . if 1H he Cae Theis » Yphey oe met ye ied Ol they au. allocated to “some othuy procd thot vocttting fom adol@honal VOUT | AD civulor wort; w one w fo mturve thet this Condihon never olds 7s Fn pose atotal ordi oy al resource type anol -fo veputre rok each prolem oeputats yUCUreL Th an Ineveating ordty enumerabon . A povocess Gm inittally equate an numbr of fustan(a of UOTE type Say. Pre Alter thot tHe Ce «Can veguat Twtanle of yesource type Rik d ontiy Th FER]) 7FCRI) Explain paging holware uh, TLB. TLB = Tramslaton (ook al de Bur. | Each 08 has ft oWwn methools por Stow'ng page bie into. fo the page fable *% Stove with othe fst Valuer Fos thac machinu , the use of P Amplement the page fable iA no ts page table rx kept in main me ¥ The Clauclard Solution of tris problem fy [0 uge a Spewtal 1 Smau , fast lookup howd ware cathe -Collcol TLB | i ¢ e tabluy a the THB tx used with ps he © table ¥ The TLE Contains Only & feo OF rs b ntrie + when a Logical address if genera d The «CPU é Page number ia fest Brooch ed in TLB % A the page numbyy tf jounal vis frame number iz from eolfately avatlable anol js ugeol fo acts ™Mtmon. XT the page numbin fz not in TLE ~ CL Mumo viper Pde page Pere mut be made. “"d bt ACTS 1bu to qo TIC, Rather 0 — physical fnamory ¢ the purten tage _0 4imt that parti cular page numbu is prune. Th °TLB called jit ratto so patint het satio mtant Hod we pirol ths. dbined page Numbn in He TLR gv pUrlent Of ths tine K Fos thac machinu ; the use of f Amplement the page fable iA no thse page table ip kept fh mahn me ¥ The clauclord Solution of Hs problém iy fo use oO Spewial 1 Smau , jast lookup howdware cache Colcol TLB a the THB ix used with page ann - table X% The TLB Contains Only a feo © Pr, ; ory shen a Logtcas addaiss 12 quer d The CPU € Page numbts i east frowch ed in TLB % Tf the page numbor tA jound vis frame number iz from ecliately avotlaele anol jx ugtol fo acts mimo, * {the page numb ig not fn TLE «cr munomy Teerenle to The page fable mut be made, bt ACTS TOs +o peoazele 1 Rotten 0 physical fnamory x the putten tage OL Hmts that a pank culo, ‘ numb. ic prune tbr called hit sabto PS so prtint het yatio mtant thod ce pirol the. duired page Numba Tn the TLE gv percent of “thes Fi Fe rf t4 takes 205 to peach the TLB amd loon to alls mem ithtn a ma ppeol memory ates fakes ons nsohen th page numba is Via TLR ¥ To bad the effect¥ye memory - arts time swe wet gat cath Care by i probabili 4 Ebeunve actess ime = L Fou a 98 Percent Aft yatio we have efpective acces time = 0-4 dado 2/22NS. 0.80% [ao + o.a0%gao =yons gx%izo+ o-0L* 4) Explatn Seymuntation en detatl + ~ Segmentation fe amemo ement scheme “thas Support hs Ug w Of memo eA Logical address Space ig tollectton of Sseqe ~nt * Each Segment hag a nome and a f additss Spc t. both Hw Segment name onset adie. sequent Hr , The d the topical adaress ae The Ugpe Teter specifies each addith% b two quant ha a twatnk pome aol an ogyret » dors stenpliurty of impler¢niabor 1 Segments oun ee Numbered cl ane weyontd to by a Seqmrent Humbin rath than a Stguant nam et & thus a logttal acldves Const of tw70 tuple x Segment -numb @ , off Ct > ¥ Thig tp done with thehelp of sepwent gable. Eath urd tn Segment table hos a segment bat OMA seqnient mit mo - H the Sequent bage Lontains Hw Slant addy wht He Se tnt yardes in memory bshuw Searment Limit Spears he (eng th oY 6 unt W othe Stament number tg used ads an in Segment table % the offset d of the logical addyey must be between © amd to, Seguaen E dient » Tt A not, we trap to Th 05. when om offset ts degal, od ig added to te Segre -ht bage to product oa addres in physical meee phy at cot dex to He trap: addressing artor physical memory Example of geqwintation subroutine Tmt of r000 | 1400 | 1] "400 | e200 | 2200 2 3 4 |e S| BE] feomengy sortie 99 © eae ial oie ce LJ or a eral _ ___Piyaloalmemery ¥% Fou example, 6 ent 9 ta 400 byte tong . beaing ot locator’ 4300 - thug, vepurenle” byte 5% Of 9% int 2 iA mapped om loation u300+ 632 B53 anol x A aefenen 6 to Segment 3, byte 852, iB mma ppeol to 3300 prnene i x A rdurente to byte 199 Of Segment © 108 a trap o, th 05, a tis Segment rs only tooo bylu long . utd wu in 5 : , 5) vorite a. wote on Suturnol auclk (y renal pragwentab‘on : x As Protesors one load ect aud racncved f Hie fel memory. spate fs bwken foto Il Preceg . ¢ © Extumal froqmtntation befck when thie ix eaoug” total mene Space to baticly oa request feet the Set nte Spa wu not Conkguocd Storage F . mn Srall hole? é prageucntea nes kenge ne ue % « thfs fragmentahion blem (an be Severe. jor memo Hle ® Depending On “Has Foial amount of mtmont Sto7eG © cind HLL average process Size , Cebtrnal Yragwent -ation may be a minor 62 O mofOr woblem x Memory jragm tntation coum be. intemal of woe external . Exomple f- & Uonsidir a mulkiple paxtiton allocation scheme oat the wth a hola of [&, 464 byTA - Suppose + avenue ig,463 bytes next prowess He srequesteol block , We ¥ 2f we allocate ecactl wie Ife WHh oO hole of a bytes ¥ the gertrol approach ite mimory allocate! ho than the tHe pros mo be Siig ht | -yequuted mero B3 7Ri-vP2 1 Ry 7 Po 4 Roy Pi, Ry Ps4 “Resource tatlances * One Instance of suouwe type R, * Two iwkane ¢ VUOUNLE tyHe R, © One instance HY sHource typt Rs * Thue ‘Tnstan es Of Msouwe ty pe Ry = & # ef graph Lontafng no ty system fs cleanl lockeok cee , then no pxottrs ih f le cleadlock kt 7 thy opaph does Contain a Yell a cea ny ee wate tly One mifance x2 ch wesource pe has eae yd a cycle ErnplOs thot a dtadtocle bas OCturcef r. * a cach yuounce type hos Several Putanie “then A Gace cloex not neemorty imply 4 dead loci hag octuned, Fos, ° O71 trample Suppog. in above figueé sintl Pa sequert am instance of resource ty Pt Be NO serounce fnstance fs Clrsent L averlabe : OO mequat edge Py—y Ry ip ndaed ro graph Pi —yTRi-YR AY Ry + Py 7 Ro -7 Pi Prowue Pons em 11 Pa Py Os dead tocked. aan R, Now Wnthle, the werurce allotat'on gerph in be lows v4 tn this trampls we also havea dy cle Pi-yR | -7Ps ~7P2—» P 03] _Disuisa the various apprmaches _ugecl fos " | deadlocks wecovery. ft TThere__ane_tur0_appreache eo wetove_ rrom_cleadlock |_» oe => |).."prtocess TeRmination: To cléminate cleadlock— 1] 1 }|=% -by -Aboadting —a_panes§z + k2e_UBe Doel tur method s.. Pn“ both methods the system —recloims all yegourles allocated tp Hh e ___ bk -t¢amfnatecl_ te SpeQ la) Abort oll deacltoc. api This method — a ta ch_tycle ;_but_at — | -Cleanly will break tae oleaclto: | great _expenge* the cleadloc AER nay Shae to mputed jor along time, and the _~_ Degulte of the pantfal torpudations must he _ —_ dliatandect_anck_probably. wilt _have tobe recon. | = puted tater. |b) —Arbostt_one. cegg__at_a time. until the | ‘dleacllock Cycle Use (Emi natecl. —____| cinre ta cach _prolegp op—abortedk ______|_ detec Kon _aloxthm mu gt be invoked tp tema ea CA_ony procegacx ane SAT Tl cleadlockeed, sthonting a pro sg may not be ——eany. the profers wax in the_midat | The method inuys tonside rabl pop open a: files tigen Fte_usttl |__teave th ile? tran incoree state =) 2)| Reson aN Lara eT rr — | Dee NiPrecte dead focks | | preemp se ne pes cuate—_ ecm cm é—___ ——_| 2éfou ee | Btaa voces i id Jro | on me ae : j2sing’ Some neecl Wxouare we_must — [rett gtlicthe proceg tn ome pale Sake —___ i tate — ____|3) Sta%yatfon 4 ensure trod | ation lefll not otuia thot i, poco e ourcea Corll not Sa LS * 81 hat ane the macthode Avaclable for h sling dead locks ? €xplofin Bomker +s alg oxtthm | ——_+-—— 92 Coun_deal_o'th the lead tock problem fn 89+ 04 thaee_vo On fo |) we deagitee te @_pxototo 10 pre Vink Oy ayarol— — that the ‘uy stem °l/ ie mn a Sat ae acked_gdak Woe an-allgus the System to toi -a_deadloc— 7 debect it, and at rover __ joe tan tgnone the prblem altogethe. and }—pabttend that deadtocks never octirin dhs Sysh ——| Bask 5 b_algctithm isn ot_ ___#| “The }-opplice ble to Q veRour(e allocatO n Sy stem 19tth en «| F ta gfittures Are needled jwhtar ny — cenenr eee TZ locke mm ip te au biiin of pau 7 og Availate + 2 stor of enth- m_ Ban tea hae ae rr rere €a¢ papal GI pay tthe nator of oumle type Rj ane ayarlable ——_}+t1# a ° x ax An —_arxm_naotatx defines Hae eae an tla fac ltas . ms a4 MoxGJG. pont I ins Lan ces ue Pay pe ke |x Arllocation + Ain Avene mnuttvixdtep ints the nam be of afsources ofp each type —Lernr ently — ——Allotated to each process A, Alocabioal iG] — ale k then prpuess Pits Currents alloca —_| ys Kintlander of regounie type Bp pe Need 2 An 9 xnaecix_indidater the | stradining regousce need of Coch pwotegs RPA | j= 0, ty.--,a-l —__| Ft Pndtx i Such that both —_| 40. #oishfiJz= Fale bs need ix > woxk ZL no such { extots goto_xtep 4 7 3. wosk = work + allocation $e to ptep 2 faiah [i] 2 System tx tna gate state _ ——}2)_Resourc © Regurgt Algotthm —__| Used +o cheterTmPne_roh the, He seguerns — fe Combe gafely. granted. _ ns ti ak * tix = Needt to sttp 2. other __|_pyotess_has _txteedtd H maytroum cla?rn, a. 2 Request ix= Available ge te gitp 3. Othra ise, Pi mougt watts Sinte “the yxegzouncer ant | not avotelable. 2. Howe th etend te have alto cates he, equtsied seyouncel to paniegs Pr by moclity P= tng. the State 45 follows Y) what tf Stoapping 1 Dow this intense 08 Overhead ? Sustify * Swap pins iz a mmo manog emtnt mttho cL that em! Dron swop Out idle br blocked pooresses {20m main mefhory to BEOndary mtmory asi ushich ensures prope memory “Gheiczarorl — __ operat system | | @omap out | | | @ewer in space ager ‘main memory —_ “eA Pxoress vu_rt be ?m memory to be execute * A pmotess Can be swapped tempo rayil out 0 Memory TO & beckon stome ¢ ud then brug Wt back into memo Sy Contnued tyecut’on % Total physical memory Space Of Prowesset qn be eX eed phystad memndy . x Barking Store - fast Chick large enough to aclowmo ~dotcY copier Of all memory Fmaga x all tae wt Roll out ~ voll tn Swappii entant useol [px pron® “4 baseol Scheduling alyo thm ; low podyty proce Ss 7 $ wo pped lout© So hight pactouity p cers Com bt Wade ancl tktcated ke system maintafu a realy queue ofvead to UH Po comer which have wnernonyg images Onelisk modi precl versions of Siopph Bm cst -ppuncl Ow many System (UNIX, LINUX, windows ) ———_| Lo1o_mem Ae eos. ___| Bach provess_(onjafatd _in_single __| roessex then held_to high natmory Pi in_si Lootintto Section Of mnemon __& | Relocation vs tsteasJ used to_proteck Ybor pro cesses | gin. coh oh and tmconyig 6 08 lodt anch_ data # Boxe ista_toniains Vo lue_of-_Snatles t i adorn a | sz lint segisien_lentain tangeof logical adddacys | -ex —Cac i s must be lex than (im? ta [MU mops” Logical dddaess_dynamtca —by | dditag is Nolue in He reloson ei | hig m1 addres ig. Sent ib inmtny at Uses LLBACR oO; Pepi es nC Ng Of vastous SBS oo and ?2 Gnsidened An1—- Ploble memory a hole. >, Bee of hele Tas I os Los f Os T |_pxotesh 51 PHOS | P40. PHoleyS : | Heeek¢ |} Pro ce SS) Paoreosy =P Prows4 ti Allncate a Smallest hole that. it pe erienly igh > Oe _mugt Seach the tnfire ares Junles “Hu list js ordered by Size —| Ei eee ces the — laa wd ba od “igh ia ted by Size TAY» St ao eae —__| = cen the tas ole_,voht ——_bt_moye_uz eae hat “th an +o Smaller itovest —— hele from —ot_bet 42a pproe och. - —Hol_Lengiden tie foltootng pro rein _Segawient Using. fork LY gteclem ent 9 Hint naan tf i ok oO; _ ag2 | + Ork.(23. ar oak 05 pring (* Hello") pl 2 ss return 05 | Daoud the Di ‘ox the chilol Created pam Pes : A ltt 22 _paxcot_pre ie € prose seco thle oo en te : eG Ge L | -pasent il 49 2Qn jn = numben oF fpuk System Catfs Jone, no3 A212 DF=8 —_] °. i 2g?.7 because one LeAL =7 "He ( af of 5) | Consider “the following program Segment |_ustng.”foak 0” Statemitats ~ 9

You might also like