Operating Systems chapters
  1. 01OS Structures & System Calls
  2. 02Process & Thread Management
  3. 03CPU Scheduling Algorithms
  4. 04Process Synchronization & Deadlocks
  5. 05Memory Management & Virtual Memory

Chapter 5 · OS

Memory Management & Virtual Memory

4 topics in 2 parts

Key ideas

Logical Address (CPU) Page (p) Offset (d) PAGE TABLE Page 0 ➜ Frame 3 Page 1 ➜ Frame 7 Page 2 ➜ Frame 1 Page 3 ➜ Frame 5 Physical RAM (DRAM) Frame (f) Offset (d)
Memory Management & Virtual Memory
Kernel DimensionUser Space PerspectiveKernel Space Perspective
Privilege LevelRing 3 (Restricted instruction set)Ring 0 (Full hardware & MMU access)
Context Switch CostZero (stays in thread context)High (TLB flush, register save to PCB/trapframe)
Memory IsolationIsolated Virtual Address SpaceDirect access to physical DRAM & page tables
Failure ImpactProcess segmentation fault (isolated termination)Kernel panic / BSOD (system crash)

All 4 topics in Memory Management & Virtual Memory

  1. Memory

    • Logical vs Physical Memory
    • Paging & TLB Architecture
  2. Virtual Memory

    • Page Replacement (LRU, FIFO)
    • Thrashing & Working Set