by Froga
How an operating system translates the addresses a program uses into real physical memory, and why pages, page tables and a small hardware cache called the TLB are what make running many programs at once possible. Written for anyone comfortable with basic computer science who wants to know what actually happens underneath a page fault.
A process never touches physical memory directly. Every address it uses is a virtual address, translated into a physical address through a page table the operating system maintains for it. Memory is divided into fixed-size chunks: pages on the virtual side, frames on the physical side, and the page table records which frame currently holds each page. A small hardware cache called the TLB (translation lookaside buffer) stores recently used translations so that most memory accesses can skip a full page table lookup. When a page a process needs is not currently loaded into any frame at all, the hardware raises a page fault, and the operating system loads the page from disk before the instruction can continue.
multiple choice
Ready to test yourself?
Sign up free to answer, score points, and build your streak.