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

上传人:b****1 文档编号:152874 上传时间:2022-10-04 格式: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

《操作系统英文版课后习题答案整理.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.

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

当前位置:首页 > 党团工作 > 党团建设

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

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