How far can we reduce the FreeBSD kernel?

How far can we reduce the FreeBSD kernel, to the point of only using busybox, the boot system to start the system, to make it very small? (Sorry for possible spelling mistakes, I'm from Brazil and I have a huge appreciation for FreeBSD)
 
Disclaimer: I am not knowledgeable on embedded development.

You need to explain what you're trying to accomplish. Are you trying to run FreeBSD on a very small system (for example an i386 with 4 MiB of memory, which used to be possible 30 years ago)? Are you trying to build an embedded system (for example to operate a dishwasher)? What functionality do you need: networking stack, graphics driver, storage, file systems, ... ?
 
Disclaimer: I am not knowledgeable on embedded development.

You need to explain what you're trying to accomplish. Are you trying to run FreeBSD on a very small system (for example an i386 with 4 MiB of memory, which used to be possible 30 years ago)? Are you trying to build an embedded system (for example to operate a dishwasher)? What functionality do you need: networking stack, graphics driver, storage, file systems, ... ?
yes, an embedded system! I'm inspired by the "Floppinux" build and wanted a FreeBSD based version. Would it be possible to do something similar?
 
Yes, I believe that the concept of what I mentioned "Floppinux" would be "mfslinux" and "mfsBSD" would follow this same logic?
mfsBSD is FreeBSD based, whereas mfslinux is based on OpenWrt.

What is it you are trying to do?

I have a bootable mfsBSD partition which is only 56MB in size. If that is too big. then maybe look into PicoBSD, although you may struggle to find a floppy these days, or something to read it on....
 
How far can we reduce the FreeBSD kernel, to the point of only using busybox, the boot system to start the system, to make it very small? (Sorry for possible spelling mistakes, I'm from Brazil and I have a huge appreciation for FreeBSD)
in general, you should start with kernelconfig. Depending on your needs and without going too deep into hacking, you can get a 2MB working kernel.

Also interesting links:

 
You might also want to look at tools/boot/rootgen.sh.

It creates an image with halt, init, sh, and sysctl (plus shared libraries that they need). That's about as small as you can get (though you could also eliminate sysctl). I use it to test boot new loader and/or boot combos. It would generallize if you could list all the binaries you need, though that's a pain. (I've climbed that hill). It's about 34MB in size, with kernel (which is 30MB) and userland (about 4MB). The kernel is, I think, GENERIC, so you could do a lot better.
Code:
freebsd/sbin/reboot
freebsd/sbin/init
freebsd/sbin/halt
freebsd/sbin/sysctl
freebsd/boot.config
freebsd/libexec/ld-elf.so.1
freebsd/lib/libc.so.7
freebsd/lib/libncursesw.so.9
freebsd/lib/libedit.so.8
freebsd/etc/rc
freebsd/bin/sh
freebsd/boot/loader.conf
freebsd/boot/kernel/zfs.ko
freebsd/boot/kernel/acl_nfs4.ko
freebsd/boot/kernel/cryptodev.ko
freebsd/boot/kernel/kernel
freebsd/boot/kernel/geom_eli.ko
freebsd/boot/device.hints
There's a gsoc project that's not quite done that tries to build something this minimal for all architectures... If you wanted the additive approach, which is the only way to get super-small images.

What's the size budget?
 
Well, the Ox64 has 64 MB of memory.

I would love to see FreeBSD running on Ox64. After all it is $6 ($8 with more on board flash) device. There are some problems, I think - it's RiscV, according to some mailing list debate it uses C906 core, which requires some 'errata' handling because some specs violations (I have no details).
 
Back
Top