How to make the kernel small, smaller, smallest?
marc at schneiders.org
Thu Apr 24 15:15:02 PDT 2003
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.
More information about the freebsd-small