作者che96153 (Huazhiwan)
看板Grad-ProbAsk
标题[理工] [计组]张凡计组下 p69
时间Tue Oct 11 18:17:33 2022
求解 看了半天不知道怎麽算
Consider a machine with 32-bit virtual address,32bit physical addresses,
and a 4KB page size.Consider a two-level page table system where each
table occupies one full page.Assume each page table entry is 32 bits long.
To map the full virtual address space,how much memory will be used by the
page table?
answer:The number of entries in the page table = 4KB/4B = 1024
Amount of memory used = 4KB+1024*(4KB) = 4.1MB
为什麽number of entries 不是VPN => 2^32/2^11,然後page table用了多少memory是要
怎麽看?
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.134.240.203 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Grad-ProbAsk/M.1665483455.A.F6D.html
1F:推 takanano0528: 「Assume each page table entry is 32 bit long」 10/12 00:55
2F:→ takanano0528: 这边就告诉你,Table有多少entry(我自己会想成Pag 10/12 00:55
3F:→ takanano0528: e的宽) 10/12 00:55
4F:→ takanano0528: 因为这个是属於多层分页表,你看到two level那边应 10/12 00:59
5F:→ takanano0528: 该可以意会。每个Level的Page Table number都会对 10/12 00:59
6F:→ takanano0528: 应到下层的page。所以只要找出一个page有多少Table 10/12 00:59
7F:→ takanano0528: ,跟一个page的容量多大,就可以算出memory大小 10/12 00:59
8F:→ che96153: 刚刚才知道page size/entry bits = number of entries 10/12 12:34
9F:→ che96153: 谢谢t大,这样我就理解了 10/12 12:35
10F:推 k12795: 刚看到课程 这题老师说课本上有点小错 答案是(0.001+1)*4 10/13 13:50
11F:→ k12795: KB=4.004MB 10/13 13:50
12F:→ k12795: 括号那边是(0.001+1)K 少打单位 10/13 13:52