Memory segmentation divides a program's memory into logical sections called segments. This lesson introduces how a segmented address works and how hardware uses segment information to protect memory.
A segment is a logical portion of memory, often corresponding to a natural division of a program. Examples include an individual routine, a data table, a program module, or a class of memory use such as code or data. Unlike pages, segments are generally meaningful to programmers and need not all have the same size.
All flashcards
What is memory segmentation?
A memory-management technique that organizes memory into logical sections, such as routines, data, or modules.
What are the two parts of a segmented address?
A segment identifier selects the segment, and an offset identifies a position within it.
What does the MMU do for a segmented reference?
It translates the reference and checks that the access is within bounds and allowed by the segment's permissions.
What information is commonly associated with a segment?
Its length, permissions, and information needed to locate or translate it; virtual-memory systems may also track whether it is present in main memory.
What can happen when a reference violates a segment rule?
The hardware can raise an exception, such as a segmentation fault for an invalid or prohibited access, or a segment-not-present exception when the segment is absent from memory.
Quiz questions
In segmentation without paging, what placement requirement applies to a segment in main memory?Answer: The segment must occupy one contiguous region.
With segmentation and paging, how can a segment's pages be placed in main memory?Answer: They can be placed in separate, noncontiguous locations.
What is external fragmentation in a system that allocates contiguous segments?Answer: Free memory exists in separate gaps, but no gap is large enough for a requested segment.
What information did the Burroughs B5000 Program Reference Table maintain about segments?Answer: Whether a segment was in main memory, along with information such as its base address and size.
In x86-64 long mode, which segment registers can still have nonzero base values?Answer: FS and GS.