README(8) Minix Programmer's Manual README(8) Minix Boot Monitor 1.5 This package contains a flexible Minix bootstrap loader that may be used to boot Minix from either floppy or hard disk. Use it to replace build to make a simple boot diskette, or to dress up a hard disk root file system for an automatic boot at power on. The monitor mode gives you a powerful Bourne shell like interface to configure and boot Minix, or to boot other operating systems. Installation First of all: Be Careful. The installboot program should normally only be used on floppy devices, or on your hard disk root file system with the -device option. Better make a copy of the device you are going to use it on. Don't be alarmed however, unless I made a terrible mistake, the -device option should only write the boot block, and the -boot option halts for ten seconds when it is about to scribble over a file system. Nevertheless, you should test this on a floppy first. Where to place this package I suggest you make a directory '/usr/src/util' and extract the package there. (Next to its idiot brother in tools.) The Makefile assumes that it can find the kernel and fs directories by following '..'. Compiling The Makefile and the assembly files are written for the ACK ANSI C compiler, but you can type 'config kr' to transform these files for the old ACK K&R C compiler. Running 'config ansi' will retrieve the ANSI files from the directory 'ansi', removing the K&R set. Now run 'make'. Differences with 1.3 Version 1.3 had a kluge that made it say 'PS0' to Minix when booting from a 1.44Mb diskette. This version needs -DMINIX15 added to CFLAGS in the Makefile to enable this trick, because Minix 1.6 can now autodetect a 1.44Mb floppy. The main difference with 1.3 is the changed menu interface, instead of fixed built in functions for menu items, one can now define the menu items dynamically. You will have to change things like 'dos() {boot hd1}' into 'dos(d,Boot MS-DOS) {boot hd1}'. I changed the name of the default function action into main, to keep 1.5 from executing 1.3 junk. How Does it Work? The driving force behind the development of this package was the simple way the SunOS systems I normally work with are booted: The ROM bootstrap reads and executes the boot block, the boot block reads and executes the program /boot, and /boot reads and executes /vmunix, which contains the kernel. So I decided to make something just like that with the exception that /vmunix should of course be named /minix. Furthermore, I wanted /boot to have the functionality that is normally found in ROM boot monitors: Set parameters, select the root device, and be able to boot other devices. Replacing build The monitor in its most primitive mode may be used to make a simple boot floppy. This is what 'make floppy' does: installboot -image image kernel mm fs init 1 README(8) Minix Programmer's Manual README(8) installboot -boot /dev/fd0 bootblock boot image After booting, you will see a menu interface with just one choice: "Start Minix". The kernel has not been loaded yet, that happens after you type '='. When it asks you to insert your root floppy you can either do so, or just hit RETURN to use /dev/hd3 as root. Make a device bootable Now is the right time to read the installboot(8) manual page in the cat directory. I will just repeat the example given there to complete this story. To make a Minix file system /dev/fd0 mounted on /mnt bootable, enter the following: cp boot /mnt/boot installboot -image /mnt/minix kernel mm fs init installboot -device /dev/fd0 bootblock boot I don't have those kernel binaries. The command demolish(8) can take an image made by build to pieces. Use 'make demolish' to make it, and read the manual page to understand why I can't guarantee success. My root FS is too small The /boot and /minix files are dead weight on a RAM disk, so you can remove them by placing this code in /etc/rc: case `printroot` in /dev/ram*) rm -rf /boot /minix esac If your root FS is too small to even contain /boot and /minix, then you can try the -boot option on installboot to make a separate boot diskette, or you can use the -demo option to place the kernel image outside the file system. After the floppy test Try if you can boot a hard disk partition with the boot command from the monitor after booting the floppy, an MS-DOS partition for instance. After you've seen that work, make a Minix partition bootable, and try to boot it from the floppy. You can now make the Minix partition active with fdisk(8). (I've had one report on an XT whose master boot record could not boot non-DOS partitions. Installing my master boot code with installboot -master cured the problem.) The Manual Pages I urge you to read the manual pages, this README describes only a fraction of what the monitor can do. Feel free to ask me questions if the details elude you, they may help me to improve things. 2 README(8) Minix Programmer's Manual README(8) The Competition The advantages of the monitor over competitive boot loaders: The bootstrap and monitor are wholly contained within the Minix partition, the master bootstrap is not touched. (This package contains a normal master bootstrap if you lost the original, fdisk /mbr under MS-DOS 5.0 will also reinstall the master bootstrap.) The bootstrap is independent from the media it's on. Bootable file systems may be copied between floppies of a different type or hard disk partitions using dd(1) and they will still be bootable. The bootstrap is only one sector, so it can never span tracks. Both V1 and V2 file systems are supported under Minix 1.6. Kernel binaries are combined in one image for fast loading and easy manipulation of different kernel versions. The interface is configurable at the boot prompt or by using a program that simulates the boot monitor interface. You can have Minix booted in 5 seconds if no key is typed to a menu interface for instance. (The menu interface looks much better than a hex dump of your partition table.) Only two files are enough on a boot device: /boot and /minix. The monitor can call a kernel in 386 mode. This allows for a kernel that is completely compiled in 386 mode. Copyright Copyright 1992 Kees J. Bot, All rights reserved. This package may only be used in combination with Minix. Changes that do not increase the functionality or that are incompatible with the original may not be released to the public without permission from the author. Use of so called "C beautifiers" is explicitly prohibited. Author Kees J. Bot (kjb@cs.vu.nl) 3