操作系统复习题.docx

上传人:b****5 文档编号:3360797 上传时间:2022-11-22 格式:DOCX 页数:8 大小:36.84KB
下载 相关 举报
操作系统复习题.docx_第1页
第1页 / 共8页
操作系统复习题.docx_第2页
第2页 / 共8页
操作系统复习题.docx_第3页
第3页 / 共8页
操作系统复习题.docx_第4页
第4页 / 共8页
操作系统复习题.docx_第5页
第5页 / 共8页
点击查看更多>>
下载资源
资源描述

操作系统复习题.docx

《操作系统复习题.docx》由会员分享,可在线阅读,更多相关《操作系统复习题.docx(8页珍藏版)》请在冰豆网上搜索。

操作系统复习题.docx

操作系统复习题

1.1Whatarethethreemainpurposesofanoperatingsystem?

1.3Whatisthemainadvantageofmultiprogramming?

1.4Whatarethemaindifferencesbetweenoperatingsystemsformainframecomputersandpersonalcomputers?

1.6Definetheessentialpropertiesofthefollowingtypesofoperatingsystems:

a.Batch

b.Interactive

c.Timesharing

d.Realtime

e.Network

f.Distributed

2.2Howdoesthedistinctionbetweenmonitormodeandusermodefunctionasarudimentary(基本的)formofprotection(security)system?

2.3Whatarethedifferencesbetweenatrapandaninterrupt?

Whatistheuseofeachfunction?

2.4ForwhattypesofoperationsisDMAuseful?

Explainyouranswer.

2.9Givetworeasonswhycachesareuseful.Whatproblemsdotheysolve?

Whatproblemsdotheycause?

Ifacachecanbemadeaslargeasthedeviceforwhichitiscaching(forinstance,acacheaslargeasadisk),whynotmakeitthatlargeandeliminatethedevice?

3.1Whatarethefivemajoractivitiesofanoperatingsysteminregardtoprocessmanagement?

3.2Whatarethethreemajoractivitiesofanoperatingsysteminregardtomemorymanagement?

3.3Whatarethethreemajoractivitiesofanoperatingsysteminregardtosecondary-storagemanagement?

3.4Whatarethefivemajoractivitiesofanoperatingsysteminregardtofilemanagement?

3.5Whatisthepurposeofthecommandinterpreter?

Whyisitusuallyseparatefromthekernel?

3.7Whatisthepurposeofsystemcalls?

3.11Whatisthemainadvantageofthelayeredapproachtosystemdesign?

3.12Whatarethemainadvantagesofthemicrokernelapproachtosystemdesign?

4.2Describethedifferencesamongshort-term,medium-term,andlong-termscheduling.

4.4Describetheactionsakerneltakestocontextswitchbetweenprocesses.

5.1Providetwoprogrammingexamplesofmultithreadinggivingimprovedperformanceoverasingle-threadedsolution.

5.2Providetwoprogrammingexamplesofmultithreadingthatwouldnotimproveperformance

overasingle-threadedsolution.

5.3Whataretwodifferencesbetweenuser-levelthreadsandkernel-levelthreads?

Underwhatcircumstancesisonetypebetterthantheother?

5.6Whatresourcesareusedwhenathreadiscreated?

Howdotheydifferfromthoseusedwhenaprocessiscreated?

6.1ACPUschedulingalgorithmdeterminesanorderfortheexecutionofitsscheduledprocesses.Givennprocessestobescheduledononeprocessor,howmanypossibledifferentschedulesarethere?

Giveaformulaintermsofn.

6.2Definethedifferencebetweenpreemptiveandnonpreemptivescheduling.Statewhystrictnonpreemptiveschedulingisunlikelytobeusedinacomputercenter.

6.3Considerthefollowingsetofprocesses,withthelengthoftheCPU-bursttimegiveninmilliseconds:

ProcessBurstTimePriority

P1103

P211

P323

P414

P552

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

a.DrawfourGanttchartsillustratingtheexecutionoftheseprocessesusingFCFS,SJF,anonpreemptivepriority(asmallerprioritynumberimpliesahigherpriority),andRR(quantum=1)scheduling.

b.Whatistheturnaroundtimeofeachprocessforeachoftheschedulingalgorithmsinparta?

c.Whatisthewaitingtimeofeachprocessforeachoftheschedulingalgorithmsinparta?

d.Whichoftheschedulesinpartaresultsintheminimalaveragewaitingtime(overallprocesses)?

6.4Supposethatthefollowingprocessesarriveforexecutionatthetimesindicated.Eachprocesswillrunthelistedamountoftime.Inansweringthequestions,usenonpreemptiveschedulingandbasealldecisionsontheinformationyouhaveatthetimethedecisionmustbemade.

ProcessArrivalTimeBurstTime

P10.08

P20.44

P31.01

a.WhatistheaverageturnaroundtimefortheseprocesseswiththeFCFSschedulingalgorithm?

b.WhatistheaverageturnaroundtimefortheseprocesseswiththeSJFschedulingalgorithm?

c.TheSJFalgorithmissupposedtoimproveperformance,butnoticethatwechosetorunprocessP1attime0becausewedidnotknowthattwoshorterprocesseswould

arrivesoon.ComputewhattheaverageturnaroundtimewillbeiftheCPUisleftidleforthefirst1unitandthenSJFschedulingisused.RememberthatprocessesP1andP2arewaitingduringthisidletime,sotheirwaitingtimemayincrease.Thisalgorithmcouldbeknownasfuture-knowledgescheduling.

