summaryrefslogtreecommitdiffstats
path: root/share/man/man8/picobsd.8
blob: fc4eddcb16ea98303994a8106c30fb70ea523f1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
.\" -*- nroff-fill -*-
.\" $FreeBSD$
.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 .
.Pp
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.
.Pp
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
.Pa /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.
.Pp
The following options are available (but also check the
.Nm
script for more details):
.Pp
.Bl -tag -width "--floppy_size" -compact
.It Fl c
.It Fl clean
Clean the product of previous builds.
.It Fl n
Make the script non interactive. Do not show the initial menu, and
proceed in the build process without requiring user input.
.It Fl v
Make the script verbose, showing the various commands to execute and
waiting for user input before each of them. Useful when debugging.
.It 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
.It 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:
.Bl -bullet
.It
There are no dynamic libraries, and there is no directory
.Pa /usr/lib .
As a result, only static executables may be executed.
.It
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 .
.It
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
.Pa /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
.Pa /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:
.Bl -hang -width "install  "
.It bridge
is a configuration suitable for bridges, routers and firewalls
.It dial
is a configuration suitable for dial-out (ppp) networking.
.It install
is a configuration suitable for software installation.
.It isp
is a configuration suitable for dial-in (ppp) networking.
.It net
is a configuration suitable for general networking.
.It router
is a configuration suitable for use as a router.  This particular configuration
aims to work on minimal hardware.
.El
.Pp
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.
.Pp
You can define your own floppy type, by creating a directory
with a name of your choice (e.g. FOO) which contains
.Pp
.Bl -tag -width "floppy.tree.exclude" -compact
.It Pa PICOBSD
the kernel configuration file (required).
.It Pa crunch.conf
crunchgen configuration (required).
.It Pa config
shell variables, sourced by the
.Pa picobsd
script (optional).
.It Pa floppy.tree.exclude
files from the standard floppy tree which are not needed (optional).
.It Pa floppy.tree/
local additions to the standard floppy tree (optional).
.It Pa floppy.tree. Ns ${site}
same as above, site-specific (optional).
.El
.Pp
More information on the build process can be found in the
.Pa picobsd
script.
Sample configurations can be found in
.Pa /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.
.Pp
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.
.Pp
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
.Pa 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.
.Pp
The build process must be run as
.Dq root
because of the need of running
.Xr vnconfig 8
and
.Xr mount 8 .
.Pp
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.
OpenPOWER on IntegriCloud