级操作系统精彩试题.docx
- 文档编号:4452358
- 上传时间:2022-12-01
- 格式:DOCX
- 页数:13
- 大小:28.59KB
级操作系统精彩试题.docx
《级操作系统精彩试题.docx》由会员分享,可在线阅读,更多相关《级操作系统精彩试题.docx(13页珍藏版)》请在冰豆网上搜索。
级操作系统精彩试题
OperatingSystemExam(ForGrade2000)
ClassNameStudentID
一、Foreachofthefollowingstatements,ChoosingTrueorFalse(24marks)
1.Binarysemaphoresarethosethatareusedbynomorethantwothreads.
2.TheBanker'salgorithmisawayofpreventingdeadlock.
3.Amulti-levelindexedfilepermitsfasterrandomaccessthanacontiguouslyallocatedfile.
4.Anatomicoperationisamachineinstructionorasequenceofinstructionsthatmustbeexecutedtocompletionwithoutinterruption.
5.Deadlockisasituationinwhichtwoormoreprocesses(orthreads)arewaitingforaneventthatwilloccurinthefuture.
6.Starvationisasituationinwhichaprocessisdeniedaccesstoaresourcebecauseofthecompetitiveactivityofother,possiblyunrelated,processes.
7.Whileaprocessisblockedonasemaphore'squeue,itisengagedinbusywaiting.
8.Mutualexclusioncanbeenforcedwithageneralsemaphorewhoseinitialvalueisgreaterthan1.
9.Externalfragmentationcanbeprevented(almostcompletely)byfrequentuseofcompaction,butthecostwouldbetoohighformostsystems.
10.Apageframeisaportionofmainmemory.
11.Theworkingsetofaprocesscanbechangedinresponsetoactionsbyotherprocesses.
12.Thrashingwillneverbeaproblemifthesystemhas1GBofrealmemory.
13.Aprinterisanexampleofalogicalresource.
14.VersionsofOS/360arestillwidelyusedtoday.
15.Whenanexecutingprocessisstoppedbythescheduler,itissaidtobeblocked.
16.InterruptsareusedtoachieveatypicaltimesharingOS.
1.二进制信号量是指那些不能超过两个线程使用。
2.银行家算法是防止死锁的方法。
3.多层次的索引的文件允许快速比连续分配的文件的随机访问。
4.一个原子操作是一个机器指令或必须完成而不会中断执行的指令序列。
5.死锁是其中两个或多个进程(或线程)等将来会发生的事件的情况。
6.饥饿是在其中一个过程被拒绝对资源的访问由于其他,可能不相关的过程的竞争活动的情况。
7.虽然过程被阻止的信号量的队列,它正在忙着等待中。
8与一般的信号量,其初始的值大于1,可以强制执行.相互排斥。
9.外部碎片可以(几乎全部)因频繁使用的压缩,但成本会太高了,大多数系统。
10.页面框架是主存的一部分。
11.一个进程的工作集可以被其他进程更改响应操作。
12如果系统具有1GB的实际存.大个子决不会有问题。
13.打印机是逻辑资源的示例。
14.版本的OS/360今天仍在被广泛使用。
15.当调度程序停止时正在执行的进程,据说被阻止。
16.中断用于实现典型的分时操作系统。
二、MultipleChoiceQuestions(30marks)
Foreachofthefollowingquestions,Thereisonlyonecorrectanswer.
1.Whatisthepurposeofsystemcalls?
a)Systemcallsallowuser-levelprocessestogainresourcesfromtheoperatingsystem.
b)Systemcallsarethestandardinterfacebetweenauserprocessandakernelprocess.
c)Systemcallsallowuser-levelprocessestorequestservicesoftheoperatingsystem.
d)Thereisnorealpurposetosystemcalls.
2.Threadsbelongingtothesameprocesssharethe
a)stackb)datasection
c)registersetd)threadID
3.InMany-to-Onethreadmodel,Whatwouldhappenifathreadinamultithreadedprocessmakesablockingsystemcall?
a)theotherthreadsoftheprocesswouldcontinuetorun
b)theentireprocesswouldgetblocked
c)theblockingthreadwillgetkilled
d)theblockingthreadwillnevergettorunagain
4.WhichofthefollowingOperatingsystemsusespreemptivescheduling?
a)MacOS8b)Windows3.x
c)Windows2000d)DOS6.0
5.Ameasureofthenumberofprocessescompletedpertimeunitiscalled
a)throughputb)waitingtime
c)responsetimed)CPUutilization
6.Oneoftheproblemswithpriorityschedulingis
a)agingb)starvation
c)processdeathd)averagewaitingtime
7.Considerthefollowingreferencestrings
I:
{0,2,4,1,1,4,5,7};II:
{2,3,2,5,6,3,2,6}
IftheFIFOpagereplacementalgorithmwith3framesisapplied,whichofthetworeferencestringswillresultinfewerpagefaults?
a)referencestringIb)referencestringII
c)bothwillhavethesamenumberoffaultsd)can’tdeterminefromthegivendata.
8.Inatime-sharingsystem,whichofthefollowingisthebestcriterionforCPUscheduling.
a)MinimizeCPUutilizationb)MaximizeCPUutilization
c)Maximizesystemthroughputd)Minimizeresponsetime.
9.TheinitialvalueofsemaphoreSis2.ifthevalueis-1atpresent,howmanyprocessesareblockedonthissemaphore.
a)1b)2c)3d)4
10.Asystemisinadeadlock,ifitsresourceallocationgraph
a)containsacycle
b)doesn’tcontainacycle
c)containsacycleandthereisjustoneinstanceofeveryresource
d)hasatleastoneoutgoingedgefromanyoneoftheprocessnodes
11.Preemptionofresourcescanbeenforcedtopreventoccurrenceofdeadlocks,butthiscan’tbeappliedtoalltheresourcetypes,aspreemptionmightleavetheresourceinanundeterminedstate.Whichofthefollowingresourcescan’thencebepreempted?
a)CPUregistersb)memoryspace
c)tapedrived)alloftheabove
12.Inthepagereplacementschemeareferencestringis
a)thenumberofframesallocatedtoaprocessb)astringofmemoryreferences
c)astringofI/Oreferencesd)thetimesspentoneachpage-faultservice
13.Whichdiskspaceallocationmethodsupportsdirectaccesswithoutexternalfragmentation?
a)linearb)contiguous
c)linkedd)indexed
14.Asystemissaidtobe___________ifitcancontinuetofunctionevenwhenanodeornodesinthesystemfail.
a)networkedb)distributed
c)realtimed)fault-tolerant
15.Consideringasystem,whichusesvirtualmemory.Atwhatpointcanaddressbindingbedone?
a)compiletimeb)loadtime
c)executiontimed)canbeanyoftheabove
16.WhichofthefollowingisNOTassociatedwithsegments?
a)twodimensionalviewofmemoryb)fixedsize
c)easysharingofdataorcoded)externalfragmentation
17.Pagescanbesharedbetweenprocesseshavingcommonreentrantcode.Herereentrantcodemeans
a)self-modifyingcode
b)codewhichkeepsgoinginandoutofmemory
c)non-self-modifyingcode
d)codecontainingshareddatavariables
18.Thetimetopositiontheheadonthediskisthe
a)seektime.b)accesstime.
c)transmissiontimed)rotationallatency
19._____________presentsauniformdevice-accessinterfacetotheI/Osubsystem,muchassystemcallsprovideastandardinterfacebetweentheapplicationandtheoperatingsystem.
a)Kernelb)Asetofdevicedrivers
c)Busd)Operatingsystem
20.Whatisthenameofthetablecontaininginformationaboutallopenfiles?
a)fileallocationtableb)open-filetable
c)filetabled)fileaccesstable
三、Considerthefollowingsetofprocesses:
(10marks)
ProcessBurst-TimePriority
P1154
P238
P375
P452
P516
P626
TheprocessesareassumedtohavearrivedintheorderP1,P2,P3,P4,P5,P6,allattime0.UseFCFS,SJF,RoundRobin(quantumis2),Priority(lownumbershavehighpriority).Foreachofthealgorithms:
1DrawaGanttchart
2.Whatistheaveragewaitingtimeforeachoftheschedulingalgorithms?
3.Whatistheaverageturnaroundtimeforeachoftheschedulingalgorithms?
四、Consideracomputersystemwiththefollowinghardwarecharacteristics.(12marks)
Mainmemorysize=16Mbyte
Mainmemoryaccesstime=100nS
Averagedisktransferspeed=1Mbyte/sec
Averagediskseekpluslatencytime=20mS
Smallestaddressableunit=4bytes(i.e.1word)
1.ConsideranoperatingsystemA,whichisusingcontiguousmemoryallocationscheme.Assumingtheentireprocess,P1(3Mbyte),iscurrentlyinmemory,
(1)Attimet1,P1istobeswappedoutofmemory,whatisthetimerequiredtorolloutP1tothedisk?
(2)Attimet2,shortlyaftert1,anewprocess,P5,ofsize4Mbyte,arrived.Giventhesnapshotofthememoryallocationattimet1,showninfigure1.CanP5berolledin?
0M
OS2M
P1
5M
P2
7M
P3
11M
P4
15M
16M
Figure1.ProcessPartitionMap
2.ConsideragainanotheroperatingsystemB,whichisusingabasicpagingsystem(withoutusingdemandpaging)withalogicaladdressspaceof4,096Kbyteandpagesizeof256Kbyte(or65536words,notingthatthesmallestaddressableunitisaword).
(1)Howmanyframesarethereinthesystem?
(2)Showtheformatofthelogicaladdress(i.e.Howmanybitsforpagenumber?
Howmanybitsforpageoffsetetc.).
(3)Ifatranslationlook-asidebuffer(associativeregister)withanaverageaccesstimeof20nSisavailable/implementedinthehardware,assumingahitrationof90%,whatistheeffectivememoryaccesstimenow?
(4)Shortlyaftert1,whereallpagesbelongingtoP1haveswappedout,anewprocess,P5,ofsize4Mbyte,arrived.Again,referringtothesnapshotofthememoryallocationattimet1,showninfigure1.CanP5berolledin?
五、TherearethreecooperativeprocessesP1,P2,andP3.Theyreaddata,denotedasa、bandc,fromthesameinputdevice,asshowninfigurebelow.Theinputdeviceisanexclusiveaccessdevice.Thefirstdatum(a)mustbereadbyprocessP1,theseconddatum(b)isreadbyprocessP2,andthethirddatum(c)byprocessP3.Thesethreeprocessesperformthefollowingcalculations:
P1:
x=a+b
P2:
y=a*b
P3:
z=y+c-a
P1,whichislinkedtotheprinter,shouldprinttheresultsofx,y,andz.Writethepseudocodeforthethreeprocesses,usingsemaphorestosynchronizetheiractivities.(12marks)
六、Considerafilesystem,thereisafileofsize20MB.Foreachofthefiveallocationstrategies:
contiguousallocation,linkedallocation,index-linkedallocation(linkedscheme),two-levelindexedallocationandcombinedschemeallocation(linux).assumethatthesystemblocksizeis4KB,theblockpointeris32bits.answerthesequestions:
1.Whatismaximum
filesizesupportedbyeachoftheallocationstrategies?
2.AssumeFileControlBlockisalreadyinmainmemory.CalculatehowmanydiskI/Ooperationsarerequiredtoaccessthebyteinposition16M+5.5Kforeachoftheallocationstrategies。
(12marks)
PARTIILabExam
一、Selectthecorrectanswerforthequestions(20marks)
1.Whichsystemcallcreatesanewprocess:
a)forkb)exec
c)
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 操作系统 精彩 试题
![提示](https://static.bdocx.com/images/bang_tan.gif)