1995-04-28 21:48:56 +02:00
|
|
|
<!-- This is a SGML version of the text on FreeBSD boot procedures
|
|
|
|
made by Poul-Henning Kamp <phk@FreeBSD.ORG>
|
|
|
|
|
|
|
|
This conversion has been made by Ollivier Robert.
|
|
|
|
|
1997-10-19 15:32:14 +02:00
|
|
|
$Id: booting.sgml,v 1.14 1997-10-19 13:32:04 jraynard Exp $
|
1995-05-10 13:34:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
<!DOCTYPE linuxdoc PUBLIC "-//FreeBSD//DTD linuxdoc//EN">
|
1995-04-28 21:48:56 +02:00
|
|
|
|
|
|
|
<article>
|
|
|
|
|
|
|
|
<title>Boot overview</title>
|
|
|
|
<author>Poul-Henning Kamp, <tt/<phk@login.dknet.dk>/</author>
|
|
|
|
<date>v1.1, April 26th</date>
|
|
|
|
<abstract>
|
1997-10-19 15:32:14 +02:00
|
|
|
Booting FreeBSD is essentially a three step process: load the kernel,
|
1995-04-28 21:48:56 +02:00
|
|
|
determine the root filesystem and initialize user-land things. This
|
|
|
|
leads to some interesting possibilities as shown below...
|
|
|
|
</abstract>
|
|
|
|
|
|
|
|
<toc>
|
1995-05-10 13:34:07 +02:00
|
|
|
-->
|
|
|
|
|
1995-09-25 05:53:33 +01:00
|
|
|
<sect><heading>The FreeBSD Booting Process<label id="booting"></heading>
|
1995-05-10 13:34:07 +02:00
|
|
|
|
|
|
|
<p><em>Contributed by &a.phk;. v1.1, April 26th.</em>
|
|
|
|
|
1997-10-19 15:32:14 +02:00
|
|
|
Booting FreeBSD is essentially a three step process: load the kernel,
|
1995-05-10 13:34:07 +02:00
|
|
|
determine the root filesystem and initialize user-land things. This
|
|
|
|
leads to some interesting possibilities shown below.
|
1995-04-28 21:48:56 +02:00
|
|
|
|
1995-09-25 05:53:33 +01:00
|
|
|
<sect1><heading>Loading a kernel</heading>
|
1995-04-28 21:48:56 +02:00
|
|
|
<p>
|
1995-08-29 03:42:52 +02:00
|
|
|
We presently have three basic mechanisms for loading the
|
|
|
|
kernel as described below:
|
1997-10-19 15:32:14 +02:00
|
|
|
they all pass some
|
1995-04-28 21:48:56 +02:00
|
|
|
information to the kernel to help the kernel decide what to do
|
|
|
|
next.
|
|
|
|
|
1995-08-29 03:42:52 +02:00
|
|
|
<descrip>
|
|
|
|
<tag>Biosboot</tag>
|
|
|
|
|
1997-10-19 15:32:14 +02:00
|
|
|
Biosboot is our ``bootblocks''. It consists of two files which
|
1995-04-28 21:48:56 +02:00
|
|
|
will be installed in the first 8Kbytes of the floppy or hard-disk
|
|
|
|
slice to be booted from.
|
|
|
|
|
|
|
|
Biosboot can load a kernel from a FreeBSD filesystem.
|
|
|
|
|
1995-08-29 03:42:52 +02:00
|
|
|
<tag>Dosboot</tag>
|
|
|
|
|
1995-04-28 21:48:56 +02:00
|
|
|
Dosboot was written by DI. Christian Gusenbauer, and is
|
|
|
|
unfortunately at this time one of the few pieces of code that
|
1996-05-17 01:18:28 +02:00
|
|
|
will not compile under FreeBSD itself because it is written for
|
1996-01-31 15:26:20 +01:00
|
|
|
Microsoft compilers.
|
1995-04-28 21:48:56 +02:00
|
|
|
|
|
|
|
Dosboot will boot the kernel from a MS-DOS file or from a FreeBSD
|
|
|
|
filesystem partition on the disk. It attempts to negotiate with
|
|
|
|
the various and strange kinds of memory manglers that lurk in
|
1996-01-31 20:03:02 +01:00
|
|
|
high memory on MS/DOS systems and usually wins them for its
|
1995-04-28 21:48:56 +02:00
|
|
|
case.
|
|
|
|
|
1995-08-29 03:42:52 +02:00
|
|
|
<tag>Netboot</tag>
|
|
|
|
|
1996-01-31 15:26:20 +01:00
|
|
|
Netboot will try to find a supported Ethernet card, and use
|
1995-04-28 21:48:56 +02:00
|
|
|
BOOTP, TFTP and NFS to find a kernel file to boot.
|
1995-08-29 03:42:52 +02:00
|
|
|
</descrip>
|
1995-04-28 21:48:56 +02:00
|
|
|
|
1995-08-29 03:42:52 +02:00
|
|
|
|
1995-09-25 05:53:33 +01:00
|
|
|
<sect1><heading>Determine the root filesystem</heading>
|
1995-04-28 21:48:56 +02:00
|
|
|
<p>
|
|
|
|
Once the kernel is loaded and the boot-code jumps to it, the kernel
|
|
|
|
will initialize itself, trying to determine what hardware is
|
1997-10-19 15:32:14 +02:00
|
|
|
present and so on; it then needs to find a root filesystem.
|
1995-04-28 21:48:56 +02:00
|
|
|
|
1996-01-31 15:26:20 +01:00
|
|
|
Presently we support the following types of root filesystems:
|
1995-08-29 03:42:52 +02:00
|
|
|
|
|
|
|
<descrip>
|
|
|
|
<tag>UFS</tag>
|
|
|
|
|
1995-04-28 21:48:56 +02:00
|
|
|
This is the most normal type of root filesystem. It can reside on
|
1996-01-31 15:26:20 +01:00
|
|
|
a floppy or on hard disk.
|
1995-04-28 21:48:56 +02:00
|
|
|
|
1995-08-29 03:42:52 +02:00
|
|
|
<tag>MSDOS</tag>
|
|
|
|
|
1997-10-19 15:32:14 +02:00
|
|
|
While this is technically possible, it is not particular useful
|
|
|
|
because of the ``FAT'' filesystem's inability to deal with links,
|
|
|
|
device nodes and other such ``UNIXisms''.
|
1995-04-28 21:48:56 +02:00
|
|
|
|
1995-08-29 03:42:52 +02:00
|
|
|
<tag>MFS</tag>
|
|
|
|
|
1995-04-28 21:48:56 +02:00
|
|
|
This is actually a UFS filesystem which has been compiled into
|
|
|
|
the kernel. That means that the kernel does not really need any
|
1997-10-19 15:32:14 +02:00
|
|
|
hard disks, floppies or other hardware to function.
|
1995-04-28 21:48:56 +02:00
|
|
|
|
1995-08-29 03:42:52 +02:00
|
|
|
<tag>CD9660</tag>
|
|
|
|
|
1995-04-28 21:48:56 +02:00
|
|
|
This is for using a CD-ROM as root filesystem.
|
|
|
|
|
1995-08-29 03:42:52 +02:00
|
|
|
<tag>NFS</tag>
|
|
|
|
|
1995-04-28 21:48:56 +02:00
|
|
|
This is for using a fileserver as root filesystem, basically
|
|
|
|
making it a diskless machine.
|
1995-08-29 03:42:52 +02:00
|
|
|
</descrip>
|
|
|
|
|
1995-04-28 21:48:56 +02:00
|
|
|
|
1995-09-25 05:53:33 +01:00
|
|
|
<sect1><heading>Initialize user-land things</heading>
|
1995-04-28 21:48:56 +02:00
|
|
|
<p>
|
1997-10-19 15:32:14 +02:00
|
|
|
To get the user-land going, the kernel, when it has finished
|
|
|
|
initialization, will create a process with ``<tt/pid == 1/'' and execute
|
|
|
|
a program on the root filesystem; this program is normally
|
1995-04-28 21:48:56 +02:00
|
|
|
``<tt>/sbin/init</tt>''.
|
|
|
|
|
|
|
|
You can substitute any program for /sbin/init, as long as you keep
|
|
|
|
in mind that:
|
|
|
|
|
1997-10-19 15:32:14 +02:00
|
|
|
there is no stdin/out/err unless you open it yourself. If you exit,
|
|
|
|
the machine panics. Signal handling is special for ``<tt/pid ==
|
1995-04-28 21:48:56 +02:00
|
|
|
1/''.
|
|
|
|
|
1995-10-22 01:42:14 +01:00
|
|
|
An example of this is the ``<tt>/stand/sysinstall</tt>''
|
|
|
|
program on the installation floppy.
|
|
|
|
|
1995-04-28 21:48:56 +02:00
|
|
|
|
1995-09-25 05:53:33 +01:00
|
|
|
<sect1><heading>Interesting combinations</heading>
|
1995-04-28 21:48:56 +02:00
|
|
|
<p>
|
|
|
|
Boot a kernel with a MFS in it with a special <tt>/sbin/init</tt>
|
|
|
|
which...
|
|
|
|
<descrip>
|
|
|
|
<tag/A -- Using DOS/
|
|
|
|
<itemize>
|
|
|
|
<item>mounts your <tt/C:/ as <tt>/C:</tt>
|
|
|
|
<item>Attaches <tt>C:/freebsd.fs</tt> on <tt>/dev/vn0</tt>
|
|
|
|
<item>mounts <tt>/dev/vn0</tt> as <tt>/rootfs</tt>
|
|
|
|
<item>makes symlinks<newline>
|
|
|
|
<tt>/rootfs/bin -> /bin</tt><newline>
|
|
|
|
<tt>/rootfs/etc -> /etc</tt><newline>
|
|
|
|
<tt>/rootfs/sbin -> /sbin</tt><newline>
|
1995-10-07 05:32:03 +01:00
|
|
|
(etc...)<newline>
|
1995-04-28 21:48:56 +02:00
|
|
|
</itemize>
|
|
|
|
|
1997-10-19 15:32:14 +02:00
|
|
|
Now you are running FreeBSD without repartitioning your hard disk...
|
1995-04-28 21:48:56 +02:00
|
|
|
|
|
|
|
<tag/B -- Using NFS/
|
|
|
|
|
|
|
|
NFS mounts your <tt>server:˜you/FreeBSD</tt> as
|
|
|
|
<tt>/nfs</tt>, chroots to <tt>/nfs</tt> and executes
|
|
|
|
<tt>/sbin/init</tt> there
|
|
|
|
|
1997-10-19 15:32:14 +02:00
|
|
|
Now you are running FreeBSD diskless, even though you do not control
|
1995-04-28 21:48:56 +02:00
|
|
|
the NFS server...
|
|
|
|
|
|
|
|
<tag/C -- Start an X-server/
|
|
|
|
|
1996-01-31 15:26:20 +01:00
|
|
|
Now you have an X-terminal, which is better than that dingy
|
1995-04-28 21:48:56 +02:00
|
|
|
X-under-windows-so-slow-you-can-see-what-it-does thing that
|
1997-10-19 15:32:14 +02:00
|
|
|
your boss insist is better than forking out money on hardware.
|
1995-04-28 21:48:56 +02:00
|
|
|
|
|
|
|
<tag/D -- Using a tape/
|
|
|
|
Takes a copy of <tt>/dev/rwd0</tt> and writes it to a remote tape
|
|
|
|
station or fileserver.
|
|
|
|
|
1997-10-19 15:32:14 +02:00
|
|
|
Now you finally get that backup you should have made a year
|
1995-04-28 21:48:56 +02:00
|
|
|
ago...
|
|
|
|
|
|
|
|
<tag>E -- Acts as a firewall/web-server/what do I know...</tag>
|
|
|
|
|
1997-10-19 15:32:14 +02:00
|
|
|
This is particularly interesting since you can boot from a write-
|
1995-04-28 21:48:56 +02:00
|
|
|
protected floppy, but still write to your root filesystem...
|
|
|
|
</descrip>
|
1995-05-10 13:34:07 +02:00
|
|
|
|
1995-04-28 21:48:56 +02:00
|
|
|
|
|
|
|
|