Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Apr 1995 20:01:10 -0700 (PDT)
From:      Poul-Henning Kamp <phk@ref.tfs.com>
To:        faq@freebsd.org, doc@freebsd.org
Subject:   contribution
Message-ID:  <199504260301.UAA10042@ref.tfs.com>

next in thread | raw e-mail | index | archive | help
Here is a little text I just whipped up, may it find it's place in life
through some of you guys:


Overview
--------

Booting FreeBSD is essentially a three step process:

	*  Load the kernel

	*  Determine the root filesystem

	*  Initialize user-land things

This gives some 
	
	*  Interesting combinations

Loading a kernel
----------------

We presently have three basic mechanisms for loading the kernel:

	* biosboot

	* dosboot

	* netboot

Each will be described in detail below.  They all pass some information
to the kernel to help the kernel decide what to do next.


Biosboot
--------
Biosboot is our "bootblocks", it consists of two files, which will be 
installed in the first 8Kbyte of the floppy or hard-disk slice to be
booted from.

Biosboot can load a kernel from a FreeBSD filesystem


Dosboot
-------
was written by DI. Christian Gusenbauer, and is unfortunately
at this time one of the few pieces of code that isn't compilable
under FreeBSD itself because it is written for MicroSoft compilers.

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 high memory on MS/DOS systems
and usually wins them for it's case.


Netboot
-------
will try to find a supported ethernet card, and use BOOTP, TFTP and NFS to
find a kernel file to boot.


Determine the root filesystem
-----------------------------
Once the kernel is loaded and the boot-code jumps to it, the kernel will
initialize itself, trying to determine what hardware is present and so on,
and then it needs to find a root filesystem.

Presently we support the following types of rootfilesystems:

	* UFS

	* MSDOS

	* MFS

	* CD9660

	* NFS


UFS
---
This is the most normal type of root filesystem.
It can reside on a floppy or on harddisk.

MSDOS
-----
While this is technically possible, it isn't particular useful, because of 
"FAT" filesystems inability to make links, device nodes and such "UNIXisms".

MFS
---
This is actually a UFS filesystem which has been compiled into the kernel.
That means that the kernel does not really need any disks/floppis or other
HW to function.

CD9660
------
This is for using a CDrom as root filesystem

NFS
---
This is for using a fileserver as root filesystem, basically making it a
diskless machine.


Initialize user-land things
---------------------------
To get the user-land going, when the kernel has finished initialization,
it will create a process with pid == 1 and execute a program on the
rootfilesystem, this program is normally "/sbin/init".

You can substitute any program for /sbin/init, as long as you keep in 
mind that:

	there is no stdin/out/err unless you open it yourself,
	if you exit, the machines panics
	signal handling is special for pid==1


Interesting combinations
------------------------

	Boot a kernel with a MFS in it with a special /sbin/init which...
	
	A:  mounts your C: /C:
	    Attaches C:/freebsd.fs on /dev/vn0
	    mounts /dev/vn0 /rootfs
	    makes symlinks
		/rootfs/bin -> /bin
		/rootfs/etc -> /etc
		/rootfs/sbin -> /sbin
		... &c &c

	    Now you run FreeBSD without repartitioning your hard disk...

	B:  NFS mounts your server:~you/FreeBSD as /nfs
	    chroots to /nfs and executes /sbin/init there

	    Now you run FreeBSd diskless, even though you don't control
	    the NFS server...

	C:  Starts an X-server...

	    Now you have an Xterminal, which is better than that dingy
	    X-under-windows-so-slow-you-can-see-what-it-does thing that
	    your boss insist is better than forking our money on HW.

	D:  Takes a copy of /dev/rwd0 and writes it to a remote tape
	    station or fileserver.

	    Now you finally got that backup you should have made a year ago...

	E:  acts as a firewall/web-server/what do I know...

	    This is particular interesting since you can boot from a write-
	    protected floppy, but still write to your root filesystem...

-- 
Poul-Henning Kamp <phk@login.dknet.dk> -- TRW Financial Systems, Inc.
'All relevant people are pertinent' && 'All rude people are impertinent'
=> 'no rude people are relevant'



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199504260301.UAA10042>