How can a 32-bit machine support greater than 4GB RAM? The virtual memory that can be addressed with 32-bit is 2^32 with all indirections (page table/page directories, etc.) How is this done?

有帮助吗?

解决方案

32-bit machines with more than 4GB of physical memory still can only address 4GB worth of virtual memory (pointers remain 32 bits). Remember, however, that each process has its own set of page tables, so it's possible for each process to have a mapping of a different portion of physical memory - the total physical memory addressed by all processes can be larger than 4GB.

In the specific case of x86 PAE (Physical Address Extensions), putting the processor in PAE mode changes the structure of the page tables. Instead of two-level page table scheme with 4-byte page table entries, it uses a three-level page table scheme with 8-byte page table entries. Pages are still 4KB each, but their physical base address (stored in the page table entry) is now 64 bits.

In PAE mode, the 32-bit linear ("virtual") address is broken into 4 parts. From the most significant bits to least significant, the first 2 bits are used as an index into the 4-entry page directory pointer table. The entries in this table are 8 bytes each, with each containing a 64-bit physical base address for a page directory. The next 9 bits of the virtual address are used as an index into the page directory, and again the entries in this table contain a 64-bit physical base address for a page table. The next 9 bits of the virtual address are used as an index into the page table, with each page table entry containing a 64-bit physical base address for a page frame. The 12 least significant bits of the virtual address are used as the byte offset within the page frame.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top