操作系统概念第七版答案含编程代码.docx
- 文档编号:26279773
- 上传时间:2023-06-17
- 格式:DOCX
- 页数:143
- 大小:159.95KB
操作系统概念第七版答案含编程代码.docx
《操作系统概念第七版答案含编程代码.docx》由会员分享,可在线阅读,更多相关《操作系统概念第七版答案含编程代码.docx(143页珍藏版)》请在冰豆网上搜索。
操作系统概念第七版答案含编程代码
solutionstotheexercises
Chapter1
1.1Inamultiprogrammingandtime-sharingenvironment,severaluserssharethesystemsimultaneously.Thissituationcanresultinvarioussecurityproblems.
a.Whataretwosuchproblems?
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
Answer:
a.Mainframes:
memoryandCPUresources,storage,networkbandwidth.
b.Workstations:
memoryandCPUresouces
c.Handheldcomputers:
powerconsumption,memoryresources.
1.3UnderwhatcircumstanceswouldauserbebetteroffusingatimesharingsystemratherthanaPCorsingle-userworkstation?
Answer:
Whentherearefewotherusers,thetaskislarge,andthehardwareisfast,time-sharingmakessense.Thefullpowerofthesystemcanbebroughttobearontheuser’sproblem.Theproblemcanbesolvedfasterthanonapersonalcomputer.Anothercaseoccurswhenlotsofotherusersneedresourcesatthesametime.
Apersonalcomputerisbestwhenthejobissmallenoughtobeexecutedreasonablyonitandwhenperformanceissufficienttoexecutetheprogramtotheuser’ssatisfaction.
1.4Whichofthefunctionalitieslistedbelowneedtobesupportedbytheoperatingsystemforthefollowingtwosettings:
(a)handhelddevicesand(b)real-timesystems.a.Batchprogrammingb.Virtualmemoryc.Timesharing
Answer:
Forreal-timesystems,theoperatingsystemneedstosupportvirtualmemoryandtimesharinginafairmanner.Forhandheldsystems,theoperatingsystemneedstoprovidevirtualmemory,butdoesnotneedtoprovidetime-sharing.Batchprogrammingisnotnecessaryinbothsettings.
1.5Describethedifferencesbetweensymmetricandasymmetricmultiprocessing.Whatarethreeadvantagesandonedisadvantageofmultiprocessorsystems?
Answer:
Symmetricmultiprocessingtreatsallprocessorsasequals,andI/OcanbeprocessedonanyCPU.AsymmetricmultiprocessinghasonemasterCPUandtheremainderCPUsareslaves.Themasterdistributestasksamongtheslaves,andI/Oisusuallydonebythemasteronly.
Multiprocessorscansavemoneybynotduplicatingpowersupplies,housings,andperipherals.Theycanexecuteprogramsmorequicklyandcanhaveincreasedreliability.Theyarealsomorecomplexinbothhardwareandsoftwarethanuniprocessorsystems.
1.6Howdoclusteredsystemsdifferfrommultiprocessorsystems?
Whatisrequiredfortwomachinesbelongingtoaclustertocooperatetoprovideahighlyavailableservice?
Answer:
Clusteredsystemsaretypicallyconstructedbycombiningmultiplecomputersintoasinglesystemtoperformacomputationaltaskdistributedacrossthecluster.MultiprocessorsystemsontheotherhandcouldbeasinglephysicalentitycomprisingofmultipleCPUs.Aclusteredsystemislesstightlycoupledthanamultiprocessorsystem.Clusteredsystemscommunicateusingmessages,whileprocessorsinamultiprocessorsystemcouldcommunicateusingsharedmemory.
Inorderfortwomachinestoprovideahighlyavailableservice,thestateonthetwomachinesshouldbereplicatedandshouldbeconsistentlyupdated.Whenoneofthemachinesfail,theothercouldthentake-overthefunctionalityofthefailedmachine.
1.7Distinguishbetweentheclient-serverandpeer-to-peermodelsofdistributedsystems.
Answer:
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.
Answer:
Considerthefollowingtwoalternatives:
asymmetricclusteringandparallelclustering.Withasymmetricclustering,onehostrunsthedatabaseapplicationwiththeotherhostsimplymonitoringit.Iftheserverfails,themonitoringhostbecomestheactiveserver.Thisisappropriateforprovidingredundancy.However,itdoesnotutilizethepotentialprocessingpowerofbothhosts.Withparallelclustering,thedatabaseapplicationcanruninparallelonbothhosts.Thedifficultyimplementingparallelclustersisprovidingsomeformofdistributedlockingmechanismforfilesontheshareddisk.
1.9Howarenetworkcomputersdifferentfromtraditionalpersonalcomputers?
Describesomeusagescenariosinwhichitisadvantageoustousenetworkcomputers.
Answer:
Anetworkcomputerreliesonacentralizedcomputerformostofitsservices.Itcanthereforehaveaminimaloperatingsystemtomanageitsresources.Apersonalcomputerontheotherhandhastobecapableofprovidingalloftherequiredfunctionalityinastandalonemannerwithoutrelyingonacentralizedmanner.Scenarioswhereadministrativecostsarehighandwheresharingleadstomoreefficientuseofresourcesarepreciselythosesettingswherenetworkcomputersarepreferred.
1.10Whatisthepurposeofinterrupts?
Whatarethedifferencesbetweenatrapandaninterrupt?
Cantrapsbegeneratedintentionallybyauserprogram?
Ifso,forwhatpurpose?
Answer:
Aninterruptisahardware-generatedchange-of-flowwithinthesystem.Aninterrupthandlerissummonedtodealwiththecauseoftheinterrupt;controlisthenreturnedtotheinterruptedcontextandinstruction.Atrapisasoftware-generatedinterrupt.AninterruptcanbeusedtosignalthecompletionofanI/Otoobviatetheneedfordevicepolling.Atrapcanbeusedtocalloperatingsystemroutinesortocatcharithmeticerrors.
1.11Directmemoryaccessisusedforhigh-speedI/OdevicesinordertoavoidincreasingtheCPU′sexecutionload.
a.HowdoestheCPUinterfacewiththedevicetocoordinatethetransfer?
b.HowdoestheCPUknowwhenthememoryoperationsarecomplete?
c.TheCPUisallowedtoexecuteotherprogramswhiletheDMAcontrolleristransferringdata.Doesthisprocessinterferewiththeexecutionoftheuserprograms?
Ifso,describewhatformsofinterferencearecaused.
Answer:
TheCPUcaninitiateaDMAoperationbywritingvaluesintospecialregistersthatcanbeindependentlyaccessedbythedevice.ThedeviceinitiatesthecorrespondingoperationonceitreceivesacommandfromtheCPU.Whenthedeviceisfinishedwithitsoperation,itinterruptstheCPUtoindicatethecompletionoftheoperation.
BoththedeviceandtheCPUcanbeaccessingmemorysimultaneously.Thememorycontrollerprovidesaccesstothememorybusinafairmannertothesetwoentities.ACPUmightthereforebeunabletoissuememoryoperationsatpeakspeedssinceithastocompetewiththedeviceinordertoobtainaccesstothememorybus.
1.12Somecomputersystemsdonotprovideaprivilegedmodeofoperationinhardware.Isitpossibletoconstructasecureoperatingsystemforthesecomputersystems?
Giveargumentsboththatitisandthatitisnotpossible.
Answer:
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?
Answer:
Cachesareusefulwhentwoormorecomponentsneedtoexchangedata,andthecomponentsperformtransfersatdifferingspeeds.Cachessolvethetransferproblembyprovidingabufferofintermediatespeedbetweenthecomponents.Ifthefastdevicefindsthedataitneedsinthecache,itneednotwaitfortheslowerdevice.Thedatainthecachemustbekeptconsistentwiththedatainthecomponents.Ifaomponenthasadatavaluechange,andthedatumisalsointhecache,thecachemustalsobeupdated.Thisisespeciallyaproblemonmultiprocessorsystemswheremorethanoneprocessmaybeaccessingadatum.Acomponen
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 操作系统 概念 第七 答案 编程 代码