斯坦福大学操作系统期末考试题英文.docx

上传人:b****5 文档编号:6855572 上传时间:2023-01-11 格式:DOCX 页数:8 大小:43.69KB
下载 相关 举报
斯坦福大学操作系统期末考试题英文.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

斯坦福大学操作系统期末考试题英文

FINALEXAM–INTRODUCTIONTOOPERATINGSYSTEMSCSE421

May2,2003(Spring2003)

 

NAME:

_____________________________________________________________

STUDENTNUMBER:

_________-_________

INSTRUCTIONS

Thisisaclosedbookbutyouareallowedtwosheetsofinformationtoreferto.Youhave180minutestocomplete10questions.Pleasewriteneatlyandclearly.Toreceivepartialcredit,youmustshowallworkforyouranswers.Youshouldhave11pagesinthisexambook,someofwhichareblanktoallowroomforyouranswers.

Question

Grade

1

____/20

2

____/20

3

____/10

4

____/14

5

____/20

6

____/16

7

____/10

8

____/10

9

____/10

10

____/10

Total

____/140

RawScore:

___________/140=____________/100

1)[20Points]Deadlock

Considerthefollowingsnapshotofasystem(P=Process,R=Resource):

Available

RA

RB

RC

RD

8

5

9

7

MaximumDemand

RA

RB

RC

RD

P0

3

2

1

4

P1

0

2

5

2

P2

5

1

0

5

P3

1

5

3

0

P4

3

0

3

3

CurrentAllocation

RA

RB

RC

RD

P0

1

0

1

1

P1

0

1

2

1

P2

4

0

0

3

P3

1

2

1

0

P4

1

0

3

0

Answerthefollowingquestionsusingbanker’salgorithm:

a)CalculatetheNeedsmatrix:

Needs

RA

RB

RC

RD

P0

P1

P2

P3

P4

b)Isthesysteminasafestate?

Ifso,showasafeorderinwhichtheprocessescanrun.

c)CanarequestofoneinstanceofRAbyProcessP0begrantedsafelyaccordingtoBanker’salgorithm?

 

2)[20points]LogicalandPhysicalAddressSpaces

TheKiwi™memoryarchitecturedesignteamhasadilemma.Theteamisconsideringseveraldifferentmemoryconfigurationvariationsforanupcomingmachinedesign.Considerthefollowingdesigns(Allmemoryaccessesareintermsofbytes,andallareusingpagingtechniques):

Characteristic

Design1

Design2

Design3

PhysicalMemoryAddressWidth

8bit

16bit

32bit

LogicalAddressWidth

12bit

20bit

24bit

Page/Framesizeinbytes

16bytes

32bytes

64bytes

PageTableType

Single

Single

Double

a)[6points]Foreachdesign,listthemaximumnumberofpageseachprocesscanaccessinlogicaladdressspace.

 

b)[6points]Foreachdesign,listthemaximumnumberofframesinphysicalmemory.

 

c)[6points]Fordesign3,iftheoutermostpagetableholds32entries,howmanybitsareneededinthelogicaladdresstorepresenttheouterpagetable?

Howmanybitsareusedforrepresentingtheoffsetwithinapage?

Howmanybitsareneededinthelogicaladdressinordertorepresenttheinnerpagetable?

 

3)[4+4+2=10points]PageReplacement

Giventhefollowingreferencestring:

021301401234

show

a)Pagefaultsoccurduringtheprocessingofthereferencescheme?

b)Thehitratioisforeachofthefollowingpoliciesinapuredemandpagingsystem?

c)WhatdoyouobservewhenyoumovefromScheme1toScheme2?

Explain.

Scheme1:

FIFOwiththreepagesofmainmemory

Scheme2:

FIFOwithfourpagesofmainmemory

4)[6+4+4=14points]AddressTranslation

Considerasystemwherethevirtualmemorypagesizeis2K(2048bytes),andmainmemoryconsistsof4pageframes.Nowconsideraprocesswhichrequires8pagesofstorage.Atsomepointduringitsexecution,thepagetableisasshownbelow:

Virtualpage

Valid

Physicalpage

0

No

1

No

2

Yes

1

