作者jim055006 (好崩潰)
看板Grad-ProbAsk
標題[理工] [OS]paging system
時間Fri Dec 16 23:30:36 2011
(1)
在paging system下
再算page table size時
題目未給page entry size
那再算page entry時,是只要算frame bit就好
還是要加上page bit跟一些有的沒的bit?????
^^^^^^^^^^^^^
像是vaild,dirty等等
-------------------------------------------------------------------------------
(2)
Consider a 32-bit operating system that runs on a machine with 64 MB of
physical
memory. The operating system divides the 32-bit logical address space into
pages. Each page is sized of 4KB. There are 4 methods for translating a
virtual
address to a physical address:
a.one-level page table, b.two-level page table, c.hashed paged table,
and d.inverted page table.
Please calculate the memory space required for a process’s page table in each
method under the following assumptions:
A.each entry in the page table is sized of 4 bytes,
B.in the two-level page table, the outer(first-level) page table has 256
entries
C.in the hashed paged table, the range of the value returned by the hash
function is between 0 and 127.
我所求出來的
logical address 32bit
physical address 26bit
d=12bit p=20bit
for one-level page table: 2^20*4
for two-level page table: (2^8+2^12)*4
first level=8bit
second level=12bit
for hashing page table: 128*4
有128個bucket
for inverted page table: 2^26*4
有2^26個frame
因為我的答案跟解答有些出入非常大
所以想請問大家我這樣寫是對是錯...
-------------------------------------------------------------------------------
(3)
true or false
Memory pages that are shared between two or more processes
can never be swapped out to the disk.
答案是F
為什麼呢???
-------------------------------------------------------------------------------
以上
有請高手甘心解答
鋼溫!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 223.142.237.142
推 liataian:計組題目好像比較會說明要不要加memory mgt的bit OS題目 12/17 00:15
→ liataian:少看到 我算了一下 physical address應該是28 bit才對 12/17 00:16
physical memory不是64MB=2^26??
※ 編輯: jim055006 來自: 223.142.242.2 (12/17 23:55)
推 da0910cc:(3)我覺得應該是因為virtual memoy 12/19 09:55
如果是這樣的話(3)可以說得通
所以是memory page都要看成VM??
※ 編輯: jim055006 來自: 223.140.209.195 (12/19 23:48)