Skip to content
BIASED

Virtual memory

Block 1 of 4~2 min

Why virtual memory

Caches used physical addresses. RARS maps every program’s data at 0x10010000 — if those were physical, two programs could not coexist, any pointer could smash another process or the OS, size was capped by DRAM, and free memory fragmented into holes too small for a contiguous request. Virtual memory puts a translation between the addresses a program uses (VA) and those memory sees (PA).

Notation. Pages of 2p2^p bytes (p=12p=12 → 4 KiB). VA = VPN + offset; PA = PPN + same offset. A PTE holds a PPN and permission bits (V,R,W,X,U,A,DV,R,W,X,U,A,D).

Key idea. Divide both spaces into equal pages; keep per-process a table mapping each VPN to a frame or marking it absent. Hardware translates every access through the current table. Three wins: isolation (unmapped frames do not exist for the process; R/W/X/UR/W/X/U gate the rest), a large private layout from 0 (physical frames need not be contiguous; unused pages can live on disk), and sharing (same frame in several tables — libraries, COW after fork, mmap). Atlas (Kilburn et al., 1962) already presented DRAM and drum as one paged store.

Answers are saved on the server and tied to this browser until you sign in.