picobsd.8 revision 79454
-*- nroff-fill -*-
$FreeBSD: head/share/man/man8/picobsd.8 79454 2001-07-09 09:54:33Z dd $
.Dd June 20, 2001 .Os .Dt PICOBSD 8 .Sh NAME .Nm picobsd .Nd floppy disk based FreeBSD system .Sh SYNOPSIS .Nm .Op options .Op Ar floppy-type Op Ar site-name .Sh DESCRIPTION .Nm is a script which can be used to produce a minimal implementation of .Fx (historically called .Nm PicoBSD ) which typically fits on one floppy disk, or can be downloaded as a single image file from some media such as CDROM, flash memory, or through .Xr etherboot .

p The boot media (typically a floppy disk) contains a boot loader and a compressed kernel which includes a memory file system. Depending on the media, it might also contain a number of additional files, which can be updated at run time, and are used to override/update those in the memory file system.

p The system loads the kernel in the normal way, uncompresses the memory file system and mounts it as root. It then updates the memory filesystem with files from the boot media (if present), and executes a specialized version of

a /etc/rc . The boot media (floppy etc.) is required for loading only, and typically used as readonly. After the boot phase, the system runs entirely from ram.

p The following options are available (but also check the .Nm script for more details):

p l -tag -width "--floppy_size" -compact t Fl c t Fl clean Clean the product of previous builds. t Fl n Make the script non interactive. Do not show the initial menu, and proceed in the build process without requiring user input. t Fl v Make the script verbose, showing the various commands to execute and waiting for user input before each of them. Useful when debugging. t Fl -floppy_size Ar size Set the size of the floppy image. Values other than 1440 can be used for images that are burned into a CDROM, or downloaded using .Xr etherboot t Fl -src Ar pathname Use the source tree at .Ar pathname instead the one at .Ar /usr/src . Can be useful for cross-building floppy images, but you must be careful in that there are dependencies with the .Xr config 8 program, and also with include files and libraries. .El .Sh ENVIRONMENT As a result of the extreme size limitations, the .Nm environment differs from the normal .Fx in a number of ways: l -bullet t There are no dynamic libraries, and there is no directory

a /usr/lib . As a result, only static executables may be executed. t In order to reduce the size of the executables, all executables on a specific floppy are joined together as a single executable built with .Xr crunchgen 1 . t Some programs are supplied in minimalistic versions, specifically .Nm ns , a cut-down version of .Xr netstat 1 , and .Nm vm , a cut-down version of .Xr vmstat 8 . .El .Sh BUILDING picobsd The .Nm sources reside in the hierarchy

a /usr/src/release/picobsd . In the following discussion, all relative path names are relative to this directory. The .Nm build process has changed slightly over time, in order to cope with the unavoidable increase of code size, which requires more and more tricks to cram as much as possible on to the floppies. In .Fx 4.3 , the supported build script is

a /usr/src/release/picobsd/build/picobsd which can be run from anywhere. This interactive script will ask for parameter entries and then build the appropriate single floppy version. The following kinds of floppy are envisaged: l -hang -width "install " t bridge is a configuration suitable for bridges, routers and firewalls t dial is a configuration suitable for dial-out (ppp) networking. t install is a configuration suitable for software installation. t isp is a configuration suitable for dial-in (ppp) networking. t net is a configuration suitable for general networking. t router is a configuration suitable for use as a router. This particular configuration aims to work on minimal hardware. .El

p These configurations serve only as examples to build your own. Not all of them have been tested, and you might need small tweaks to the configuration files to make them work or even fit into the available disk space as code size increases.

p You can define your own floppy type, by creating a directory with a name of your choice (e.g. FOO) which contains

p l -tag -width "floppy.tree.exclude" -compact t Pa PICOBSD the kernel configuration file (required). t Pa crunch.conf crunchgen configuration (required). t Pa config shell variables, sourced by the

a picobsd script (optional). t Pa floppy.tree.exclude files from the standard floppy tree which are not needed (optional). t Pa floppy.tree/ local additions to the standard floppy tree (optional). t Pa floppy.tree. Ns ${site} same as above, site-specific (optional). .El

p More information on the build process can be found in the

a picobsd script. Sample configurations can be found in

a /usr/src/release/picobsd/ Ns ${type} Ns / .Sh USING ALTERNATE SOURCE TREES The build script can be instructed use an alternate source tree using the .Fl -src Ar pathname option. The tree that you specify must contain full sources for the kernel and for all programs that you want to include in your image. This option must be used with great care though, because different source trees might refer to different include files, libraries or versions of the .Xr config 8 program. .Sh BOOTING PicoBSD To boot .Nm , insert the floppy and reset the machine. The boot procedure is similar to the standard .Fx boot, but proceeds at a snail's pace. From the end of the POST (BIOS Power On Self Test) until the system is up and running takes anywhere between 1 and 3 minutes.

p To speed up booting, you can use .Xr etherboot to load the preloaded, uncompressed kernel image which is a byproduct of the .Nm build. In this case the load time is a matter of a few seconds, even on a 10Mbit/s ethernet. .Ss Swap space After booting, .Nm runs entirely from the memory file system. The floppies are no longer used, and even if there are hard disk drivers in the .Nm kernel, it does not access the drives. In particular, there is no swap space, so if you run out of memory, unpredictable things can happen.

p If you have a disk driver and a disk with a swap partition on it, and the swap partition does not contain a dump you want to keep, you can use this swap with .Nm . Use the .Xr swapon 8 command. .Sh SEE ALSO .Xr crunchgen 1 , .Xr swapon 8 , .Xr vnconfig 8 .Sh AUTHORS .An -nosplit .An Andrzej Bialecki Aq abial@FreeBSD.org , with subsequent work on the scripts by .An Luigi Rizzo Aq luigi@iet.unipi.it and others. Man page and

a Makefiles created by .An Greg Lehey Aq grog@lemis.com . .Sh BUGS In order to build .Nm , the kernel of the system on which it is built must have the .Xr vn 4 driver installed.

p The build process must be run as .Dq root because of the need of running .Xr vnconfig 8 and .Xr mount 8 .

p Building .Nm is still a black art. The biggest problem is determining what will fit on the floppies, and the only practical method is trial and error.