Intel 64 and IA-32 Architectures Software Developers Manual Volume 3A, System Programming Guide, Part 1
2-8 Vol. 3A
SYSTEM ARCHITECTURE OVERVIEW
2.1.5 Memory Management
System architecture supports either direct physical addressing of memory or virtual
memory (through paging). When physical addressing is used, a linear address is
treated as a physical address. When paging is used: all code, data, stack, and system
segments (including the GDT and IDT) can be paged with only the most recently
accessed pages being held in physical memory.
The location of pages (sometimes called page frames) in physical memory is
contained in two types of system data structures: page directories and page tables.
Both structures reside in physical memory (see Figure 2-1).
The base physical address of the page directory is contained in control register CR3.
An entry in a page directory contains the physical address of the base of a page table,
access rights and memory management information. An entry in a page table
contains the physical address of a page frame, access rights and memory manage-
ment information.
To use this paging mechanism, a linear address is broken into three parts. The parts
provide separate offsets into the page directory, the page table, and the page frame.
A system can have a single page directory or several. For example, each task can
have its own page directory.
2.1.5.1 Memory Management in IA-32e Mode
In IA-32e mode, physical memory pages are managed by a set of system data struc-
tures. In compatibility mode and 64-bit mode, four levels of system data structures
are used. These include:
• The page map level 4 (PML4) — An entry in a PML4 table contains the physical
address of the base of a page directory pointer table, access rights, and memory
management information. The base physical address of the PML4 is stored in
CR3.
• A set of page directory pointers — An entry in a page directory pointer table
contains the physical address of the base of a page directory table, access rights,
and memory management information.
• Sets of page directories — An entry in a page directory table contains the
physical address of the base of a page table, access rights, and memory
management information.
• Sets of page tables — An entry in a page table contains the physical address of
a page frame, access rights, and memory management information.