next up previous
Next: Kernel Memory Management Up: Implementation Details Previous: Utilized Protected Mode

Standalone Library

In order to implement the nachos kernel in a stand-alone scenario, all its Unix dependencies had to be removed. This meant long object-code listings and lists of C and C++ library functions. Ultimately we pared it down to a small subset of functions (about 35) which we needed to implement in order to link and run. Some were as simple as implementing strcpy() which can be done in a single line of code. Others, however, such as the C++ new() and delete() operators, were remarkably complex.

To identify the Unix system library dependencies, we compiled Nachos with the -nostdinc, -nostdlib and -nostartfiles gcc flags. The first flag facilitated identifying all externally prototyped functions and data structures. The second identified which system functions were actually missing; the list of undefined symbols produced by the linker is exactly this set. The last flag prevented gcc from providing the low-level run-time start routines automatically. This was necessary as they are inherently specific to a single operating system and Nachos/486 is not a configuration option when installing gcc.

To organize the replacement code, we created a ``stand-alone'' library, libsa.a along with an attendant library interface description, libsa.h. The source for this library is found in the following files: stdc.c, kmemory.cc and misc.c. Each file and its contents will be briefly discussed below. Technically kickstart.S is also part of the stand-alone library, but it could not easily be incorporated into libsa.a,because it must be the first object file given to the linker to ensure that the entry point is at the beginning of the binary so that the first stage boot-strap can locate it easily.gif



next up previous
Next: Kernel Memory Management Up: Implementation Details Previous: Utilized Protected Mode



Paco Hope
Wed Jun 21 23:54:28 EDT 1995