3

No

4

Yes

3

5

No

6

Yes

0

7

Yes

2

1.Listthevirtualaddressrangesforeachvirtualpage.

2.Listthevirtualaddressrangesthatwillresultinapagefault.

3.Givethemainmemory(physical)addressesforeachofthefollowingvirtualaddresses(allnumbersdecimal):

(i)8500,(ii)14000,(iii)5000,(iv)2100.

Policy:

__________________________________

5)[20points]FileSystemImplementation

Supposeafilesystemisconstructedusingblocksof8wordseach.Inthissystem,awordhasalengthof4bytes.Thediskpackusedtoholdthefilesystemconsistsof32blocks.Theinitialblock(block0)containsadirectoryentry.Thedirectoryentrycontainsthefilenameofasinglefileinthisfilesystem,andapointertothefirstI-nodeinblock1.TheI-nodestructureisasfollows(word,value):

0

Permissionword

1

FileSize

2

Directblock

3

Directblock

4

Directblock

5

Directblock

6

Single-indirect

7

Double-indirect

Thefilecontains16wordsofdata:

thefirstdirectindexpointsatblock31,andtheseconddirectindexpointsatblock29.Blocks4,7,10,and15aremarkedbad.Assumethatfreeblocksareallocatedinlogicalorderstartingwithblock0andthatwriteoperationsmodifythefilesystem1blockatatime.

Whatwillthestateofthesystemlooklikeafter100additionalwordsareappendedtothefile(drawablockdiagramshowingthestructureoftheI-nodeandtheblocksthatareallocated)

6)[16points]DiskScheduling

Diskrequestscomeintothediskdriverforcylinders10,22,20,2,40,6,and38,inthatorder.Assumethatthediskhas100cylinders.

Aseektakes6msecpercylindermoved.Computetheaverageseektimefortherequestsequencegivenabovefor

1.First-come,First-served

2.ShortestSeekTimeFirst(SSTF)

3.LOOK(withthedisk-arminitiallymovingtowardshighernumbercylindersfromlowernumbercylinders)

4.C-SCAN

Inallthecases,thearmisinitiallyatcylinder20.

7)[10points]Security:

PublicKeyEncryption

ConsiderthepublickeyencryptiondefinedbytheRSA(Rivest,Shamir,Adelman)scheme.Assumethatthetwostartingprimesarepandqare3and7respectivelyanddeterminethe(nontrivial)privatekeyandpublickeypairsaccordingtotheRSAscheme.

8)[10Points]Networking:

TCP/IP

ThefollowingflowchartshowstheclientandserverportionsofaTCPcommunicationsession.Fillintheemptybubbles/boxeswiththeappropriatesocketsystemcallnames.

CLIENTSERVER

9)[10points]EnduringPrinciplesinSystemDesign

1.Whenasystemgetscomplexindesignwhatisacommonsolutiontomanagethecomplexity?

Giveanexample.

2.Whenyouexperienceincompatibilitiesbetweensystemmodules,howwillyousolvethisproblem?

Giveanexample.

3.Whatisacommondatastructureusedtomanage(theslotsfor)nresources?

Giveanexample.

4.Thedataitemssuchasinodesandfilesaretypicallylocatedinexternalmemorythatissluggishrelativetothelocalmainmemory.Howaretheeffectiveaccesstimesofthesestructuresminimized?

5.Whenatablemaintainingalistofpointersgrowsunmanageablylargehowwillyousolvethisproblemsothat(i)searchtimesofthetableisreasonableand(ii)onlytheregionofinterestinthetableneedtobeinthememory?

10)[10points]NachosOperatingSystems

1.Listthetwomainoperations(methods)thathavethepotentialforresultinginapagefault.

2.Whereistheaddressthatcausedthepagefaultstored?

3.YouincrementedthePCaftereverysystemcallyouimplemented?

Whynotforpagefaultsystemcall?

4.WhatisthepurposeofExec,JoinandExitsystemcalls?

5.Explaintheabovewithanexample.

6.Howwouldyoucontroltheaccesstoasharedresourcebymultiplethreads?

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

当前位置:首页 > 求职职场 > 职业规划

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

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