Jolix
/joh'liks/ n.,adj. 386BSD

PORTING UNIX TO THE 386: A PRACTICAL APPROACH


William & Lynne Jolitz


Originally the test framework to prove kernel parts work in the environment of an protected mode program running on the "raw" machine, this became the bootstrap environment to later load and start the kernel in system operation.




Introducing the Standalone System
The next milestone on our path was to produce, debug, and test a library of support routines written in absolute protected-mode code. These routines allow us to write the GCC programs needed to implement 386 machine-dependent code, to access devices, and to access UNIX file structures on the hard disk. For the code in Listing Three (in "The First Step") to function, a library is required to fill out all of the primitives invoked.

This library and corresponding programs constitutes a standalone system of a kind, and it affords us an opportunity to write a minimal amount of machine-dependent code outlining our basic structure before we commit to massive coding. It is a minimal C environment at best, but more than enough for us to implement and test things like exception catching, system call handling, line clock interrupts, and so forth. As we begin our climb, we are able to expand a toe hold into a foot hold.

The standalone system actually consists of assembly language programs for runtime start-off and processor support (module srt.s), as well as machine-dependent C code for device support (many modules, including kbd.c and cga.c) and machine-independent C code for language support, formatted output, and filesystem operations (modules prf.c and sys.c). With the standalone system, a file can be read or written from a BSD filesystem on a disk drive.

The BSD standalone system is not intended quite for this purpose; instead, it's used to bootstrap load the system from disk or tape as part of the process of initializing the computer to run the BSD system. Since we don't yet have an operable kernel to be loaded and we've already written a MS-DOS program loader (see DDJ, February 1991), the standalone system is not really of use to us yet. However, the standalone system also provides us with file I/O, formatted output, and a structure to hang hardware drivers on, while demanding little from the hardware for support. Thus, we can use the standalone system to prototype code for the kernel, with the added dividend of completing the bootstrap code required by the complete kernel.

To run this minimal system, only the simplest of keyboard, display, and hard disk device drivers are required. These can be enhanced later as needed.




<<BACK NEXT >>



Copyright 1989, 1990, 2006 TeleMuse Partners, William Jolitz and Lynne Jolitz