操作系统复习题Word格式文档下载.docx
《操作系统复习题Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《操作系统复习题Word格式文档下载.docx(8页珍藏版)》请在冰豆网上搜索。
Whatistheuseofeachfunction?
2.4ForwhattypesofoperationsisDMAuseful?
Explainyouranswer.
2.9Givetworeasonswhycachesareuseful.Whatproblemsdotheysolve?
Whatproblemsdotheycause?
Ifacachecanbemadeaslargeasthedeviceforwhichitiscaching(forinstance,acacheaslargeasadisk),whynotmakeitthatlargeandeliminatethedevice?
3.1Whatarethefivemajoractivitiesofanoperatingsysteminregardtoprocessmanagement?
3.2Whatarethethreemajoractivitiesofanoperatingsysteminregardtomemorymanagement?
3.3Whatarethethreemajoractivitiesofanoperatingsysteminregardtosecondary-storagemanagement?
3.4Whatarethefivemajoractivitiesofanoperatingsysteminregardtofilemanagement?
3.5Whatisthepurposeofthecommandinterpreter?
Whyisitusuallyseparatefromthekernel?
3.7Whatisthepurposeofsystemcalls?
3.11Whatisthemainadvantageofthelayeredapproachtosystemdesign?
3.12Whatarethemainadvantagesofthemicrokernelapproachtosystemdesign?
4.2Describethedifferencesamongshort-term,medium-term,andlong-termscheduling.
4.4Describetheactionsakerneltakestocontextswitchbetweenprocesses.
5.1Providetwoprogrammingexamplesofmultithreadinggivingimprovedperformanceoverasingle-threadedsolution.
5.2Providetwoprogrammingexamplesofmultithreadingthatwouldnotimproveperformance
overasingle-threadedsolution.
5.3Whataretwodifferencesbetweenuser-levelthreadsandkernel-levelthreads?
Underwhatcircumstancesisonetypebetterthantheother?
5.6Whatresourcesareusedwhenathreadiscreated?
Howdotheydifferfromthoseusedwhenaprocessiscreated?
6.1ACPUschedulingalgorithmdeterminesanorderfortheexecutionofitsscheduledprocesses.Givennprocessestobescheduledononeprocessor,howmanypossibledifferentschedulesarethere?
Giveaformulaintermsofn.
6.2Definethedifferencebetweenpreemptiveandnonpreemptivescheduling.Statewhystrictnonpreemptiveschedulingisunlikelytobeusedinacomputercenter.
6.3Considerthefollowingsetofprocesses,withthelengthoftheCPU-bursttimegiveninmilliseconds:
ProcessBurstTimePriority
P1103
P211
P323
P414
P552
TheprocessesareassumedtohavearrivedintheorderP1,P2,P3,P4,P5,allattime0.
a.DrawfourGanttchartsillustratingtheexecutionoftheseprocessesusingFCFS,SJF,anonpreemptivepriority(asmallerprioritynumberimpliesahigherpriority),andRR(quantum=1)scheduling.
b.Whatistheturnaroundtimeofeachprocessforeachoftheschedulingalgorithmsinparta?
c.Whatisthewaitingtimeofeachprocessforeachoftheschedulingalgorithmsinparta?
d.Whichoftheschedulesinpartaresultsintheminimalaveragewaitingtime(overallprocesses)?
6.4Supposethatthefollowingprocessesarriveforexecutionatthetimesindicated.Eachprocesswillrunthelistedamountoftime.Inansweringthequestions,usenonpreemptiveschedulingandbasealldecisionsontheinformationyouhaveatthetimethedecisionmustbemade.
ProcessArrivalTimeBurstTime
P10.08
P20.44
P31.01
a.WhatistheaverageturnaroundtimefortheseprocesseswiththeFCFSschedulingalgorithm?
b.WhatistheaverageturnaroundtimefortheseprocesseswiththeSJFschedulingalgorithm?
c.TheSJFalgorithmissupposedtoimproveperformance,butnoticethatwechosetorunprocessP1attime0becausewedidnotknowthattwoshorterprocesseswould
arrivesoon.ComputewhattheaverageturnaroundtimewillbeiftheCPUisleftidleforthefirst1unitandthenSJFschedulingisused.RememberthatprocessesP1andP2arewaitingduringthisidletime,sotheirwaitingtimemayincrease.Thisalgorithmcouldbeknownasfuture-knowledgescheduling.
Rememberthatturnaroundtimeisfinishingtimeminusarrivaltime,soyouhavetosubtractthearrivaltimestocomputetheturnaroundtimes.FCFSis11ifyouforgettosubtractarrivaltime.
6.6Whatadvantageisthereinhavingdifferenttime-quantumsizesondifferentlevelsofamultilevelqueueingsystem?
6.10Explainthedifferencesinthedegreetowhichthefollowingschedulingalgorithmsdiscriminateinfavorofshortprocesses:
a.FCFS
b.RR
c.Multilevelfeedbackqueues
8.1Listthreeexamplesofdeadlocksthatarenotrelatedtoacomputer-systemenvironment.
8.2Isitpossibletohaveadeadlockinvolvingonlyonesingleprocess?
8.8Considerasystemconsistingoffourresourcesofthesametypethataresharedbythreeprocesses,eachofwhichneedsatmosttworesources.Showthatthesystemisdeadlock-free.
8.13Considerthefollowingsnapshotofasystem:
Answerthefollowingquestionsusingthebanker’salgorithm:
a.WhatisthecontentofthematrixNeed?
b.Isthesysteminasafestate?
c.IfarequestfromprocessP1arrivesfor(0,4,2,0),cantherequestbegrantedimmediately?
9.2Explainthedifferencebetweeninternalandexternalfragmentation.
9.3Describethefollowingallocationalgorithms:
a.Firstfit
b.Bestfit
c.Worstfit
9.5Givenmemorypartitionsof100K,500K,200K,300K,and600K(inorder),howwouldeachoftheFirst-fit,Best-fit,andWorst-fitalgorithmsplaceprocessesof212K,417K,112K,and426K(inorder)?
Whichalgorithmmakesthemostefficientuseofmemory?
9.7Whyarepagesizesalwayspowersof2?
9.8Consideralogicaladdressspaceofeightpagesof1024wordseach,mappedontoaphysical
memoryof32frames.
a.Howmanybitsarethereinthelogicaladdress?
b.Howmanybitsarethereinthephysicaladdress?
9.10Considerapagingsystemwiththepagetablestoredinmemory.
a.Ifamemoryreferencetakes200nanoseconds,howlongdoesapagedmemoryreferencetake?
b.Ifweaddassociativeregisters,and75percentofallpage-tablereferencesarefoundintheassociativeregisters,whatistheeffectivememoryreferencetime?
(Assumethatfindingapage-tableentryintheassociativeregisterstakeszerotime,iftheentryisthere.)
9.16Considerthefollowingsegmenttable:
Whatarethephysicaladdressesforthefollowinglogicaladdresses?
a.0,430
b.1,10
c.2,500
d.3,400
e.4,112
10.1Underwhatcircumstancesdopagefaultsoccur?
Describetheactionstakenbytheoperating
systemwhenapagefaultoccurs.
10.2Assumeapagereferencestringforaprocesswithmframes(initiallyallempty).Thepagereferencestringhaslengthpwithndistinctpagenumbersoccurringinit.Foranypage-replacementalgorithms,
a.Whatisalowerboundonthenumberofpagefaults?
b.Whatisanupperboundonthenumberofpagefaults?
10.3Acertaincomputerprovidesitsuserswithavirtual-memoryspaceof232bytes.Thecomputerhas218bytesofphysicalmemory.Thevirtualmemoryisimplementedbypaging,andthepagesizeis4096bytes.Auserprocessgeneratesthevirtualaddress11123456.Explainhowthesystemestablishesthecorrespondingphysicallocation.Distinguishbetweensoftwareandhardwareoperations.
10.5Assumewehaveademand-pagedmemory.Thepagetableisheldinregisters.Ittakes8millisecondstoserviceapagefaultifanemptypageisavailableorthereplacedpageis
notmodified,and20millisecondsifthereplacedpageismodified.Memoryaccesstimeis100nanoseconds.Assumethatthepagetobereplacedismodified70percentofthetime.Whatisthemaximumacceptablepage-faultrateforaneffectiveaccesstimeofnomorethan200nanoseconds?
10.11Considerthefollowingpagereferencestring:
1,2,3,4,2,1,5,6,2,1,2,3,7,6,3,2,1,2,3,6.
Howmanypagefaultswouldoccurforthefollowingreplacementalgorithms,assumingone,two,three,four,five,six,orsevenframes?
Rememberallframesareinitiallyempty,soyourfirstuniquepageswillallcostonefaulteach.
LRUreplacement
FIFOreplacement
Optimalreplacement
10.20Whatisthecauseofthrashing?
Howdoesthesystemdetectthrashing?
Onceitdetectsthrashing,whatcanthesystemdotoeliminatethisproblem?
11.1Considerafilesystemwhereafilecanbedeletedanditsdiskspacereclaimedwhilelinkstothatfilestillexist.Whatproblemsmayoccurifanewfileiscreatedinthesamestorageareaorwiththesameabsolutepathname?
Howcantheseproblemsbeavoided?
11.7Explainthepurposeoftheopenandcloseoperations.
11.9Giveanexampleofanapplicationinwhichdatainafileshouldbeaccessedinthefollowingorder:
a.Sequentially
b.Randomly
11.10Somesystemsprovidefilesharingbymaintainingasinglecopyofafile;
othersystemsmaintainseveralcopies,oneforeachoftheuserssharingthefile.Discusstherelativemeritsofeachapproach.
12.5Considerasystemthatsupportsthestrategiesofcontiguous,linked,andindexedallocation.Whatcriteriashouldbeusedindecidingwhichstrategyisbestutilizedforaparticularfile?
12.9Howdocacheshelpimproveperformance?
Whydosystemsnotusemoreorlargercachesiftheyaresouseful?
13.2ConsiderthefollowingI/Oscenariosonasingle-userPC.
a.Amouseusedwithagraphicaluserinterface
b.Atapedriveonamultitaskingoperatingsystem(a