CS 3733 Operating Systems
Lecture 21 [3/2/98]: Segmentation
Read Section 8.6 of SG
Segmentation
- Segmentation is a two-dimensional scheme: segment number and
offset within a segment.
- Programmer is aware of the segment structure.
- Procedures and data can be separately protected.
- Tables that fluctuate in size can be accommodated.
- Sharing is easy.
Most segmentation is implemented by dividing segments up
into pages and having a page table for each segment.
Multics: See Figure 8-26 for an example of how Multics does it.
Intel 80386:
The Intel 386 uses segmentation with paging (Figure 8-28)
- 16K segments each of 1 billion words.
- LDT = local descriptor table, contains the segments local
to a program.
- GDT = global descriptor table, contains shared and system segments.
- 16 bit selector is loaded into a segment register.
- A 64-bit descriptor is also loaded.
- Conversion of (selector, offset) to physical address:
- Is offset beyond limit (size can be in bytes or pages).
- Page size is 4K.
- 32-bit base + offset gives linear address.
- If paging is disabled, the linear address is physical address.
- If paging is enabled, linear address is mapped onto a physical
address.
- Two-level mapping is used to reduce page table size for small segments.
- Program has a page directory (1024 32-bit entries)
- Has an associative memory to map Dir-Page into physical frame.
- 4 levels of protection (0 most privileged). Can't jump into
the middle of a different level with a call. Must go through a call gate.
Revision Date: 2/27/98