操作系统概念第七版答案Word格式.docx
《操作系统概念第七版答案Word格式.docx》由会员分享,可在线阅读,更多相关《操作系统概念第七版答案Word格式.docx(14页珍藏版)》请在冰豆网上搜索。
b.canweensurethesamedegreeofsecurityinatime-sharedmachineasinadedicatedmachine?
explainyouranswer.
answer:
a.stealingorcopyingone’sprogramsordata;
usingsystemresources(cpu,memory,diskspace,peripherals)withoutproperaccounting.
b.probablynot,sinceanyprotectionschemedevisedbyhumanscaninevitablybebrokenbyahuman,andthemorecomplexthescheme,themoredifficultitistofeelconfidentofitscorrectimplementation.
1.2theissueofresourceutilizationshowsupindifferentformsindifferenttypesofoperatingsystems.listwhatresourcesmustbemanaged
carefullyinthefollowingsettings:
a.mainframeorminicomputersystemsb.workstationsconnectedtoserversc.handheldcomputers
a.mainframes:
memoryandcpuresources,storage,networkbandwidth.
b.workstations:
memoryandcpuresouces
c.handheldcomputers:
powerconsumption,memoryresources.
1.3underwhatcircumstanceswouldauserbebetteroffusingatimesharingsystemratherthanapcorsingle-userworkstation?
whentherearefewotherusers,thetaskislarge,andthehardwareisfast,time-sharingmakessense.thefullpowerofthesystemcanbebroughttobearontheuser’sproblem.theproblemcanbesolvedfasterthanonapersonalcomputer.anothercaseoccurswhenlotsofotherusersneedresourcesatthesametime.
apersonalcomputerisbestwhenthejobissmallenoughtobeexecutedreasonablyonitandwhenperformanceissufficienttoexecutetheprogramtotheuser’ssatisfaction.
1.4whichofthefunctionalitieslistedbelowneedtobesupportedbytheoperatingsystemforthefollowingtwosettings:
(a)handhelddevicesand(b)real-timesystems.a.batchprogrammingb.virtualmemoryc.timesharing
forreal-timesystems,theoperatingsystemneedstosupportvirtualmemory
andtimesharinginafairmanner.forhandheldsystems,theoperatingsystemneedstoprovidevirtualmemory,butdoesnotneedtoprovidetime-sharing.batchprogrammingisnotnecessaryinbothsettings.
1.5describethedifferencesbetweensymmetricandasymmetricmultiprocessing.whatarethreeadvantagesandonedisadvantageofmultiprocessorsystems?
symmetricmultiprocessingtreatsallprocessorsasequals,andi/ocanbeprocessedonanycpu.asymmetricmultiprocessinghasonemastercpuandtheremaindercpusareslaves.themasterdistributestasksamongtheslaves,andi/oisusuallydonebythemasteronly.
multiprocessorscansavemoneybynotduplicatingpowersupplies,housings,andperipherals.theycanexecuteprogramsmorequicklyandcanhaveincreasedreliability.theyarealsomorecomplexinbothhardwareandsoftwarethanuniprocessorsystems.
1.6howdoclusteredsystemsdifferfrommultiprocessorsystems?
whatisrequiredfortwomachinesbelongingtoaclustertocooperatetoprovideahighlyavailableservice?
clusteredsystemsaretypicallyconstructedbycombiningmultiplecomputersintoasinglesystemtoperformacomputationaltaskdistributedacrossthecluster.multiprocessorsystemsontheotherhandcouldbeasinglephysicalentitycomprisingofmultiplecpus.aclusteredsystemislesstightlycoupledthanamultiprocessorsystem.clusteredsystemscommunicateusingmessages,whileprocessorsinamultiprocessorsystemcouldcommunicateusingsharedmemory.
inorderfortwomachinestoprovideahighlyavailableservice,thestateonthetwomachinesshouldbereplicatedandshouldbeconsistentlyupdated.whenoneofthemachinesfail,theothercouldthentake-overthefunctionalityofthefailedmachine.
1.7distinguishbetweentheclient-serverandpeer-to-peermodelsofdistributedsystems.
theclient-servermodelfirmlydistinguishestherolesoftheclientandserver.underthismodel,theclientrequestsservicesthatareprovidedbytheserver.thepeer-to-peermodeldoesn’thavesuchstrictroles.infact,allnodesinthesystemareconsideredpeersandthusmayactaseitherclientsorservers-orboth.anodemayrequestaservicefromanotherpeer,orthenodemayinfactprovidesuchaservicetootherpeersinthesystem.
forexample,let’sconsiderasystemofnodesthatsharecookingrecipes.undertheclient-servermodel,allrecipesarestoredwiththeserver.ifaclientwishestoaccessarecipe,itmustrequesttherecipefromthespecifiedserver.usingthepeer-to-peermodel,apeernodecouldaskotherpeernodesforthespecifiedrecipe.
thenode(orperhapsnodes)withtherequestedrecipecouldprovideittotherequestingnode.noticehoweachpeermayactasbothaclient(i.e.itmayrequestrecipes)andasaserver(itmayproviderecipes.)
1.8consideracomputingclusterconsistingoftwonodesrunningadatabase.describetwowaysinwhichtheclustersoftwarecanmanageaccesstothedataonthedisk.discussthebenefitsanddisadvantagesofeach.
considerthefollowingtwoalternatives:
asymmetricclusteringandparallelclustering.withasymmetricclustering,onehostrunsthedatabaseapplicationwiththeotherhostsimplymonitoringit.iftheserverfails,themonitoringhostbecomestheactiveserver.thisisappropriateforprovidingredundancy.however,itdoesnotutilizethepotentialprocessingpowerofbothhosts.withparallelclustering,thedatabaseapplicationcanruninparallelonbothhosts.thedifficultyimplementingparallelclustersisprovidingsomeformofdistributedlockingmechanismforfilesontheshareddisk.
1.9howarenetworkcomputersdifferentfromtraditionalpersonalcomputers?
describesomeusagescenariosinwhichitisadvantageoustousenetworkcomputers.
anetworkcomputerreliesonacentralizedcomputerformostofitsservices.itcanthereforehaveaminimaloperatingsystemtomanageitsresources.apersonalcomputerontheotherhandhastobecapableofprovidingalloftherequiredfunctionalityinastandalonemannerwithoutrelyingonacentralizedmanner.scenarioswhereadministrativecostsarehighandwheresharingleadstomoreefficientuseofresourcesarepreciselythosesettingswherenetworkcomputersarepreferred.
1.10whatisthepurposeofinterrupts?
whatarethedifferencesbetweenatrapandaninterrupt?
cantrapsbegeneratedintentionallybyauserprogram?
ifso,forwhatpurpose?
aninterruptisahardware-generatedchange-of-flowwithinthesystem.aninterrupthandlerissummonedtodealwiththecauseoftheinterrupt;
controlisthenreturnedtotheinterruptedcontextandinstruction.atrapisasoftware-generatedinterrupt.aninterruptcanbeusedtosignalthecompletionofani/otoobviatetheneedfordevicepolling.atrapcanbeusedtocalloperatingsystemroutinesortocatcharithmeticerrors.
1.11directmemoryaccessisusedforhigh-speedi/odevicesinordertoavoidincreasingthecpu′sexecutionload.
a.howdoesthecpuinterfacewiththedevicetocoordinatethetransfer?
b.howdoesthecpuknowwhenthememoryoperationsarecomplete?
c.thecpuisallowedtoexecuteotherprogramswhilethedmacontrolleris
transferringdata.doesthisprocessinterferewiththeexecutionoftheuserprograms?
ifso,describewhatformsofinterferencearecaused.
thecpucaninitiateadmaoperationbywritingvaluesintospecialregistersthatcanbeindependentlyaccessedbythedevice.thedeviceinitiatesthecorrespondingoperationonceitreceivesacommandfromthecpu.whenthedeviceisfinishedwithitsoperation,itinterruptsthecputoindicatethecompletionoftheoperation.
boththedeviceandthecpucanbeaccessingmemorysimultaneously.thememorycontrollerprovidesaccesstothememorybusinafairmannertothesetwoentities.
acpumightthereforebeunabletoissuememoryoperationsatpeakspeedssinceithastocompetewiththedeviceinordertoobtainaccesstothememorybus.
anoperatingsystemforamachineofthistypewouldneedtoremainincontrol(ormonitormode)atalltimes.thiscouldbeaccomplishedbytwomethods:
a.softwareinterpretationofalluserprograms(likesomebasic,java,andlispsystems,forexample).thesoftwareinterpreterwouldprovide,insoftware,whatthehardwaredoesnotprovide.
b.requiremeantthatallprogramsbewritteninhigh-levellanguagessothatallobjectcodeiscompiler-produced.thecompilerwouldgenerate(eitherin-lineorbyfunctioncalls)theprotectionchecksthatthehardwareismissing.
1.13givetworeasonswhycachesareuseful.whatproblemsdotheysolve?
whatproblemsdotheycause?
ifacachecanbemadeaslargeasthedeviceforwhichitiscaching(forinstance,acacheaslargeasadisk),whynotmakeitthatlargeandeliminatethedevice?
cachesareusefulwhentwoormorecomponentsneedtoexchangedata,andthecomponentsperformtransfersatdifferingspeeds.cachessolvethetransferproblembyprovidingabufferofintermediatespeedbetweenthecomponents.ifthefastdevicefindsthedataitneedsinthecache,itneednotwaitfortheslowerdevice.thedatainthecachemustbekeptconsistentwiththedatainthecomponents.ifaomponenthasadatavaluechange,andthedatumisalsointhecache,thecachemustalsobeupdated.thisisespeciallyaproblemonmultiprocessorsystemswheremorethanoneprocessmaybeaccessingadatum.acomponentmaybeeliminatedbyanequal-sizedcache,butonlyif:
(a)thecacheandthecomponenthaveequivalentstate-savingcapacity(thatis,ifthecomponentretainsitsdatawhenelect