How to make the kernel small, smaller, smallest?
ahb at skynet.be
Fri Apr 25 01:21:52 PDT 2003
Actually as far as PicoBSD goes the easiest in the beggining is to just
copy the bridge folder into a new one
Do your kernel modifications but in your crunch.conf don't change
anything if you are not certain what you need (except maybe for the sh
tinyware) 'cos you will need a lot more than just sh and init (You need
tools to decompress the kernel, and if your root file system is not
together woth the mfs the it needs to be mounted). Then once that's done
start removing program from crunch.conf patiently, reading the manuals
and so on.
Oinit is not the best choice, it does not provide password login, so if
your box is to be connected to the net not good.
here is the example of a kerner file (size here big cos is used over
etherboot), also there is no mouse or keyboard support, nor video, it
boots up via the serial port.
# $FreeBSD: src/release/picobsd/router/PICOBSD,v 184.108.40.206 2002/03/13
18:16:53 luigi Exp $
#Line starting with #PicoBSD contains PicoBSD build parameters
#marker def_sz init MFS_inodes floppy_inodes
#PicoBSD 10000 init 4096 32768
options MATH_EMULATE #Support for x87 emulation
options INET #InterNETworking
options FFS #Berkeley Fast Filesystem
options FFS_ROOT #FFS usable as root device [keep this!]
options MFS #Memory Filesystem
options MD_ROOT #MFS as root
options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!]
options USERCONFIG #boot -c editor
device npx0 at nexus? port IO_NPX irq 13
device sio0 at isa? port IO_COM1 flags 0x10 irq 4
device sio1 at isa? port IO_COM2 irq 3
device ep0 at isa? #port 0x300 irq 10
pseudo-device pty 16
Marc Schneiders wrote:
>On Thu, 24 Apr 2003, at 19:19 [=GMT+0200], Rodrigo Readi wrote:
>>Thanks for your answers to my previous posting. Manuels's Article about
>>minibsd contains indeed a lot of interesting matters, but it is
>>unfortunately not for my purpose: I want a minimal FreeBSD in one, at
>>most two, floppies that allows me to start an Xserver over a
>>NFS. PicoBSD is more for my purposes, thanks Bruce for your notes.
>>Now I have a new question: how to build a very small kernel? Today I
>>threw a lot away from the GENERIG config file, but inspite of it, it
>>compiled a lot of functions (modules?) that dont seem usefull to
>>me. At the end I had a little more than 2MB,
>Is this just the kernel or also the modules? I think all modules are
>built, but they are not in the kernel then. So I think you don't need
>If your kernel is 2MB, there must be more to cut. Mine are 1870295 and
>1862058 and they could lose some things. Obviously you don't need any
>ata or scsi stuff, no ISO9660 filesystem etc. There is a lot you can
>cut. INET6 if you don't use that. NFS takes up lots of kernel bytes,
>but you need that, right? Same probably with printer port, usb maybe?
>About 2 years ago I looked into this a bit and built something really
>small, to run on a laptop with 4 MB RAM. That must have been before
>the GENERIC kernel got slightly fatter. It was 1.3MB or little under.
>I am not an expert at all on kernel 'hacking'. I know no C whatsoever.
>I just tried things. And when the kernel doesn't boot, well put the
>option back in you just took out and rebuild. If you build it on a
>recent machine it goes pretty fast these days.
>freebsd-small at freebsd.org mailing list
>To unsubscribe, send any mail to "freebsd-small-unsubscribe at freebsd.org"
More information about the freebsd-small