next up previous contents index
Next: 10.7.1 base_gdt: default global Up: 10 Kernel Support Library: Previous: 10.6.7 base_stack.h: default kernel

(X86) Base Environment: Segmentation Support

 

Although most modern operating systems use a simple ``flat'' address space model, the x86 enforces a segmentation model which cannot be disabled directly; instead, it must be set up to emulate a flat address space model if that is what the OS desires. The base environment code provides functionality to set up a simple flat-model processor environment suitable for many types of kernels, both ``micro'' and ``macro.'' For example, it provides a default global descriptor table (GDT) containing various flat-model segments for the kernel's use, as well as a default task state segment (TSS).

Furthermore, even though this base environment is often sufficient, the client OS is not limited to using it exactly as provided by default: the client kernel is given the flexibility to tweak various parameters, such as virtual and linear memory layout, as well as the freedom to operate completely outside of the base environment when necessary. For example, although the base environment provides a default TSS, the OS is free to create its own TSS structures and use them when running applications that need special facilities such as v86 mode or I/O ports. Alternatively, the OS could use the default processor data structures only during startup, and switch to its own complete, customized set after initialization.

The base environment code in the OSKit generally assumes that it is running in a simple flat model, in which only one code segment and one data segment are used for all kernel code and data, respectively, and that the code and data segments are synonymous (they each map to the same range of linear addresses). The OS is free to make more exotic uses of segmentation if it so desires, as long as the OSKit code is run in a consistent environment.

XXX diagram of function call tree?

The base segmentation environment provided by the OSKit is described in more detail in the following API sections.




next up previous contents index
Next: 10.7.1 base_gdt: default global Up: 10 Kernel Support Library: Previous: 10.6.7 base_stack.h: default kernel

University of Utah Flux Research Group