Physical Address Extension

From OSDev.wiki
Revision as of 14:24, 22 December 2009 by osdev>Nedbrek (Initial content)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Physical Address Extension

This article discusses the Physical Address Extension available on many x86 processors. It assumes good understanding of virtual memory (as discussed in Paging). It also discusses features specific to x86, although other architectures could easily have very similar mechanisms.

History

The PAE bit was introduced in the Intel Pentium Pro processor. It was specifically aimed at allowing 32 bit operating systems to make use of more than 4 GB of memory.

How It Works

When the PAE bit is off, each entry in the page table specifies a 32 bit base address into physical memory. When the bit is on, the entry is expanded to allow up to 64 bits (although most processors only support 36 bits of physical memory). This allows a process to be located above the 4 GB boundary, although it can never access more than 4 GB at any time.

Dangers and Pitfalls

32 bit I/O devices (and driver code) will most likely not understand addresses above 4 GB.

This creates a "hole", as some of the address space is set aside for these drivers (see Memory Map (x86)). You may be able to remap DRAM from this region to a space above GB, or the storage may be lost.

There is additional complexity with DMA (how can your 32 bit hard disk driver copy code or data for a process located above 4 GB?).

These difficulties often drive OS developers to work in a flat 64 bit address space.