操作系统英文版课后习题答案整理.doc

上传人:wj 文档编号:491938 上传时间:2023-04-29 格式:DOC 页数:14 大小:1.19MB
下载 相关 举报
操作系统英文版课后习题答案整理.doc_第1页
第1页 / 共14页
操作系统英文版课后习题答案整理.doc_第2页
第2页 / 共14页
操作系统英文版课后习题答案整理.doc_第3页
第3页 / 共14页
操作系统英文版课后习题答案整理.doc_第4页
第4页 / 共14页
操作系统英文版课后习题答案整理.doc_第5页
第5页 / 共14页
操作系统英文版课后习题答案整理.doc_第6页
第6页 / 共14页
操作系统英文版课后习题答案整理.doc_第7页
第7页 / 共14页
操作系统英文版课后习题答案整理.doc_第8页
第8页 / 共14页
操作系统英文版课后习题答案整理.doc_第9页
第9页 / 共14页
操作系统英文版课后习题答案整理.doc_第10页
第10页 / 共14页
操作系统英文版课后习题答案整理.doc_第11页
第11页 / 共14页
操作系统英文版课后习题答案整理.doc_第12页
第12页 / 共14页
操作系统英文版课后习题答案整理.doc_第13页
第13页 / 共14页
操作系统英文版课后习题答案整理.doc_第14页
第14页 / 共14页
亲,该文档总共14页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

操作系统英文版课后习题答案整理.doc

《操作系统英文版课后习题答案整理.doc》由会员分享,可在线阅读,更多相关《操作系统英文版课后习题答案整理.doc(14页珍藏版)》请在冰点文库上搜索。

操作系统英文版课后习题答案整理.doc

14

OSExerciseBook

ClassNo.Name

1.1Whatarethethreemainpurposesofanoperatingsystem?

(1)Interfacebetweenthehardwareanduser;

(2)managetheresourceofhardwareandsoftware;

(3)abstractionofresource;

1.2Listthefourstepsthatarenecessarytorunaprogramonacompletelydedicatedmachine.

Preprocessing>Processing>Linking>Executing.

1.6Definetheessentialpropertiesofthefollowingtypesofoperatingsystems:

a.Batch

b.Interactive

c.Timesharing

d.Realtime

e.Network

f.Distributed

1.7Wehavestressedtheneedforanoperatingsystemtomakeefficientuseofthecomputing

hardware.Whenisitappropriatefortheoperatingsystemtoforsakethisprincipleandto“waste”resources?

Whyissuchasystemnotreallywasteful?

2.2Howdoesthedistinctionbetweenmonitormodeandusermodefunctionasarudimentary

formofprotection(security)system?

2.3Whatarethedifferencesbetweenatrapandaninterrupt?

Whatistheuseofeachfunction?

2.5Whichofthefollowinginstructionsshouldbeprivileged?

a.Setvalueoftimer.

b.Readtheclock.

c.Clearmemory.

d.Turnoffinterrupts.

e.Switchfromusertomonitormode.

2.8Protectingtheoperatingsystemiscrucialtoensuringthatthecomputersystemoperates

correctly.Provisionofthisprotectionisthereasonbehinddual-modeoperation,memory

protection,andthetimer.Toallowmaximumflexibility,however,wewouldalsoliketo

placeminimalconstraintsontheuser.

Thefollowingisalistofoperationsthatarenormallyprotected.Whatistheminimalset

ofinstructionsthatmustbeprotected?

a.Changetousermode.

b.Changetomonitormode.

c.Readfrommonitormemory.

d.Writeintomonitormemory.

e.Fetchaninstructionfrommonitormemory.

f.Turnontimerinterrupt.

g.Turnofftimerinterrupt.

3.6Listfiveservicesprovidedbyanoperatingsystem.Explainhoweachprovidesconveniencetotheusers.Explainalsoinwhichcasesitwouldbeimpossibleforuser-levelprogramstoprovidetheseservices.

3.7Whatisthepurposeofsystemcalls?

3.10Whatisthepurposeofsystemprograms?

4.1MS-DOSprovidednomeansofconcurrentprocessing.Discussthreemajorcomplications

