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 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.
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:
Recompile the source. To do this, type "make" at the prompt.
Optional: Rebuild ps. If you have modified process management, you will need to rebuild the ps command to correctly report processes in your new environment. To do this:
Type "make ps" at the prompt.
When finished, copy the new ps command to /usr/bin.
ps needs to run as root with the set-uid bit on.
Therefore, type "chown root /usr/bin/ps" followed by "chmod 4755 /usr/bin/ps".
Build the new kernel. Though the new kernel has been compiled, a new kernel image has yet to be built. You can either install the kernel on a floppy or on the hard disk. To do the former, type "make fdboot" with a floppy in the drive, and use /dev/fd0 as the device; else type "make hdboot".
Reboot the system. Reboot the system using the Three-Fingered-Salute and then test out your new kernel!
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.
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.