操作系统课后题答案_第1页
操作系统课后题答案_第2页
操作系统课后题答案_第3页
操作系统课后题答案_第4页
操作系统课后题答案_第5页
已阅读5页,还剩94页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

word格式-可编辑-感谢下载支持solutionstotheexercisesChapter11.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.Listwhatresourcesmustbemanagedcarefullyinthefollowingsettings:a.Mainframeorminicomputersystemsb.Workstationsconnectedtoserversc.HandheldcomputersAnswer:a.Mainframes:memoryandCPUresources,storage,networkbandwidth.b.Workstations:memoryandCPUresoucesc.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.TimesharingAnswer: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.Acomponentmaybeeliminatedbyanequal-sizedcache,butonlyif:(a)thecacheandthecomponenthaveequivalentstate-savingcapacity(thatis,ifthecomponentretainsitsdatawhenelectricityisremoved,thecachemustretaindataaswell),and(b)thecacheisaffordable,becausefasterstoragetendstobemoreexpensive.1.14Discuss,withexamples,howtheproblemofmaintainingcoherenceofcacheddatamanifestsitselfinthefollowingprocessingenvironments:a.Single-processorsystemsb.Multiprocessorsystemsc.DistributedsystemsAnswer:Insingle-processorsystems,thememoryneedstobeupdatedwhenaprocessorissuesupdatestocachedvalues.Theseupdatescanbeperformedimmediatelyorinalazymanner.Inamultiprocessorsystem,differentprocessorsmightbecachingthesamememorylocationinitslocalcaches.Whenupdatesaremade,theothercachedlocationsneedtobeinvalidatedorupdated.Indistributedsystems,consistencyofcachedmemoryvaluesisnotanissue.However,consistencyproblemsmightarisewhenaclientcachesfiledata.1.15Describeamechanismforenforcingmemoryprotectioninordertopreventaprogramfrommodifyingthememoryassociatedwithotherprograms.Answer:Theprocessorcouldkeeptrackofwhatlocationsareassociatedwitheachprocessandlimitaccesstolocationsthatareoutsideofaprogram’sextent.Informationregardingtheextentofaprogram’smemorycouldbemaintainedbyusingbaseandlimitsregistersandbyperformingacheckforeverymemoryaccess.1.16Whatnetworkconfigurationwouldbestsuitthefollowingenvironments?a.Adormitoryfloorb.Auniversitycampusc.Astated.AnationAnswer:a.Adormitoryfloor-ALAN.b.Auniversitycampus-ALAN,possibleaWANforverylargecampuses.c.Astate-AWAN.d.Anation-AWAN.1.17Definetheessentialpropertiesofthefollowingtypesofoperatingsystems:a.Batchb.Interactivec.Timesharingd.Realtimee.Networkf.Parallelg.Distributedh.Clusteredi.HandheldAnswer:a.Batch.Jobswithsimilarneedsarebatchedtogetherandrunthroughthecomputerasagroupbyanoperatororautomaticjobsequencer.PerformanceisincreasedbyattemptingtokeepCPUandI/Odevicesbusyatalltimesthroughbuffering,off-lineoperation,spooling,andmultiprogramming.Batchisgoodforexecutinglargejobsthatneedlittleinteraction;itcanbesubmittedandpickeduplater.b.Interactive.Thissystemiscomposedofmanyshorttransactionswheretheresultsofthenexttransactionmaybeunpredictable.Responsetimeneedstobeshort(seconds)sincetheusersubmitsandwaitsfortheresult.c.Timesharing.ThissystemsusesCPUschedulingandmultiprogrammingtoprovideeconomicalinteractiveuseofasystem.TheCPUswitchesrapidlyfromoneusertoanother.Insteadofhavingajobdefinedbyspooledcardimages,eachprogramreadsitsnextcontrolcardfromtheterminal,andoutputisnormallyprintedimmediatelytothescreen.d.Realtime.Oftenusedinadedicatedapplication,thissystemreadsinformationfromsensorsandmustrespondwithinafixedamountoftimetoensurecorrectperformance.e.Network.Providesoperatingsystemfeaturesacrossanetworksuchasfilesharing.f.SMP.UsedinsystemswheretherearemultipleCPU’seachrunningthesamecopyoftheoperatingsystem.Communicationtakesplaceacrossthesystembus.g.Distributed.Thissystemdistributescomputationamongseveralphysicalprocessors.Theprocessorsdonotsharememoryoraclock.Instead,eachprocessorhasitsownlocalmemory.Theycommunicatewitheachotherthroughvariouscommunicationlines,suchasahigh-speedbusorlocalareanetwork.h.Clustered.Aclusteredsystemcombinesmultiplecomputersintoasinglesystemtoperformcomputationaltaskdistributedacrossthecluster.i.Handheld.Asmallcomputersystemthatperformssimpletaskssuchascalendars,email,andwebbrowsing.Handheldsystemsdifferfromtraditionaldesktopsystemswithsmallermemoryanddisplayscreensandslowerprocessors.1.18Whatarethetradeoffsinherentinhandheldcomputers?Answer:HandheldcomputersaremuchsmallerthantraditionaldesktopPC’s.Thisresultsinsmallermemory,smallerscreens,andslowerprocessingcapabilitiesthanastandarddesktopPC.Becauseoftheselimitations,mosthandheldscurrentlycanperformonlybasictaskssuchascalendars,email,andsimplewordprocessing.However,duetotheirsmallsize,theyarequiteportableand,whentheyareequippedwithwirelessaccess,canprovideremoteaccesstoelectronicmailandtheworldwideweb.Chapter22.1Theservicesandfunctionsprovidedbyanoperatingsystemcanbedividedintotwomaincategories.Brieflydescribethetwocategoriesanddiscusshowtheydiffer.Answer:Oneclassofservicesprovidedbyanoperatingsystemistoenforceprotectionbetweendifferentprocessesrunningconcurrentlyinthesystem.Processesareallowedtoaccessonlythosememorylocationsthatareassociatedwiththeiraddressspaces.Also,processesarenotallowedtocorruptfilesassociatedwithotherusers.Aprocessisalsonotallowedtoaccessdevicesdirectlywithoutoperatingsystemntervention.Thesecondclassofservicesprovidedbyanoperatingsystemistoprovidenewfunctionalitythatisnotsupporteddirectlybytheunderlyinghardware.Virtualmemoryandfilesystemsaretwosuchexamplesofnewservicesprovidedbyanoperatingsystem.2.2Listfiveservicesprovidedbyanoperatingsystemthataredesignedtomakeitmoreconvenientforuserstousethecomputersystem.Inwhatcasesitwouldbeimpossibleforuser-levelprogramstoprovidetheseservices?Explain.Answer:•Programexecution.Theoperatingsystemloadsthecontents(orsections)ofafileintomemoryandbeginsitsexecution.Auser-levelprogramcouldnotbetrustedtoproperlyallocateCPUtime.•I/Ooperations.Disks,tapes,seriallines,andotherdevicesmustbecommunicatedwithataverylowlevel.Theuserneedonlyspecifythedeviceandtheoperationtoperformonit,whilethesystemconvertsthatrequestintodevice-orcontroller-specificcommands.User-levelprogramscannotbetrustedtoonlyaccessdevicestheyshouldhaveaccesstoandtoonlyaccessthemwhentheyareotherwiseunused.•File-systemmanipulation.Therearemanydetailsinfilecreation,deletion,allocation,andnamingthatusersshouldnothavetoperform.Blocksofdiskspaceareusedbyfilesandmustbetracked.Deletingafilerequiresremovingthenamefileinformationandfreeingtheallocatedblocks.Protectionsmustalsobecheckedtoassureproperfileaccess.Userprogramscouldneitherensureadherencetoprotectionmethodsnorbetrustedtoallocateonlyfreeblocksanddeallocateblocksonfiledeletion.•Communications.Messagepassingbetweensystemsrequiresmessagesbeturnedintopacketsofinformation,senttothenetworkcontroller,transmittedacrossacommunicationsmedium,andreassembledbythedestinationsystem.Packetorderinganddatacorrectionmusttakeplace.Again,userprogramsmightnotcoordinateaccesstothenetworkdevice,ortheymightreceivepacketsdestinedforotherprocesses.•Errordetection.Errordetectionoccursatboththehardwareandsoftwarelevels.Atthehardwarelevel,alldatatransfersmustbeinspectedtoensurethatdatahavenotbeencorruptedintransit.Alldataonmediamustbecheckedtobesuretheyhavenotchangedsincetheywerewrittentothemedia.Atthesoftwarelevel,mediamustbecheckedfordataconsistency;forinstance,dothenumberofallocatedand

