关于PAE页地址扩展的技术问询:条目大小与地址映射原理
Great question—PAE can feel pretty opaque at first, especially when you're just staring at that classic diagram without context. Let's break this down clearly:
PAE Directory Pointer Entry (Dir.Pointer) Size
Dir.Pointer entries are 64 bits (8 bytes) long—they are not 32 bits. This is a critical distinction from standard 32-bit paging. Each entry stores two core pieces of data:
- The physical base address of a Page Directory (shifted right by 12 bits, since all page structures are 4KB-aligned)
- Control flags (like
present,read/write,user/supervisor, and others that manage page permissions and behavior)
How PAE Maps 32-bit Virtual Addresses to 36-bit Physical Addresses
PAE keeps the 32-bit virtual address space intact (so each process still sees a 4GB virtual range) but extends the physical address space to 36 bits (supporting up to 64GB of RAM). Here's the step-by-step mapping process:
Split the 32-bit virtual address into 4 components:
- Bits 31-30: Index into the Page Directory Pointer Table (PDPT) — selects which Dir.Pointer entry to use
- Bits 29-21: Index into the selected Page Directory — picks a Page Directory Entry (PDE)
- Bits 20-12: Index into the selected Page Table — picks a Page Table Entry (PTE)
- Bits 11-0: Offset within the final physical page
Traverse the table hierarchy:
- Start with the PDPT's physical base address, stored in the
CR3register (in PAE mode, CR3 points to the start of the PDPT, which is 32 bytes aligned since it holds 4 x 8-byte Dir.Pointer entries) - Use the top 2 virtual address bits to fetch the 64-bit Dir.Pointer entry. This entry provides the physical base address of the Page Directory (the upper 24 bits of the entry correspond to physical address bits 35-12, thanks to 4KB alignment)
- Next, use bits 29-21 to index into the Page Directory (each PDE is also 64 bits). This entry gives the physical base address of the Page Table
- Then, use bits 20-12 to index into the Page Table (each PTE is 64 bits). This entry holds the physical base address of the target page
- Finally, add the 12-bit page offset to the physical page base address to get the full 36-bit physical address
- Start with the PDPT's physical base address, stored in the
Key reason this works:
- The extra PDPT layer (with 64-bit Dir.Pointer entries) is what unlocks the extended physical address space—standard 32-bit paging only has two levels, which can't store enough bits for a 36-bit physical address
- All table entries (Dir.Pointer, PDE, PTE) are 64 bits, which gives enough space to store the 24 bits needed for the page base (since 36-12=24) plus all required control flags
内容的提问来源于stack exchange,提问作者Steven
相关产品推荐
相关产品推荐

