A physical address is the actual hardware location of a byte in main memory or in a device register range, as seen by the memory controller and the system bus. In memory management, it is the end point of address translation: programs work with virtual addresses, and the memory management unit (MMU) converts each one into a physical address before the access reaches RAM.
Operating systems treat physical memory as a finite, shared resource divided into page frames, and they decide which virtual pages occupy which frames. Ordinary applications almost never see physical addresses, but kernel code, device drivers, firmware and hardware such as DMA engines depend on them directly.
How a virtual address becomes a physical address
Every physical address is assembled from two parts: a physical frame number chosen by the kernel and an offset copied from the virtual address. The hardware treats the high bits of the virtual address as an index into the mapping structures and keeps the low bits as they are; for 4 KiB frames, those low bits number twelve, so a byte keeps its position inside the frame.
Recent results are remembered in the translation lookaside buffer (TLB), so most accesses obtain their frame number almost instantly. Only when that cache has no entry does the hardware consult the full mapping hierarchy, which costs noticeably more time per access. Should no valid frame be recorded at all, control passes to the kernel through a page fault, and the kernel either assigns a frame or reports an error to the process.
The following table traces the translation steps and the hardware or software component responsible for each.
| Step | Performed by | Result |
|---|---|---|
| Split the virtual address | MMU hardware | Page number and offset |
| Look up the cached translation | TLB | Frame number on a hit |
| Walk the page table on a miss | MMU or kernel, depending on the architecture | Frame number or fault |
| Handle a missing mapping | Kernel page fault handler | New mapping or error signal |
| Combine frame and offset | MMU hardware | Final physical address |
Physical address space and its width
The physical address space is the full range of addresses the processor can place on its memory bus, and its size depends on the number of physical address bits the CPU implements. This width is often smaller than the virtual address width, and it does not equal the amount of installed RAM.
The table below lists typical widths for common architectures; exact values vary by processor model.
| Architecture | Physical address bits | Maximum addressable space |
|---|---|---|
| 32-bit x86 without PAE | 32 | 4 GiB |
| 32-bit x86 with PAE | 36 | 64 GiB |
| x86-64 desktop processors | 39 to 46 | 512 GiB to 64 TiB |
| x86-64 server processors | 46 to 52 | 64 TiB to 4 PiB |
| ARMv8-A (AArch64) | 40 to 52 | 1 TiB to 4 PiB |
Not every physical address maps to RAM. Large regions are reserved for memory-mapped I/O, firmware tables and device apertures, which is why a 32-bit system with 4 GiB installed often reports only about 3 to 3.5 GiB usable: the remaining addresses belong to graphics memory and PCI devices.
Physical address versus virtual and logical addresses
The physical address is one of several address types that appear in operating system internals, and confusing them causes many driver bugs. The comparison below clarifies their roles.
| Address type | Who uses it | Unique across the system | Translated by |
|---|---|---|---|
| Virtual address | Applications and the kernel | No, each process has its own space | MMU via page tables |
| Logical address | x86 segmented code | No | Segmentation unit, then paging |
| Physical address | Memory controller and system bus | Yes | Not translated further by the CPU |
| Bus or DMA address | Devices performing DMA | Depends on the IOMMU | IOMMU, if present |
The difference between physical and bus addresses matters on systems with an IOMMU. A device may receive an address that the IOMMU translates into a physical address, so drivers must use the operating system DMA API, such as dma_map_single() on Linux, rather than passing raw physical addresses to hardware.
Why physical addresses matter to the operating system
The kernel manages physical memory as an array of page frames, tracked by allocators such as the buddy allocator for contiguous blocks and slab allocators for small kernel objects. Every frame has metadata recording whether it is free, cached, mapped by one or more processes, or pinned for device use.
- Isolation: because processes see only virtual addresses, one process cannot name another process’s physical memory unless the kernel maps it.
- Sharing: two virtual pages in different processes can point to the same physical frame, which enables shared libraries, shared memory and copy-on-write.
- Contiguity: DMA buffers and huge pages require physically contiguous frames, which become scarce as memory fragments over time.
- Locality: on NUMA systems, the physical address determines which memory node and therefore which latency a thread experiences.
Security and debugging considerations
Physical addresses are sensitive information, because knowing them helps attackers mount hardware-level attacks such as Rowhammer, where repeated access to one memory row flips bits in a neighboring row. Since Linux 4.0, the /proc/self/pagemap interface hides physical frame numbers from unprivileged users for this reason.
The table below lists common mistakes involving physical addresses and how practitioners avoid them.
| Mistake | Consequence | Correct approach |
|---|---|---|
| Passing a virtual address to a DMA device | Device writes to the wrong memory | Use the kernel DMA mapping API |
| Assuming contiguous virtual memory is physically contiguous | Corrupted buffers in multi-page transfers | Allocate with a contiguous allocator |
| Caching a physical address of a swappable page | Stale pointer after page migration | Pin the page before use |
| Exposing frame numbers to user space | Easier hardware attacks | Restrict access to privileged users |
Put simply
A physical address is the real street address of a memory cell inside the computer. Programs use nicknames for their memory, much like saying “my office” instead of a full street address.
The processor keeps a directory that converts each nickname into the real address. This lets every program believe it has the building to itself, while the operating system decides who actually sits in which room.
In practice
A developer writes a Linux driver for a network card that copies incoming packets straight into memory using direct memory access. The driver allocates a 64 KiB receive buffer, but the card cannot work with virtual addresses, so the driver asks the kernel DMA API for the matching bus address and programs it into the card’s descriptor ring.
During testing, an early version passed the result of a virtual-to-physical conversion on a buffer from vmalloc(), which is not physically contiguous. Packets larger than 4 KiB corrupted unrelated pages. After switching to dma_alloc_coherent(), which returns a contiguous, device-visible buffer, the card sustained full line rate with no corruption across a 48-hour stress test.