Windows x86 physical memory is 24-bit?

I am reading the new book, Windows Internals 5 about memory management (chapter 9 in Physical Address Extension PAE section). It is mentioned "A 32-bit system represents physical addresses internally with 24 bits" on page 770. I am totally confused, and I think x86 physical memory should be also addressed by 32-bit, and it is why the system is called 32-bit system.

Any ideas what is wrong?


Here are more details about what booting /PAE means from Chapter 7 of the book "Inside Windows 2000," by David Solomon and Mark Russinovich.

All of the Intel x86 family processors since the Pentium Pro include a memory-mapping mode called Physical Address Extension (PAE). With the proper chipset, the PAE mode allows access to up to 64 GB of physical memory. When the x86 executes in PAE mode, the memory management unit (MMU) divides virtual addresses into four fields.

The MMU still implements page directories and page tables, but a third level, the page directory pointer table, exists above them. PAE mode can address more memory than the standard translation mode not because of the extra level of translation but because PDEs and PTEs are 64-bits wide rather than 32-bits. The system represents physical addresses internally with 24 bits, which gives the x86 the ability to support a maximum of 2^(24+12) bytes, or 64 GB, of memory

Edit: As George says So 24 bits of page numbers represents 24+12=36 bits of byte addresses. This is an address extension over the the 32 bit normal space.


I'm reading Physical Address Extension (PAE) chapter in Windows Internals Fourth edition (pages 435-437) and I can't seem to find the reference to 24 bits. There is a reference to 25 bits used for base page address, which means that the addressable space becomes 2 ^ (12 + 25) = 128GB. But we'll come back to it. First lets see how linear address is converted into physical address (and this is perfectly described in the book): the linear address gets split into three pieces:

  • 12 lower bits are offset within the page addressing any byte in 4Kb page;
  • the next 10 bits are index of the record in the page table (PTE), which contains the base address (physical address of the first byte) of the page;
  • the highest 10 bits are index of the record in the page directory table (PDE), which contains the base address for the PTE.

Each item in PTE and PDE contain 32-bit record, 20 bits of which contain the physical address of the page or the next level table, respectively. The other 12 bits are flags describing the page or the table (readable/writable/executable and so on). This is how 80386, x486 and Pentium worked.

Now, Pentium Pro and newer CPUs, when running in PAE mode, use 64-bit wide records in PDE and PTE tables. In these records up to 40 bits can be used to encode the base address of the page in memory. This means that PAE mode can theoretically address 2 ^ 40 pages (1T pages) of 2 ^ 12 (4Kb each). Total theoretical address space is 2 ^ (40 + 12) = 2 ^ 52 = 4Peta bytes. However, operating systems do not use all these 40 bits. For example, Windows only uses 24 of them, which leads to total addressable address space of 2 ^ (24 + 12) = 2 ^ 36 = 64G bytes.

Apparently, different versions (flavors) of Windows use different number of bits in this table, which seems a bit odd. According to the 4th edition of the book in question, 25 bits are used in this case, which brings the addressable space to 128Gb, and it is also confirmed by this page. This is source of the discrepancy between the 4th and 5th edition, mentioned above.

For more detailed explanation of how the translation happens, take a look at page 4-17 and 4-18 (chapter 4.4.2) of Intel 64 and IA32 Architectures Software Developer's Manual

Oh, yeah, and the system is called 32-bit not because it addresses 2^32 bytes. It's because it runs in the mode where internal registers are 32-bit wide (which is not always true anymore, but is close enough to reality). If the addressable space determined the name of the OS, then DOS would have been 20-bit OS, and old Macs would've been 24-bit OS