• ↑↓ to navigate
  • ↵ to open
  • ⟶ to select
  • ⌘ ⌥ ↵ to open in a panel
  • ←→ to navigate
  • esc to dismiss
⌘ '
keyboard shortcuts

The Problem

Paging uses fixed-size pages, which don’t match program structure (code, data, stack are different logical units). We need variable-size chunks that match program semantics.

Core Idea

Segmentation divides memory into variable-size logical units (segments) like code, data, stack, each with a segment table mapping to physical memory.

How It Works

  1. Program divided into segments (code, data, stack, heap)
  2. Each segment has: base address, limit (size)
  3. Segment table maps segment number → (base, limit)
  4. Address = segment number + offset within segment
  5. Hardware checks offset < limit (protection)
seg SegTable Segment Table Seg0: base=1000, limit=500 Seg1: base=1500, limit=300 Segs Segments Code, Data, Stack, Heap SegTable->Segs maps to

Key Properties

  • Variable-size segments (no internal fragmentation)
  • Matches program structure (logical units)
  • External fragmentation (gaps between segments)
  • Easier sharing (share entire segment)

Semantic Network

semantic_Segmentation THIS Segmentation REL1 Related Concept THIS--REL1 related REL2 Builds Into THIS--REL2 builds into

Connections

Edge Cases & Gotchas

  • External fragmentation: gaps between segments
  • Segment table overhead per process
  • Segment bounds checking required (hardware)