




付費下載
下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
本文格式為Word版,下載可任意編輯——操作系統(tǒng)第九版部分課后作業(yè)習(xí)題答案CHAPTER9VirtualMemory
PracticeExercises
9.1Underwhatcircumstancesdopagefaultsoccur?Describetheactionstakenbytheoperatingsystemwhenapagefaultoccurs.Answer:
Apagefaultoccurswhenanaccesstoapagethathasnotbeenbroughtintomainmemorytakesplace.Theoperatingsystemveri?esthememoryaccess,abortingtheprogramifitisinvalid.Ifitisvalid,afreeframeislocatedandI/Oisrequestedtoreadtheneededpageintothefreeframe.UponcompletionofI/O,theprocesstableandpagetableareupdatedandtheinstructionisrestarted.
9.2Assumethatyouhaveareferencestringforaprocesswithmframes(initiallyallempty).Thereferencestringhaslengthp;ndistinctpagenumbersoccurinit.Answerthesequestionsforanyreplacementalgorithms:
a.Whatisalowerboundonthenumberofpagefaults?b.Whatisanupperboundonthenumberofpagefaults?Answer:a.nb.p
9.3ConsiderthepagetableshowninFigure9.30forasystemwith12-bitvirtualandphysicaladdressesandwith256-bytepages.Thelistoffree
pageframesisD,E,F(thatis,Disattheheadofthelist,Eissecond,andFislast).
Convertthefollowingvirtualaddressestotheirequivalentphysicaladdressesinhexadecimal.Allnumbersaregiveninhexadecimal.(Adashforapageframeindicatesthatthepageisnotinmemory.)?9EF?111
2930Chapter9VirtualMemory?700?0FFAnswer:?9EF-0EF?111-211?700-D00?0FF-EFF
9.4Considerthefollowingreplacementalgorithms.Rankthesealgorithmsona?ve-pointscalefrom“bad〞to“perfect〞accordingtotheirfaultrate.SeparatethosealgorithmsthatsufferfromBelady’sanomalyfromthosethatdonot.a.LRUreplacementb.FIFOreplacementc.Optimalreplacement
d.Second-chancereplacementAnswer:
RankAlgorithmSufferfromBelady’sanomaly1Optimalno2LRUno
3Second-chanceyes4FIFOyes
9.5Discussthehardwaresupportrequiredtosupportdemandpaging.Answer:
Foreverymemory-accessoperation,thepagetableneedstobeconsultedtocheckwhetherthecorrespondingpageisresidentornotandwhethertheprogramhasreadorwriteprivilegesforaccessingthepage.Thesecheckshavetobeperformedinhardware.ATLBcouldserveasacacheandimprovetheperformanceofthelookupoperation.
9.6Anoperatingsystemsupportsapagedvirtualmemory,usingacentralprocessorwithacycletimeof1microsecond.Itcostsanadditional1microsecondtoaccessapageotherthanthecurrentone.Pageshave1000words,andthepagingdeviceisadrumthatrotatesat3000revolutionsperminuteandtransfers1millionwordspersecond.Thefollowingstatisticalmeasurementswereobtainedfromthesystem:
?1percentofallinstructionsexecutedaccessedapageotherthanthecurrentpage.
?
Oftheinstructionsthataccessedanotherpage,80percentaccessedapagealreadyinmemory.PracticeExercises31?
Whenanewpagewasrequired,thereplacedpagewasmodi?ed50percentofthetime.
Calculatetheeffectiveinstructiontimeonthissystem,assumingthatthesystemisrunningoneprocessonlyandthattheprocessorisidleduringdrumtransfers.Answer:
effectiveaccesstime=0.99×(1??sec+0.008×(2??sec)+0.002×(10,000??sec+1,000??sec)+0.001×(10,000??sec+1,000??sec)=(0.99+0.016+22.0+11.0)??sec=34.0??sec
9.7Considerthetwo-dimensionalarrayA:intA[][]=newint[100][100];
whereA[0][0]isatlocation200inapagedmemorysystemwithpagesofsize200.Asmallprocessthatmanipulatesthematrixresidesinpage0(locations0to199).Thus,everyinstructionfetchwillbefrompage0.Forthreepageframes,howmanypagefaultsaregeneratedbythefollowingarray-initializationloops,usingLRUreplacementand
assumingthatpageframe1containstheprocessandtheothertwoareinitiallyempty?a.for(intj=0;j<100;j++)for(inti=0;i<100;i++)A[i][j]=0;
b.for(inti=0;i<100;i++)for(intj=0;j<100;j++)A[i][j]=0;Answer:a.5,000b.50
9.8Considerthefollowingpagereferencestring:1,2,3,4,2,1,5,6,2,1,2,3,7,6,3,2,1,2,3,6.
Howmanypagefaultswouldoccurforthefollowingreplacementalgorithms,assumingone,two,three,f
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 城市濕地公園綜合效益評價研究-以XZ濕地公園為例
- 多囊腎的超聲診斷
- 保育員培訓(xùn):衛(wèi)生與消毒
- 闌尾炎的護理診斷與護理措施
- 項目進度管理課件
- 油田開發(fā)項目運營管理方案
- 高效節(jié)能電機項目節(jié)能評估報告
- 2025年水稻缽苗行栽機合作協(xié)議書
- 電網(wǎng)側(cè)獨立儲能示范項目投標(biāo)書(范文模板)
- 西醫(yī)外科治療前列腺增生診療規(guī)范
- 2025年廣西中考語文試題卷(含答案)
- 《安徽省工傷職工停工留薪期分類目錄》
- 北師大版八年級上冊物理(基礎(chǔ)版)(全冊知識點考點梳理、重點題型分類鞏固練習(xí))(家教、補習(xí)、復(fù)習(xí)用)
- 護士延續(xù)注冊體檢表通用
- GB 2762-2022食品安全國家標(biāo)準(zhǔn)食品中污染物限量
- GB/T 31776-2015車用甲醇汽油中甲醇含量檢測方法
- 工程力學(xué)基礎(chǔ)(講義)
- 心電圖報告的書寫規(guī)范化培訓(xùn)課件
- 小學(xué)數(shù)學(xué)西南師大四年級下冊八平均數(shù)小學(xué)數(shù)學(xué)西師版四年級下冊《平均數(shù)》教學(xué)設(shè)計
- 藥物外滲的嚴重后果及處理課件
- 2021年軟件開發(fā)管理流程制度(附全套表格模板及填寫指引)58頁
評論
0/150
提交評論