Segmentation
Segment table lookup and limit checks, animated.
Module 4
Session 4.4
Lesson 1 of 1
Segmentation
Variable-sized logical pieces: code, heap, stack. Each has a base and a limit.
Why segments
Programmers think in objects of different sizes and permissions (execute-only code, growable stack). A segment table stores base and limit. Offset ≥ limit is a fault. External fragmentation returns because sizes vary.
Segmentation with paging: the segment table points at a page table. Logical structure plus fixed-size frames. Classic IA-32 picture.
Translate (segment, offset)
| Seg | Name | Base | Limit |
|---|---|---|---|
| 0 | code | 14000 | 2000 |
| 1 | heap | 20000 | 3000 |
| 2 | stack | 28000 | 1000 |