Ch20 Multi-level paging
當 memory page 太多的時候,page table 會佔用太多空間,因此我們需要一些輕量化的 page table。而 multi-level paging 可以有效處理我們的問題
Intro
- Page Directory:
- 類似目錄,紀錄那哪些 page table 是存在的
- 關係:VPN –> Page table
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
流程
- 把 VPN 分為 Page Directory Index 與 Page Table Index
- 用 PD Index 搜尋 Page directory 要用哪個 Page table
- 用 PT index 去查對應 PTE
- 從 PTE 取得 PFN + offset → 得到最終實體地址
節省空間
- Page directory 只紀錄「哪些頁表存在」
- 如果某一整頁(1024 個 PTE)都沒用,就不用配置那頁
- Physical memory 只需要存放:
- Page directory
- 有效的 page table