Rememberthatturnaroundtimeisfinishingtimeminusarrivaltime,soyouhavetosubtractthearrivaltimestocomputetheturnaroundtimes.FCFSis11ifyouforgettosubtractarrivaltime.

6.6Whatadvantageisthereinhavingdifferenttime-quantumsizesondifferentlevelsofamultilevelqueueingsystem?

6.10Explainthedifferencesinthedegreetowhichthefollowingschedulingalgorithmsdiscriminateinfavorofshortprocesses:

a.FCFS

b.RR

c.Multilevelfeedbackqueues

8.1Listthreeexamplesofdeadlocksthatarenotrelatedtoacomputer-systemenvironment.

8.2Isitpossibletohaveadeadlockinvolvingonlyonesingleprocess?

Explainyouranswer.

8.8Considerasystemconsistingoffourresourcesofthesametypethataresharedbythreeprocesses,eachofwhichneedsatmosttworesources.Showthatthesystemisdeadlock-free.

8.13Considerthefollowingsnapshotofasystem:

Answerthefollowingquestionsusingthebanker’salgorithm:

a.WhatisthecontentofthematrixNeed?

b.Isthesysteminasafestate?

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

9.2Explainthedifferencebetweeninternalandexternalfragmentation.

9.3Describethefollowingallocationalgorithms:

a.Firstfit

b.Bestfit

c.Worstfit

9.5Givenmemorypartitionsof100K,500K,200K,300K,and600K(inorder),howwouldeachoftheFirst-fit,Best-fit,andWorst-fitalgorithmsplaceprocessesof212K,417K,112K,and426K(inorder)?

Whichalgorithmmakesthemostefficientuseofmemory?

9.7Whyarepagesizesalwayspowersof2?

9.8Consideralogicaladdressspaceofeightpagesof1024wordseach,mappedontoaphysical

memoryof32frames.

a.Howmanybitsarethereinthelogicaladdress?

b.Howmanybitsarethereinthephysicaladdress?

9.10Considerapagingsystemwiththepagetablestoredinmemory.

a.Ifamemoryreferencetakes200nanoseconds,howlongdoesapagedmemoryreferencetake?

b.Ifweaddassociativeregisters,and75percentofallpage-tablereferencesarefoundintheassociativeregisters,whatistheeffectivememoryreferencetime?

(Assumethatfindingapage-tableentryintheassociativeregisterstakeszerotime,iftheentryisthere.)

9.16Considerthefollowingsegmenttable:

Whatarethephysicaladdressesforthefollowinglogicaladdresses?

a.0,430

b.1,10

c.2,500

d.3,400

e.4,112

10.1Underwhatcircumstancesdopagefaultsoccur?

Describetheactionstakenbytheoperating

systemwhenapagefaultoccurs.

10.2Assumeapagereferencestringforaprocesswithmframes(initiallyallempty).Thepagereferencestringhaslengthpwithndistinctpagenumbersoccurringinit.Foranypage-replacementalgorithms,

a.Whatisalowerboundonthenumberofpagefaults?

b.Whatisanupperboundonthenumberofpagefaults?

10.3Acertaincomputerprovidesitsuserswithavirtual-memoryspaceof232bytes.Thecomputerhas218bytesofphysicalmemory.Thevirtualmemoryisimplementedbypaging,andthepagesizeis4096bytes.Auserprocessgeneratesthevirtualaddress11123456.Explainhowthesystemestablishesthecorrespondingphysicallocation.Distinguishbetweensoftwareandhardwareoperations.

10.5Assumewehaveademand-pagedmemory.Thepagetableisheldinregisters.Ittakes8millisecondstoserviceapagefaultifanemptypageisavailableorthereplacedpageis

notmodified,and20millisecondsifthereplacedpageismodified.Memoryaccesstimeis100nanoseconds.Assumethatthepagetobereplacedismodified70percentofthetime.Whatisthemaximumacceptablepage-faultrateforaneffectiveaccesstimeofnomorethan200nanoseconds?

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

10.20Whatisthecauseofthrashing?

Howdoesthesystemdetectthrashing?

Onceitdetectsthrashing,whatcanthesystemdotoeliminatethisproblem?

11.1Considerafilesystemwhereafilecanbedeletedanditsdiskspacereclaimedwhilelinkstothatfilestillexist.Whatproblemsmayoccurifanewfileiscreatedinthesamestorageareaorwiththesameabsolutepathname?

Howcantheseproblemsbeavoided?

11.7Explainthepurposeoftheopenandcloseoperations.

11.9Giveanexampleofanapplicationinwhichdatainafileshouldbeaccessedinthefollowingorder:

a.Sequentially

b.Randomly

11.10Somesystemsprovidefilesharingbymaintainingasinglecopyofafile;othersystemsmaintainseveralcopies,oneforeachoftheuserssharingthefile.Discusstherelativemeritsofeachapproach.

12.5Considerasystemthatsupportsthestrategiesofcontiguous,linked,andindexedallocation.Whatcriteriashouldbeusedindecidingwhichstrategyisbestutilizedforaparticularfile?

12.9Howdocacheshelpimproveperformance?

Whydosystemsnotusemoreorlargercachesiftheyaresouseful?

13.2ConsiderthefollowingI/Oscenariosonasingle-userPC.

a.Amouseusedwithagraphicaluserinterface

b.Atapedriveonamultitaskingoperatingsystem(a

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

当前位置:首页 > 小学教育 > 学科竞赛

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

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