Page Table Structures
In traditional 32-bit protected mode, x86 processors use a two-level page translation scheme, where the control register CR3
points to a single 4 kB long page directory divided into 1024 × 4 byte entries that point to 4 kB long page tables, similarly consisting of 1024 × 4 byte entries pointing to 4 KB long pages.
Enabling PAE (by setting bit 5, PAE, of the system register CR4
) causes major changes to this scheme. By default, the size of each page remains as 4 kB. Each entry in the page table and page directory grows to 64 bits (8 bytes) rather than 32 bits – to allow for additional address bits. However, the size of tables does not change, so both table and directory now have only 512 entries. Because this allows only one quarter of the entries of the original scheme, an extra level of hierarchy has been added, so CR3 now points to the Page Directory Pointer Table, a short table which contains pointers to 4 page directories.
The entries in the page directory have an additional flag in bit 7, named PS
(for page size). If the system has set this bit to 1, the page directory entry does not point to a page table, but to a single large 2 MB page (Page Size Extension). The NX bit is another flag in the page directory, in bit 63, to mark pages as no execute. Because the 12 least significant bits of the page table entry's 64 bits are either similar flags or are available for OS-specific data, a maximum of 52 bits are available to address 252 bytes, or 4 petabytes, of physical memory.
Software can identify via the CPUID flag PAE whether a CPU supports PAE mode or not.
On x86-64 processors in native long mode, the address translation scheme uses PAE but adds a fourth table, the 512-entry page-map level 4 table, and extends the page directory pointer table to 512 entries instead of the original 4 entries it has in protected mode. Currently 48 bits of virtual page number are translated, giving a virtual address space of up to 256 TB. In the page table entries, in the original specification, 40 bits of physical page number are implemented.
- Page table structures
-
No PAE, 4 kB pages
-
No PAE, 4 MB pages
-
PAE with 4 kB pages
-
PAE with 2 MB pages
Read more about this topic: Physical Address Extension
Famous quotes containing the words page, table and/or structures:
“They who say that women do not desire the right of suffrage, that they prefer masculine domination to self-government, falsify every page of history, every fact in human experience. It has taken the whole power of the civil and canon law to hold woman in the subordinate position which it is said she willingly accepts.”
—Elizabeth Cady Stanton (18151902)
“For who is greater, the one who is at the table or the one who serves? Is it not the one at the table? But I am among you as one who serves.”
—Bible: New Testament, Luke 22:27.
“The philosopher believes that the value of his philosophy lies in its totality, in its structure: posterity discovers it in the stones with which he built and with which other structures are subsequently built that are frequently betterand so, in the fact that that structure can be demolished and yet still possess value as material.”
—Friedrich Nietzsche (18441900)