Files
oldlinux-files/Minix/2.0.0/wwwman/man8/installboot.8.html
2024-02-19 00:21:39 -05:00

230 lines
12 KiB
HTML

<HTML>
<HEAD>
<TITLE>installboot(8)</TITLE>
</HEAD>
<BODY>
<H1>installboot(8)</H1>
<HR>
<PRE>
</PRE>
<H2>NAME</H2><PRE>
installboot - make a device bootable
</PRE>
<H2>SYNOPSIS</H2><PRE>
<STRONG>installboot</STRONG> <STRONG>-i(mage)</STRONG> <EM>image</EM> [<EM>label</EM>:]<EM>kernel</EM> <EM>mm</EM> <EM>fs</EM> ... <EM>init</EM>
<STRONG>installboot</STRONG> <STRONG>-(e)x(tract)</STRONG> <EM>image</EM>
<STRONG>installboot</STRONG> <STRONG>-d(evice)</STRONG> <EM>device</EM> <EM>bootblock</EM> <EM>boot</EM> [[<EM>label</EM>:]<EM>image</EM> ...]
<STRONG>installboot</STRONG> <STRONG>-b(oot)</STRONG> <EM>device</EM> <EM>bootblock</EM> <EM>boot</EM> [<EM>label</EM>:]<EM>image</EM> ...
<STRONG>installboot</STRONG> <STRONG>-m(aster)</STRONG> [<EM>fix</EM>] <EM>device</EM> <EM>masterboot</EM>
</PRE>
<H2>DESCRIPTION</H2><PRE>
<STRONG>Installboot</STRONG> may be used to make a device bootable by constructing a
kernel image and installing bootstrap code into the boot block of a Minix
file system. To understand how this can be done one first has to know
what happens when a PC is booted.
When the power is turned on the typical PC will try to read the first
sector from the first floppy disk or from the first hard disk into memory
and execute it. The code obtained from the hard disk (from the so-called
master boot sector) will immediately replace itself by the code found in
the first sector of the active partition. Thus the PC is now executing
the bootstrap code found in the first sector of /dev/fd0, /dev/hd1,
/dev/hd2, /dev/hd3, or /dev/hd4. The bootstrap will locate the operating
system on the device it itself was loaded from, load it, and execute it.
To make a Minix file system <STRONG>/dev/fd0</STRONG> mounted on <STRONG>/mnt</STRONG> bootable, enter the
following:
<STRONG>cp</STRONG> <STRONG>/usr/mdec/boot</STRONG> <STRONG>/mnt/boot</STRONG>
<STRONG>installboot</STRONG> <STRONG>-i</STRONG> <STRONG>/mnt/minix</STRONG> <STRONG>kernel</STRONG> <STRONG>mm</STRONG> <STRONG>fs</STRONG> <STRONG>init</STRONG>
<STRONG>installboot</STRONG> <STRONG>-d</STRONG> <STRONG>/dev/fd0</STRONG> <STRONG>/usr/mdec/bootblock</STRONG> <STRONG>boot</STRONG>
The "boot" program in the example is named the "boot monitor". It is
loaded by the bootblock code placed in the boot sector of /dev/fd0 and it
will take care of loading the kernel image "minix" from the root
directory of the file system. See <STRONG><A HREF="../man8/monitor.8.html">monitor(8)</A></STRONG> for a description of the
boot monitor. Note that <STRONG>boot</STRONG> is a name in the file system on <STRONG>/dev/fd0</STRONG> in
this example, the same file as <STRONG>/mnt/boot</STRONG>. Making <STRONG>/mnt/minix</STRONG> is normally
not necessary, there is usually a kernel image in the <STRONG>tools</STRONG> directory.
</PRE>
<H2>OPTIONS</H2><PRE>
<STRONG>-i(mage)</STRONG> <EM>image</EM> [<EM>label</EM>:]<EM>kernel</EM> <EM>mm</EM> <EM>fs</EM> ... <EM>init</EM>
The <STRONG>-image</STRONG> option (or the <STRONG>-i</STRONG> shorthand) combines the executable
files needed to run Minix in one file. Only the names and a few
zero bytes are inserted into the image. The name is for
identification and the zeros are used to pad separate pieces to
sector boundaries for fast loading.
An executable may be prefixed by a label. The monitor may be
instructed to load processes by label. So more than one kernel
process may be included in the image, each with a different
winchester driver for instance. So if you have compiled two
different kernels with an AT or XT driver then
<STRONG>installboot</STRONG> <STRONG>-i</STRONG> <EM>image</EM> <EM>AT</EM>:<EM>at</EM>_<EM>kernel</EM> <EM>XT</EM>:<EM>xt</EM>_<EM>kernel</EM> <EM>mm</EM> <EM>fs</EM> <EM>init</EM>
will make an image with two different labeled kernels and one
unlabeled set of the other binaries.
<STRONG>-(e)x(tract)</STRONG> <EM>image</EM>
Extract the binaries from <EM>image</EM> under the names stored in the image.
(The name includes the optional label.)
<STRONG>-d(evice)</STRONG> <EM>device</EM> <EM>bootblock</EM> <EM>boot</EM> [[<EM>label</EM>:]<EM>image</EM> ...]
Installs <EM>bootblock</EM> in the boot sector of <EM>device</EM> together with the
disk addresses to <EM>boot</EM>. These disk addresses are needed to load
<EM>boot</EM> from the file system at boot time. The argument <EM>boot</EM> is first
searched in the file system on <EM>device</EM>. If it is not found then it
is read as a normal file and added at the end of the file system.
The file system should be smaller than the device it is on to allow
this. Any extra images are also added to the end as described under
<STRONG>-boot</STRONG>. (Make sure you understand all this.)
The device need not be mounted when <STRONG>installboot</STRONG> is run, nor does it
matter if it is.
<STRONG>Installboot</STRONG> needs to be run again if <EM>boot</EM> is rewritten, because it
will then occupy a new place on the disk.
Old boot parameters are kept if there are no images added.
<STRONG>-b(oot)</STRONG> <EM>device</EM> <EM>bootblock</EM> <EM>boot</EM> [<EM>label</EM>:]<EM>image</EM> ...
This option fills a blank floppy in <EM>device</EM> with boot code and kernel
images. This "boot disk" does not have a root file system, only the
boot monitor and Minix kernels. The boot parameters sector is
filled with code that enables menu options for selecting an image.
After loading an image, the monitor will ask you to insert a root
file system diskette before starting Minix.
The labels used on the images should match those on the executables
used inside the image. You can put a comma separated list of labels
on an image for each label used within the image. For the image
created earlier one would create a boot floppy like this:
<STRONG>installboot</STRONG> <STRONG>-b</STRONG> <STRONG>/dev/fd0</STRONG> <STRONG>bootblock</STRONG> <STRONG>boot</STRONG> <EM>AT</EM>,<EM>XT</EM>:<EM>image</EM>
If a label-list is omitted on an image, then that image will be
selected by default. (Like in the normal one image, no labels
case.)
Note that <STRONG>-device</STRONG> and <STRONG>-boot</STRONG> together allow you to make a boot floppy
with or without a root file system. With the boot code in the file
system, attached to the end of it, or after the boot block. And
with one or more kernel images in the file system or at the end of
the device. Somewhat confusing.
<STRONG>-m(aster)</STRONG> [<EM>fix</EM>] <EM>device</EM> <EM>masterboot</EM>
This option installs the <EM>masterboot</EM> program into the boot sector of
the given device. If another device is given instead of <EM>masterboot</EM>
then its bootstrap code is copied to <EM>device</EM>. The master bootstrap
on a hard disk boots the active partition on that disk at boot time.
The MS-DOS fdisk command normally puts a master bootstrap on the
hard disk. Minix has two bootstraps that can be used as a master
bootstrap. A fairly normal one named <STRONG>masterboot</STRONG> that works as
follows:
If the ALT key is held down while booting then '/dev/hd?'
appears and you are expected to type a number key (0 - 9) to
select the device to boot.
If <EM>fix</EM> (a small number) is given then the bootstrap is locked
into booting the <STRONG>/dev/hd</STRONG><EM>fix</EM> disk or primary partition. This is
needed if 'boot *hd<EM>N</EM>' is used from the monitor to boot an O.S.
that needs the active flag set.
If installed on a Minix floppy then it will try to boot the
next floppy or the first hard disk. Ideal for floppies with
just data on it, they will no longer obstruct the boot process
if left in the drive. Also a very useful trick to boot from
floppy drive 1.
If installed on a hard disk then the active partition is
selected and booted as usual, unless none of the partitions is
marked active, then it will boot the next disk. The latter is
useful if you want to boot an operating system from the second
disk by default.
The second bootstrap is named <STRONG>extboot</STRONG>. It has only one function, to
boot the logical partition named by <EM>fix</EM>. <EM>Fix</EM> is not optional for
<STRONG>extboot</STRONG> and must be a number-letter pair, like <STRONG>2c</STRONG> for <STRONG>/dev/hd2c</STRONG>.
<STRONG>Extboot</STRONG> or <STRONG>masterboot</STRONG> with a fix key need not be installed in the
hard disk master bootstrap per se if you don't want to mess with the
DOS master bootstrap, or if you want keep the active flag
functioning. An extended partition or a non-root Minix partition
are better candidates. It seems logical to put <STRONG>extboot</STRONG> in the
extended partition boot block.
A backup copy of the current master bootstrap (including the
partition table) can be made with:
dd if=<EM>device</EM> of=<EM>backup</EM>-<EM>file</EM> count=1
A simple 'cat <EM>backup</EM>-<EM>file</EM> &gt; <EM>device</EM>' will put it back. You can also
use <STRONG>fdisk</STRONG> <STRONG>/mbr</STRONG> under MS-DOS 5.0 (or newer) to restore the master
bootstrap.
</PRE>
<H2>FILES</H2><PRE>
<STRONG>/usr/mdec/bootblock</STRONG> Minix bootstrap for the Minix root device. To
be placed in the boot sector.
<STRONG>/usr/mdec/boot</STRONG> Minix Boot Monitor. Can usually be found in the
root directory of a bootable device.
<STRONG>/usr/mdec/masterboot</STRONG> Master bootstrap. Can be placed in the first
sector of a disk to select the active partition.
In a Minix primary partition it selects the
active subpartition.
<STRONG>/usr/mdec/extboot</STRONG> Extended partition bootstrap.
</PRE>
<H2>SEE ALSO</H2><PRE>
<STRONG><A HREF="../man8/part.8.html">part(8)</A></STRONG>, <STRONG><A HREF="../man8/monitor.8.html">monitor(8)</A></STRONG>.
</PRE>
<H2>DIAGNOSTICS</H2><PRE>
<EM>Boot</EM> doesn't fit on <EM>device</EM>
If there is no space on the device to add the boot code. This
usually means that there is no boot code in the file system you use
<STRONG>installboot</STRONG> <STRONG>-device</STRONG> on.
<EM>Image</EM> doesn't fit on <EM>device</EM>
If the device is too small for all the images you try to put on it.
</PRE>
<H2>BUGS</H2><PRE>
It has four more options than the SunOS installboot program it is modeled
after.
The bootblock code has been crunched to such ugliness that you can use it
to scare little kids out of your garden.
</PRE>
<H2>AUTHOR</H2><PRE>
Kees J. Bot (kjb@cs.vu.nl)
</PRE>
</BODY>
</HTML>