[理工] [計組]關於virtual memory

看板Grad-ProbAsk作者 (白目小子)時間15年前 (2011/02/11 19:05), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
consider the following hardware configuration . virtual address=32bit, page size=4kbytes, and a page table entry occupies 4 bytes. how many pages should the os allocate for the pages tables of a 12mbyte process under the following paging mechanisms? a. one level paging b. two level paging.(assuming that the number of entries in a first-level page table is the same as that in a second-level page table) page size=4KB 每個page entry的資料=4byte a. 12M/4K = 3K(全部所需page entry數) 3K*4byte(page總容量) 3K*4/4K=3 # b. page offset=page bit數=12bit(因為4K=2^12) page number=32-12=20 因L1=L2,所以L1 page num=10,L2 page num=10。 即page entry數=2^10=1K 12M/4K = 3K 3K/1K=3(L2 page table) 然後需用到1個L1的page table去查詢L2的table 所以總page數=3(L2)+1(L1)=4 # 上面是答案 = = 到底page是要算什麼阿? entry 和page 不一樣嗎? 還有b答案的最後不是算page table數目嗎? 不懂???? 不知哪那大大可以解決疑惑 感恩!! orz.. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.227.138.253 ※ 編輯: happykeny 來自: 61.227.138.253 (02/11 19:17)

02/11 19:37, , 1F
這題是問說page table 要幾個page來保存
02/11 19:37, 1F
文章代碼(AID): #1DLHVu0v (Grad-ProbAsk)