操作系统英文版课后习题答案整理word文档良心出品.docx

上传人:b****5 文档编号:8024337 上传时间:2023-01-28 格式:DOCX 页数:16 大小:110.02KB
下载 相关 举报
操作系统英文版课后习题答案整理word文档良心出品.docx_第1页
第1页 / 共16页
操作系统英文版课后习题答案整理word文档良心出品.docx_第2页
第2页 / 共16页
操作系统英文版课后习题答案整理word文档良心出品.docx_第3页
第3页 / 共16页
操作系统英文版课后习题答案整理word文档良心出品.docx_第4页
第4页 / 共16页
操作系统英文版课后习题答案整理word文档良心出品.docx_第5页
第5页 / 共16页
点击查看更多>>
下载资源
资源描述

操作系统英文版课后习题答案整理word文档良心出品.docx

《操作系统英文版课后习题答案整理word文档良心出品.docx》由会员分享,可在线阅读,更多相关《操作系统英文版课后习题答案整理word文档良心出品.docx(16页珍藏版)》请在冰豆网上搜索。

操作系统英文版课后习题答案整理word文档良心出品.docx

操作系统英文版课后习题答案整理word文档良心出品

l.lWhatarethethreemainpurposesofanoperatingsystem?

⑴Interfacebetweenthehardwareanduser;

(2)managetheresourceofhardwareandsoftware;

(3)abstractionofresource;

Answer:

•Toprovideanenvironmentk>racomputeruserto

•Tb吕lk>cat特the艺t?

parattzresourcesofthecompulerasntededtostrivetheprtjblemgiven*Theallocationptocessshouldbeasfairandefficientaspossible.

•Asact>ntroJpa>gramitservestwomajorfunctions:

(1)supervisionoftheexecutionofuserprogramstopreventerrorsandimproperuseofthecomputer,and

(2)managementofthe«peratit)JIandcontrolof[/Odevices.

1.2Listthefourstepsthatarenecessarytorunaprogramonacompletelydedicatedmachine.Preprocessing>Processing>Linking>Executing.

Answer

乩Reservemachinetime*

b.Manuallyloadprogramintomemory.

c.Loadstartingaddressandbeginexecution.

d.Monitorandcontrolexecutionofprogramfnimct>nsoie.

1.6Definetheessentialpropertiesofthefollowingtypesofoperatingsystems:

a.Batch

b.Interactive

c.Timesharing

d.Realtime

e.Network

f.Distributed

Answer

a”

b.

c.

Batch.Jobswithsimilarneedsarebatchedtogetherandrunthroughthecomputerasagrcupbyanoperatororautomaticjobst^quencer.[咆jrformHrk:

电isincreasedbyatteiTiptingtokeepCPUandI/Odevicesbusv試alltimesthroughoff-line

operation,Kptx?

ling,andmultiprogramming*Batchisgoodforexecutinglargejobsthatnetxlinteraction;itcanbesiubmiltedandpickeduplater

Interactive.ThkinJofmanyshorttransactiorifdwheretheresultsof

thenexttransactionmaybeunpredictable.Responserirneneedstobeshort(seconds]sincetheusersubmilsandw^iihFortheresult.

Timesharing.Thissystemsu&es匚nschedulingandmLiltiprt)grammingtoprtividt*economicalinteractiveofasystem.TheCP匚占w让chemrapidlyfn>nnoneusertoanotherInsteadofhavingajobdefinedbyspooledcardimages^eachprogramre^ds

itsnextcontrolcardfromtheterminal,andoutputisnormallyprintedimmediatelytothescreen.

d.

Realtime.Oftenusvdinadedicatedapplication,tliissystemreadsinformationframsensorsandmustrespondwithinafixedamountoftimetoensurecorrectperformance-

Network.

Distributed.Thissystemdistributescomputationarntmgse¥t?

ralphysicalprtxzesKors,Theprt>cesst>rsdonotsharememoryoracltKk.Instead,eachprixessorhasitst>wnkxzalmemory.Theycommunicatewitheachotherthroughvariouscommunicatitmlines,suchasahigh-speedbusortelephoneline.

Wehavestressedtheneedforanoperatingsystemtomakeefficientuseofthecomputing

1.7

hardware.Whenisitappropriatefortheoperatingsystemtoforsakethisprincipleandtowaste"resources?

Whyissuchasystemnotreallywasteful?

AnswerSingle*usersystemsshtiuIdmaximizeuseofthesystennfortheuser.AGUImight“waste"CPUcy

2.2Howdoesthedistinctionbetweenmonitormodeandusermodefunctionasarudimentaryformofprotection(security)system?

亠■■

Answer;Byestablishingasetofprivilegedinstructionsthatcanbeexecutedonlywheninthemt>niu)rmode,theoperatingsystemisassuredofct^ntrollingtheentiresystematalltimes.