thatconcurrentprocessingaddstoanoperatingsystem.

4.6Thecorrectproducer–consumeralgorithminSection4.4allowsonlyn-1bufferstobe

fullatanyonetime.Modifythealgorithmtoallowallbufferstobeutilizedfully.

5.1Providetwoprogrammingexamplesofmultithreadinggivingimproveperformanceover

asingle-threadedsolution.

5.3Whataretwodifferencesbetweenuser-levelthreadsandkernel-levelthreads?

Underwhatcircumstancesisonetypebetterthantheother?

6.3Considerthefollowingsetofprocesses,withthelengthoftheCPU-bursttimegivenin

milliseconds:

Process Burst TimePriority

P1 10 3

P2 1 1

P3 2 3

P4 1 4

P5 5 2

TheprocessesareassumedtohavearrivedintheorderP1,P2,P3,P4,P5,allattime0.

a.DrawfourGanttchartsillustratingtheexecutionoftheseprocessesusingFCFS,SJF,anonpreemptivepriority(asmallerprioritynumberimpliesahigherpriority),andRR

(quantum=1)scheduling.

b.Whatistheturnaroundtimeofeachprocessforeachoftheschedulingalgorithmsin

parta?

c.Whatisthewaitingtimeofeachprocessforeachoftheschedulingalgorithmsinpart

a?

d.Whichoftheschedulesinpartaresultsintheminimalaveragewaitingtime(overall

processes)?

Answer:

6.4Supposethatthefollowingprocessesarriveforexecutionatthetimesindicated.Each

processwillrunthelistedamountoftime.Inansweringthequestions,usenonpreemptive

schedulingandbasealldecisionsontheinformationyouhaveatthetimethedecision

mustbemade.

a.WhatistheaverageturnaroundtimefortheseprocesseswiththeFCFSscheduling

algorithm?

b.WhatistheaverageturnaroundtimefortheseprocesseswiththeSJFschedulingalgorithm?

c.TheSJFalgorithmissupposedtoimproveperformance,butnoticethatwechoseto

runprocessP1attime0becausewedidnotknowthattwoshorterprocesseswould

arrivesoon.ComputewhattheaverageturnaroundtimewillbeiftheCPUisleft

idleforthefirst1unitandthenSJFschedulingisused.RememberthatprocessesP1

andP2arewaitingduringthisidletime,sotheirwaitingtimemayincrease.This

algorithmcouldbeknownasfuture-knowledgescheduling.

6.10Explainthedifferencesinthedegreetowhichthefollowingschedulingalgorithmsdiscriminateinfavorofshortprocesses:

a.FCFS

b.RR

c.Multilevelfeedbackqueues

7.7Showthat,ifthewaitandsignaloperationsarenotexecutedatomically,

thenmutualexclusionmaybeviolated.

7.8TheSleeping-BarberProblem.Abarbershopconsistsofawaitingroomwithnchairsandthebarberroomcontainingthebarberchair.Iftherearenocustomerstobeserved,thebarbergoestosleep.Ifacustomerentersthebarbershopandallchairsareoccupied,thenthecustomerleavestheshop.Ifthebarberisbusybutchairsareavailable,thenthecustomersitsinoneofthefreechairs.Ifthebarberisasleep,thecustomerwakesupthebarber.Writeaprogramtocoordinatethebarberandthecustomers.

8.2Isitpossibletohaveadeadlockinvolvingonlyonesingleprocess?

Explainyouranswer.

8.4ConsiderthetrafficdeadlockdepictedinFigure8.11.

a.Showthatthefournecessaryconditionsfordeadlockindeedholdinthisexample.

b.Stateasimplerulethatwillavoiddeadlocksinthissystem.

8.13

Considerthefollowingsnapshotofasystem:

Allocation

Max

Available

ABCD

ABCD

ABCD

P0

0012

0012

1520

P1

1000

1750

P2

1354

2356

P3

0632

0652

P4

0014

0656

Answerthefollowingquestionsusingthebanker’salgorithm:

a.WhatisthecontentofthematrixNeed?

b.Isthesysteminasafestate?

