next up previous contents index
Next: 10.1.3 Road Map Up: 10.1 Introduction Previous: 10.1.1 Machine-dependence of code

10.1.2 Generic versus Base Environment code

The functionality provided by the kernel support library is divided into two main classes: the generic support code, and the base environment. The generic support contains simple routines and definitions that are almost completely independent of the particular OS environment in which they are used: for example, the generic support includes symbolic definitions for bits in processor registers and page tables, C wrapper functions to access special-purpose processor registers, etc. The generic support code should be usable in any OS that needs it.

The base environment code, on the other hand, is somewhat less generic in that it is designed to create, and function in, a well-defined default or ``base'' kernel execution environment. Out of necessity, this code makes more assumptions about how it is used, and therefore it is more likely that parts of it will not be usable to a particular client OS. For example, on the x86 architecture, the base environment code sets up a default global descriptor table containing a ``standard'' set of basic, flat-model segment descriptors, as well as a few extra slots reserved for use by the client OS. This ``base GDT'' is likely to be sufficient for many kernels, but may not be usable to kernels that make more exotic uses of the processor's GDT. In order to allow piecemeal replacement of the base environment as necessary, the assumptions made by the code and the intermodule dependencies are clearly documented in the sections covering the base environment code.



University of Utah Flux Research Group