2.3Whatarethedifferencesbetweenatrapandaninterrupt?

Whatistheuseofeachfunction?

AnswerAninterruptisahardware-generatedchange-of-flowwithinthesystem.Aninterrupthandlerissummonedtodealwiththec

turnedtotheinterruptedcontextandinstruction.Atrapisasoftware-generatedinterrup匕AninterruptcanbvusvdtosignalthecoiTipJctk*nofan[/Otoobviatetheneedfnrdu\icypoiling.Atrapcanbeusedtocalloperatingsystemroutinesortocatcharithmeticerrors.

2.5Whichofthefollowinginstructionsshouldbeprivileged?

a.Setvalueoftimer.

b.Readtheclock.

c.Clearmemory.

d.Turnoffinterrupts.

e.Switchfromusertomonitormode.

Answer:

Thefollowinginstructionsshouldbeprivileged:

a.Setvalueoftimer.

b.Clearmemory.

c.Turnoffinterrupta

cLSwitchfromusertomonitormode.

2.8Protectingtheoperatingsystemiscrucialtoensuringthatthecomputersystemoperatescorrectly.Provisionofthisprotectionisthereasonbehinddual-modeoperation,memoryprotection,andthetimer.Toallowmaximumflexibility,however,wewouldalsoliketoplaceminimalconstraintsontheuser.

Thefollowingisalistofoperationsthat

ofinstructionsthatmustbeprotected?

a.Changetousermode.

b.Changetomonitormode.

c.Readfrommonitormemory.

d.Writeintomonitormemory.

e.Fetchaninstructionfrommonitormemory.

f.Turnontimerinterrupt.

g.Turnofftimerinterrupt.

AnswenTheminimalsetofinstructionsthatmustbeprotectedare:

b.

c.

Readfrommonitormemory*

Writeintomonitormemorv.

*

Turnofftimerinterrupt.

3.6Listfiveservicesprovidedbyanoperatingsystem.Explainhoweachprovidesconveniencetotheusers.Explainalsoinwhichcasesitwouldbeimpossibleforuser-level

programstoprovidetheseservices.

Answer:

Programexecution.Theoperatingsystemloadsthecontents(orsections)ofafileintomemoryandbeginsitsexecution.Auser-levelpm呂ramcouldnotbetrustedtoproperlyallocateCPUtime.

I/O'operations.Disks,tapes,seriallines^andotherdevicesmustbecommunicatedwithata\erylowlevel.Theuserneedonlyspecifythedeviceandtheoperationtoperformonit,whilethesystemconvertsthatrequestintodevice-orcontroller-specificcommands.User-levelprogramscannotbetrustedtoonlyaccessdevicestheyshouldhaveaccesstonndtoonlyaccessthemwhentheyartotherwiseunused.

File-systemmanipulation.Therearvmanydetailsinfilecreation,deletion,alkKation,andnamingthatusersshouldnothavetoperform.Blocksofdiskspact?

areusedbyfilesandmustbetracked.Deletingafilerequiresremovingthenamefileinformationandfreeingthe说[locatedbk>cks.[Protectionsmustalsobecheckedtoassureprtiperfileaccess.Userprt^gramscouldneitherensureadherencetctprotectionmethexJsnorbetrustedtoallocateonlyfreeblocksanddeallocateblocksonfiledeletion.

Communications.Messagepassingbetweensystemsrequiresmessagesbeturnedintopacketsofinformation,senttothenetworkcontnUlei;transmittedacrossacommunicationsmedium,andreassembledbythedestinationsystem.Packetorderinganddatacorrectionmusttakeplace.Again,userprogramsmightnotcoordinateaccesstothenetworkdevice,ortheymightreevi^Tpacketsdestinedforotherprocesses.

•Errordetection.Errordetectionoccursatboththehardwareandsofirwarelevels.Atthehardwarele\-el,alldatatransfersmustbeinspectedtoensurethatdatahavenotbeenc(>rruptedintransitAUdataonmediamustbicheckedtobesuretheyhavenotchangedsincetheywerewrittentothemedia.Atthesoftwarelevel,mediamustbecheckedfordataconsistency;forinstance,dothenumberofallt>catedandunallocatedblocksofstoragematchthetotalnumberonthedevice.There,errorsarefrequentlyprexzess-independent(forinstance,thecorruptionofdataonadisk),sotheremustbeaglobalprogram(ttiEoperatingsystem)thathandlesalltype吕oferrors.Also,byhavingerrorsprocessedbytheoperatingsystem,processesneednotcontaincodetocatchandcorrectallthEerrorspossibleonasystEm.

3.7Whatisthepurposeofsystemcalls?

AnswerSystemualls(j1U>wuser-lewlliirequesticesuftl咤uperdtingsv;»-

tem.

3.10Whatisthepurposeofsystemprograms?

jVnswcr:

Evstemprogramscanbethoughtofbundlcz^ufusefulsystctuoils.Tbev

providebasicfuncticrahtytousersandsousersdenotneedtowritetheirownprogramstosol、忙commonproblems.

4.1MS-DOSprovidednomeansofconcurrentprocessing.Discussthreemajorcomplicationsthatconcurrentprocessingaddstoanoperatingsystem.

Answer:

Amethodoftimesharingmustbeimplementedtoalloweachofseveralprocessestohaveaccesstothesysten'i.ThismethodinxoJvcsthepromptionofprocessesthatdonotvoluntarilygiA-euptheCPU(byusingasystemcal],forinstance)

Processesandsystemresourcesmusthaveprotectionsandmustbeprciteck?

dfrtiTneachotherAnygivenprocessmustbelimitedintheamountofmemoryitcanuseandtheoperationsitcanperformondeviceslikedisks.

Thecorrectproducer—consumeralgorithminSection4.4allowsonlyn-1bufferstobe

Caremustbetakeninthekerneltopre\entdeadkxzksbetweenprocesse鬲soprcicessesaren'twaitingforeachother'sallcxatedrest>urces.

4.6

fullatanyonetime.Modifythealgorithmtoallowallbufferstobeutilizedfully.

AnswerNoanswer.

5.1Providetwoprogrammingexamplesofmultithreadinggivingimproveperformaneeover

asingle-threadedsolution.

Answer

(1)Aserverthatserviceseachrequestinaseparatethread.

(2)Aparal*lelizedapplicationsuchasmatrixmultiplicationwheredifferentpartsofthematrixmaybeworkedoninparallel.(3)AninteractiveGUIprogramsuchasadibuggerwhereathreadisusedtomonitoruserinput,anotherthreadrepresentstherunningflppHcation,andathirdthreadmonitorsperformance.

5.3Whataretwodifferencesbetweenuser-levelthreadsandkernel-levelthreads?

Under

whatcircumstancesisonetypebetterthantheother?

r■

AnswerContextswitchingbetweenusertlireadsisquitesimilartGswitchingbetweenkernelthreads,althoughitis

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 总结汇报 > 学习总结

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1