unallocatedblocksofstoragematchthetotalnumberonthedevice.There,errorsarefrequentlyprocess-independent(forinstance,thecorruptionofdataonadisk),sotheremustbeaglobalprogram(theoperatingsystem)thathandlesalltypesoferrors.Also,byhavingerrorsprocessedbytheoperatingsystem,processesneednotcontaincodetocatchandcorrectalltheerrorspossibleonasystem.2.3Describethreegeneralmethodsforpassingparameterstotheoperatingsystem.Answer:a.Passparametersinregistersb.Registerspassstartingaddressesofblocksofparametersc.Parameterscanbeplaced,orpushed,ontothestackbytheprogram,andpoppedoffthestackbytheoperatingsystem.2.4Describehowyoucouldobtainastatisticalprofileoftheamountoftimespentbyaprogramexecutingdifferentsectionsofitscode.Discusstheimportanceofobtainingsuchastatisticalprofile.Answer:Onecouldissueperiodictimerinterruptsandmonitorwhatinstructionsorwhatsectionsofcodearecurrentlyexecutingwhentheinterruptsaredelivered.Astatisticalprofileofwhichpiecesofcodewereactiveshouldbeconsistentwiththetimespentbytheprogramindifferentsectionsofitscode.Oncesuchastatisticalprofilehasbeenobtained,theprogrammercouldoptimizethosesectionsofcodethatareconsumingmoreoftheCPUresources.2.5Whatarethefivemajoractivitiesofanoperatingsysteminregardtofilemanagement?Answer:•Thecreationanddeletionoffiles•Thecreationanddeletionofdirectories•Thesupportofprimitivesformanipulatingfilesanddirectories•Themappingoffilesontosecondarystorage•Thebackupoffilesonstable(nonvolatile)storagemedia2.6Whataretheadvantagesanddisadvantagesofusingthesamesystemcallinterfaceformanipulatingbothfilesanddevices?Answer:Eachdevicecanbeaccessedasthoughitwasafileinthefilesystem.Sincemostofthekerneldealswithdevicesthroughthisfileinterface,itisrelativelyeasytoaddanewdevicedriverbyimplementingthehardware-specificcodetosupportthisabstractfileinterface.Therefore,thisbenefitsthedevelopmentofbothuserprogramcode,whichcanbewrittentoaccessdevicesandfilesinthesamemanner,anddevicedrivercode,whichcanbewrittentosupportawell-definedAPI.ThedisadvantagewithusingthesameinterfaceisthatitmightbedifficulttocapturethefunctionalityofcertaindeviceswithinthecontextofthefileaccessAPI,therebyeitherresultinginalossoffunctionalityoralossofperformance.Someofthiscouldbeovercomebytheuseofioctloperationthatprovidesageneralpurposeinterfaceforprocessestoinvokeoperationsondevices.2.7Whatisthepurposeofthecommandinterpreter?Whyisitusuallyseparatefromthekernel?Woulditbepossiblefortheusertodevelopanewcommandinterpreterusingthesystem-callinterfaceprovidedbytheoperatingsystem?Answer:Itreadscommandsfromtheuserorfromafileofcommandsandexecutesthem,usuallybyturningthemintooneormoresystemcalls.Itisusuallynotpartofthekernelsincethecommandinterpreterissubjecttochanges.Anusershouldbeabletodevelopanewcommandinterpreterusingthesystem-callinterfaceprovidedbytheoperatingsystem.Thecommandinterpreterallowsanusertocreateandmanageprocessesandalsodeterminewaysbywhichtheycommunicate(suchasthroughpipesandfiles).Asallofthisfunctionalitycouldbeaccessedbyanuser-levelprogramusingthesystemcalls,itshouldbepossiblefortheusertodevelopanewcommand-lineinterpreter.2.8Whatarethetwomodelsofinterprocesscommunication?Whatarethestrengthsandweaknessesofthetwoapproaches?Answer:Thetwomodelsofinterprocesscommunicationaremessage-passingmodelandtheshared-memorymodel.2.9Whyistheseparationofmechanismandpolicydesirable?Answer:Mechanismandpolicymustbeseparatetoensurethatsystemsareeasytomodify.Notwosysteminstallationsarethesame,soeachinstallationmaywanttotunetheoperatingsystemtosuititsneeds.Withmechanismandpolicyseparate,thepolicymaybechangedatwillwhilethemechanismstaysunchanged.Thisarrangementprovidesamoreflexiblesystem.2.10WhydoesJavaprovidetheabilitytocallfromaJavaprogramnativemethodsthatarewrittenin,say,CorC++?Provideanexampleofasituationinwhichanativemethodisuseful.Answer:JavaprogramsareintendedtobeplatformI/Oindependent.Therefore,thelanguagedoesnotprovideaccesstomostspecificsystemresourcessuchasreadingfromI/Odevicesorports.ToperformasystemI/Ospecificoperation,youmustwriteitinalanguagethatsupportssuchfeatures(suchasCorC++.)KeepinmindthataJavaprogramthatcallsanativemethodwritteninanotherlanguagewillnolongerbearchitecture-neutral.2.11Itissometimesdifficulttoachievealayeredapproachiftwocomponentsoftheoperatingsystemaredependentoneachother.Identifyascenarioinwhichitisunclearhowtolayertwosystemcomponentsthatrequiretightcouplingoftheirfunctionalities.Answer:Thevirtualmemorysubsystemandthestoragesubsystemaretypicallytightly-coupledandrequirescarefuldesigninalayeredsystemduetothefollowinginteractions.Manysystemsallowfilestobemappedintothevirtualmemoryspaceofanexecutingprocess.Ontheotherhand,thevirtualmemorysubsystemtypicallyusesthestoragesystemtoprovidethebackingstoreforpagesthatdonotcurrentlyresideinmemory.Also,updatestothefilesystemaresometimesbufferedinphysicalmemorybeforeitisflushedtodisk,therebyrequiringcarefulcoordinationoftheusageofmemorybetweenthevirtualmemorysubsystemandthefilesystem.2.12Whatisthemainadvantageofthemicrokernelapproachtosystemdesign?Howdouserprogramsandsystemservicesinteractinamicrokernelarchitecture?Whatarethedisadvantagesofusingthemicrokernelapproach?Answer:Benefitstypicallyincludethefollowing(a)addinganewservicedoesnotrequiremodifyingthekernel,(b)itismoresecureasmoreoperationsaredoneinusermodethaninkernelmode,and(c)asimplerkerneldesignandfunctionalitytypicallyresultsinamorereliableoperatingsystem.Userprogramsandsystemservicesinteractinamicrokernelarchitecturebyusinginterprocesscommunicationmechanismssuchasmessaging.Thesemessagesareconveyedbytheoperatingsystem.Theprimarydisadvantageofthemicrokernelarchitecturearetheoverheadsassociatedwithinterprocesscommunicationandthefrequentuseoftheoperatingsystem’smessagingfunctionsinordertoenabletheuserprocessandthesystemservicetointeractwitheachother.2.13Inwhatwaysisthemodularkernelapproachsimilartothelayeredapproach?Inwhatwaysdoesitdifferfromthelayeredapproach?Answer:Themodularkernelapproachrequiressubsystemstointeractwitheachotherthroughcarefullyconstructedinterfacesthataretypicallynarrow(intermsofthefunctionalitythatisexposedtoexternalmodules).Thelayeredkernelapproachissimilarinthatrespect.However,thelayeredkernelimposesastrictorderingofsubsystemssuchthatsubsystemsatthelowerlayersarenotallowedtoinvokeoperationscorrespondingtotheupper-layersubsystems.Therearenosuchrestrictionsinthemodular-kernelapproach,whereinmodulesarefreetoinvokeeachotherwithoutanyconstraints.2.14Whatisthemainadvantageforanoperating-systemdesignerofusingavirtual-machinearchitecture?Whatisthemainadvantageforauser?Answer:Thesystemiseasytodebug,andsecurityproblemsareeasytosolve.Virtualmachinesalsoprovideagoodplatformforoperatingsystemresearchsincemanydifferentoperatingsystemsmayrunononephysicalsystem.2.15Whyisajust-in-timecompilerusefulforexecutingJavaprograms?Answer:Javaisaninterpretedlanguage.ThismeansthattheJVMinterpretsthebytecodeinstructionsoneatatime.Typically,mostinterpretedenvironmentsareslowerthanrunningnativebinaries,fortheinterpretationprocessrequiresconvertingeachinstructionintonativemachinecode.Ajust-in-time(JIT)compilercompilesthebytecodeforamethodintonativemachinecodethefirsttimethemethodisencountered.ThismeansthattheJavaprogramisessentiallyrunningasanativeapplication(ofcourse,theconversionprocessoftheJITtakestimeaswellbutnotasmuchasbytecodeinterpretation.)Furthermore,theJITcachescompiledcodesothatitmaybereusedthenexttimethemethodisencountered.AJavaprogramthatisrunbyaJITratherthanatraditionalinterpretertypicallyrunsmuchfaster.2.16WhatistherelationshipbetweenaguestoperatingsystemandahostoperatingsysteminasystemlikeVMware?Whatfactorsneedtobeconsideredinchoosingthehostoperatingsystem?Answer:Aguestoperatingsystemprovidesitsservicesbymappingthemontothefunctionalityprovidedbythehostoperatingsystem.Akeyissuethatneedstobeconsideredinchoosingthehostoperatingsystemiswhetheritissufficientlygeneralintermsofitssystem-callinterfaceinordertobeabletosupportthefunctionalityassociatedwiththeguestoperatingsystem.2.17TheexperimentalSynthesis

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论