操作系統(tǒng)課后題答案_第1頁
操作系統(tǒng)課后題答案_第2頁
操作系統(tǒng)課后題答案_第3頁
操作系統(tǒng)課后題答案_第4頁
操作系統(tǒng)課后題答案_第5頁
已閱讀5頁,還剩94頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論