Segmentation Review

Typically, the kernel uses only a few GDT entries: some for the hardware's data structures (e.g., Task State Segment), and others for the OS to use. For example, the kernel may use only two segment descriptors, one for the user's address space (USEGMENT), and another for the kernel's address space (KSEGMENT). The contents of the KSEGMENT descriptor remain constant throughout the execution of the system, as the kernel does not change its own location. The contents of the USEGMENT descriptor are overwritten on every context switch, and loaded with the base and limit values of the current process.

Caching of Segment Descriptors

A segment descriptor is cached on the CPU (on chip) each time a segment register is loaded. Thus the logic to translate a virtual address (VA) through segmentation does not require a memory access.

Address translation and sharing using page tables

Why do we care about x86 address translation?

Why aren't protected-mode segments enough?

Translation using page tables (on x86):