.TH README 8
.SH "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.
.SH Installation
First of all: \fBBe Careful\fP.  The installboot program should normally only
be used on floppy devices, or on your hard disk root file system with
the
.B \-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
.B \-device
option should only write the boot block, and the
.B \-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.
.SH "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 '..'.
.SH Compiling
The Makefile and the assembly files are written for the ACK ANSI C compiler,
but you can type '\fBconfig kr\fP' to transform these files for the old ACK
K&R C compiler.  Running '\fBconfig ansi\fP' will retrieve the ANSI files from
the directory 'ansi', removing the K&R set.  Now run 'make'.
.SH "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.
.PP
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
.B action
into
.BR main ,
to keep 1.5 from executing 1.3 junk.
.SH "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
.BR /boot ,
and /boot reads and executes
.BR /vmunix ,
which contains the kernel.  So I decided to make something just like that
with the exception that /vmunix should of course be named
.BR /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.
.de SP
.if t .sp 0.4
.if n .sp
..
.SH "Replacing build"
The monitor in its most primitive mode may be used to make a simple boot
floppy.  This is what 'make floppy' does:
.SP
.RS
.ft B
installboot \-image image kernel mm fs init
.SP
installboot \-boot /dev/fd0 bootblock boot image
.ft P
.RE
.PP
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.
.SH "Make a device bootable"
Now is the right time to read the
.BR installboot (8)
manual page in the cat directory.  I will just repeat the example given there
to complete this story.
.PP
To make a Minix file system /dev/fd0 mounted on /mnt bootable, enter the
following:
.SP
.RS
.ft B
cp boot /mnt/boot
.SP
installboot \-image /mnt/minix kernel mm fs init
.SP
installboot \-device /dev/fd0 bootblock boot
.ft P
.SH "I don't have those kernel binaries."
The command
.BR 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.
.SH "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
.BR /etc/rc :
.SP
.RS
case `printroot` in
.br
/dev/ram*) rm \-rf /boot /minix
.br
esac
.RE
.PP
If your root FS is too small to even contain /boot and /minix, then you can
try the
.B \-boot
option on
.B installboot
to make a separate boot diskette, or you can use the
.B \-demo
option to place the kernel image outside the file system.
.SH "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
.BR 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
.B installboot \-master
cured the problem.)
.SH "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.
.SH "The Competition"
The advantages of the monitor over competitive boot loaders:
.SP
.RS
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,
.B fdisk /mbr
under MS-DOS 5.0 will also reinstall the master bootstrap.)
.SP
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
.BR dd (1)
and they will still be bootable.
.SP
The bootstrap is only one sector, so it can never span tracks.
.SP
Both V1 and V2 file systems are supported under Minix 1.6.
.SP
Kernel binaries are combined in one image for fast loading and easy
manipulation of different kernel versions.
.SP
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.)
.SP
Only two files are enough on a boot device: /boot and /minix.
.SP
The monitor can call a kernel in 386 mode.  This allows for a kernel that
is completely compiled in 386 mode.
.SH Copyright
Copyright 1992 Kees J. Bot, All rights reserved.
.br
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.
.SH Author
Kees J. Bot (kjb@cs.vu.nl)
