看板 Grad-ProbAsk 關於我們 聯絡資訊
Virtual address = 32 bits, page size=4k bytes and a page table entry occupies 4 bytes. How many pages should the OS allocate for the page tables of a 12M byte process under the following paging mechanisms? (1) one-level paging (2) 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) 請問這兩題要怎麼算? 題目問有幾個pages,是指page table的entry有幾個嗎? 還是問有幾個page table? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.43.128.44
A4P8T6X9:page table所佔的page個數 12/23 16:13
int5566:(1) 12M/4K = 3K,3K*4/4K=3(pages) 12/23 21:55
int5566:3K是process縮需的page數,4是phy addr佔的的空間,4K是 12/23 21:56
int5566:1個page可以存的資料量 12/23 21:57
int5566:(2)2-level的是切成有1024張1024個phy addr的page table 12/23 21:59
int5566:所以3K個phy addr需要3張page table 12/23 22:00
A4P8T6X9:還要一個level 1唷。 12/23 22:05
int5566:(10+1024*10)*3/8/4K=1 有錯請指正謝謝 12/23 22:07
int5566:上面的2個10分別是第一層的1格跟第二層的1格的大小 12/23 22:10
int5566:oh no 我第二個算法有問題...我再回一篇好了 12/23 22:20