Separation of Base System and Userland
Posted on
I had a need to deploy a small VPS recently and I wanted it to be reliable and secure so I gave FreeBSD a try. This was also a great excuse to play around with something I've been curious about for a while.
There's a lot to like: coherent, well engineered tooling, excellent official docs, built-in ZFS, great virtualisation options and a certain elegant simplicity. Being a big old Linux nerd there were a few things for me to learn but the BSD experience isn't that different - most things work the same or are similar enough.
One thing that is different about the BSDs when compared Linux distros is that the kernel and base system are maintained and released as one unit. This includes device drivers, system libraries like libc, standard Unix commands and even the C compiler. When you install a version of FreeBSD you're getting a version of the kernel along with all the userland tooling to go with it, and it's all well integrated.
The base system isn't even distributed using the software packaging system that userland software uses. Traditionally, the base system is just a set of tarballs which gets extracted onto the file system with the help of tooling (this is now changing but was true until recently).
The base system is quite independent of the software the user installs on top of it. They two are distributed and managed in different ways and for the most part kept apart.
After getting used to FreeBSD and getting my little server running nicely, I realised that there's a lot of parallels here with image based distribution approaches used by some newer Linux distros. With systems like Bluefin, the Fedora Atomic Desktops and the various bootc reinterpretations of popular distros, we're seeing Linux adopt a similar distribution model to the BSDs. The base system and userland are clearly separated, and managed and upgraded in very different ways.
A notable difference is that with BSDs, it's the same pool of developers who work on both the kernel and base system, whereas with Linux there's still a distro team bringing together software from many different teams and projects and making it all work.
Still, it's fascinating to see how the BSD style of putting together an operating system has somewhat arrived in the Linux world, intentionally or not.