c.IfarequestfromprocessP1arrivesfor(0,4,2,0),cantherequestbegrantedimmediately?

9.5Givenmemorypartitionsof100K,500K,200K,300K,and600K(inorder),howwouldeach

oftheFirst-fit,Best-fit,andWorst-fitalgorithmsplaceprocessesof212K,417K,112K,and426K(inorder)?

Whichalgorithmmakesthemostefficientuseofmemory?

9.8Consideralogicaladdressspaceofeightpagesof1024wordseach,mappedontoaphysical

memoryof32frames.

a.Howmanybitsarethereinthelogicaladdress?

b.Howmanybitsarethereinthephysicaladdress?

9.16Considerthefollowingsegmenttable:

Segment Base Length

0 219 600

1 2300 14

2 90 100

3 1327 580

4 1952 96

Whatarethephysicaladdressesforthefollowinglogicaladdresses?

a.0,430

b.1,10

c.2,500

d.3,400

e.4,112

10.2Assumethatyouhaveapagereferencestringforaprocesswithmframes(initiallyallempty).Thepagereferencestringhaslengthpwithndistinctpagenumbersoccurinit.Foranypage-replacementalgorithms,

a.Whatisalowerboundonthenumberofpagefaults?

b.Whatisanupperboundonthenumberofpagefaults?

10.11Considerthefollowingpagereferencestring:

1,2,3,4,2,1,5,6,2,1,2,3,7,6,3,2,1,2,3,6.

Howmanypagefaultswouldoccurforthefollowingreplacementalgorithms,assumingone,two,three,four,five,six,orsevenframes?

Rememberallframesareinitiallyempty,soyourfirstuniquepageswillallcostonefaulteach.

LRUreplacement

FIFOreplacement

Optimalreplacement

11.7Explainthepurposeoftheopenandcloseoperations.

11.9Giveanexampleofanapplicationinwhichdatainafileshouldbeaccessedinthefollowingorder:

a.Sequentially

b.Randomly

11.12Considerasystemthatsupports5000users.Supposethatyouwanttoallow4990oftheseuserstobeabletoaccessonefile.

a.HowwouldyouspecifythisprotectionschemeinUNIX?

b.Couldyousuggestanotherprotectionschemethatcanbeusedmoreeffectivelyfor

thispurposethantheschemeprovidedbyUNIX?

12.1Considerafilecurrentlyconsistingof100blocks.Assumethatthefilecontrolblock(and

theindexblock,inthecaseofindexedallocation)isalreadyinmemory.Calculatehow

manydiskI/Ooperationsarerequiredforcontiguous,linked,andindexed(single-level)

allocationstrategies,if,foroneblock,thefollowingconditionshold.Inthecontiguousallocationcase,assumethatthereisnoroomtogrowinthebeginning,butthereisroomtogrowintheend.Assumethattheblockinformationtobeaddedisstoredinmemory.

a.Theblockisaddedatthebeginning.

b.Theblockisaddedinthemiddle.

c.Theblockisaddedattheend.

d.Theblockisremovedfromthebeginning.

e.Theblockisremovedfromthemiddle.

f.Theblockisremovedfromtheend.

13.2ConsiderthefollowingI/Oscenariosonasingle-userPC.

a.Amouseusedwithagraphicaluserinterface

b.Atapedriveonamultitaskingoperatingsystem(assumenodevicepreallocationis

available)

c.Adiskdrivecontaininguserfiles

d.Agraphicscardwithdirectbusconnection,accessiblethroughmemory-mapped

I/O

ForeachoftheseI/Oscenarios,wouldyoudesigntheoperatingsystemtousebuffering,

spooling,caching,oracombination?

WouldyouusepolledI/O,orinterrupt-drivenI/O?

Givereasonsforyourchoices.

14.2Supposethatadiskdrivehas5000cylinders,numbered0to4999.Thedriveiscurrently

servingarequestatcylinder143,andthepreviousrequestwasatcylinder125.Thequeue

ofpendingrequests,inFIFOorder,is

86,1470,913,1774,948,1509,1022,1750,130

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

当前位置:首页 > 自然科学 > 生物学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2