ECS150: Introduction to Operating Systems

Building and Testing a Kernel

The MINIX Kernel

The image of the MINIX kernel is stored in the /minix directory in the test_kernel parition. This is where compiled versions of the kernel will appear. At boot, the machine will use the latest version of the kernel from that directory.

An ls in the /minix directory may show something like this:

.
..
minix
minix20r0
minix20r1

As you can see, when building the kernel, the new kernel image is designated with a new release number.

The Kernel Source

The MINIX source is located in /usr/src. Under its various subdirectories, you will find the source code (in C) and various utilities. The source is described in Tanenbaum and Woodhull's Operating Systems: Design and Implementation. The files are probably owned by root; in order to change the source and rebuild the kernel, you should be logged in as root as well.

Making the Kernel

After modifying the kernel source, you must rebuild the kernel. This is done by using the make utility included in the MINIX distribution. Under the /usr/src/tools directory are all the files needed to build the kernel. In order to build the kernel, you must cd to this directory. Afterwards, follow these steps:

The next time you start up the kernel, it should be the one you compiled. If there are any problems, see What to do when everything else has gone wrong.

Testing a Floppy Installation

If you have created a bootable floppy disk, you will notice that if you boot off of it, it puts you in the student partition. It would be desirable, however, to use the test_kernel parition. To do this, you must redirect the boot monitor program.

During the boot process, the boot monitor will start. It looks something like this:

Minix boot monitor 2.5
Press ESC to enter the monitor

When this screen appears press the ESCAPE key immediately. This will disable the default boot process. Then, you must type the magical incantations "rootdev = hd1a" followed by "boot" (it should look like the following):

fd0>rootdev = hd1a
fd0>boot

This will boot your kernel and then you use the test_kernel partition.