作者assassin88 (...)
看板Grad-ProbAsk
标题[理工] [OS]-paging 计算
时间Thu Dec 24 00:50:49 2009
Consider the folling hardware configuration. Virtual address 32 bits, page
size 4KBytes, and a page table entry occupies 4Bytes. How many pages should
the OS allocate for the page tables of a 12MByte process under the folling
paging mechanisms?
(1)one-level paging.
(2)two-level paging.(Assume thar the number of entries in a first-level page
table is the same as that in a second-level table)
另外想请问,什麽是N-Step SCAN?
希望各位指导..感谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.57.78.159
1F:推 converse2006:是在问page table需要的数量吗? 如果是的话 12/24 01:30
2F:→ converse2006:one-level只有一张 two-level需要四张 page table 12/24 01:30
3F:→ converse2006:one-level page table entry数量=2^(32-12)=2^20 12/24 01:32
4F:→ converse2006:two-level page table entry数量2^((32-12)/2)=2^10 12/24 01:32
5F:→ converse2006:process所需page数 (12*2^20)/(4*2^10)=3*2^10 12/24 01:34
6F:→ converse2006:故one-level一张就放的下 two-level需要三张+第一层 12/24 01:35
7F:→ converse2006:有错请告知^^" 12/24 01:35
8F:→ converse2006:只听过SCAN/CSCAN Q_Q 12/24 01:36
9F:→ assassin88:答案是3跟4张..我算的你你的和他给的都不同Orz.. 12/24 09:40
10F:推 converse2006:第一个要三张 还蛮妙的..... 两层都才只需要四张 12/25 00:57
11F:推 Jimmy0301:是三张应该没错,因为page size 4kbytes有十二个BITS 12/29 00:45
12F:→ Jimmy0301:为page offsets 则用20bits表示页码则有2^20个 12/29 00:46
13F:→ Jimmy0301:page entry 每个entry 4Bytes所以是4x2^20一张pagetable 12/29 00:47
14F:→ Jimmy0301:大小,再用12MB除以4x2^20就是三了 12/29 00:48