Why a GNU/Linux user decided to learn FreeBSD

Posted by Karl Levik on 2022-08-20, last modified on 2022-08-20

Why on Earth would anyone want to learn another operating system when they already know GNU/Linux? Recently, I have started to learn the ins and outs of the FreeBSD operating system, and here I attempt to explain why. There is also a bonus section at the end where I look at two database systems in this context.

FreeBSD boot menu

The FreeBSD boot menu

Windows, MacOS, GNU/Linux

Like many others of my generation, my adventure with computers began in the home computer era with its somewhat rudimentary operating systems. However, in the early 90s I invested in an 80386 desktop PC which came with MS-DOS. While that was barely an operating system, it offered a lot of freedom for developers to write programs that did weird and wonderful things. I loved it! But all good things must come to an end. A dark chapter for creative and artistic computer users started with the arrival of Microsoft's later OSes: The various incarnations of MS Windows with all their bloat and restrictions took PCs in a distinctly corporate-friendly direction which in my opinion was the death to the creative community that had thrived during the MS-DOS years.

Of course, the other big OS for desktop/laptop users has always been the Apple OSes such as OSX and now MacOS. I never had opportunity to spend significant time with any of these. For a long time they did seem to have the upper hand in GUI design, and they are also considered 'Unix-like' (which I will talk about later), but when adding up the pros and cons there was another OS that always came out on top for me:

Redhat 4.1

Redhat Linux 4.1 for Intel compatible computers

Linux! Also known as GNU/Linux. The vast majority of my PC era computer time has been spent with various distros of this OS. The university computer labs had mostly Redhat Linux machines, and the first distro I installed on my own desktop PC was also Redhat; version 4.1 in 1997. Since then I have used many of the major distros on various PCs and servers.

What else is there?

But there came a point - much, much later - where I started to wonder if it was worth trying something different. There are other OSes out there! Although, are they actually worth my time?

Some factors I think helped make GNU/Linux such a fantastic OS:

  • Licence: GNU/Linux is open-source which is especially important for something as fundamental as the OS. Even if I will probably never personally sit down to read through the source code of an OS kernel to identify and report vulnerabilities, I really do appreciate that this is an option, and that other individuals and companies do actually take the time to do this.
  • Standards: GNU/Linux is a Unix-like OS that (with some exceptions) follows the Unix philosophy. In my search it was therefore natural to first consider this OS family. The POSIX standards can be used to determine how Unix-like an OS is.
  • Portability: GNU/Linux runs equally well on desktops and laptops as it does on servers, so sysadmins only have to learn this single OS to work with both. Additionally, GNU/Linux also runs on an incredibly wide range of architectures.

There can obviously be other good features, so an OS could still be appealing to me even if it doesn't score so well on the above.

Some of the alternative OSes that have piqued my interest are e.g. Haiku, ReactOS, FreeDOS. Neither one of them have all the features I just listed. And for all their good qualities, here lurks danger: What if I invest time and effort which ultimately end up being wasted if interest in the project wanes and is abandoned? And what is the utility of "smaller" OSes anyway? Haiku has been in development for 20 years and it's still in beta. ReactOS has been developed for even longer and is still in alpha. FreeDOS has been stable since 2006, but is clearly a rather niche OS which isn't particularly forward-looking.

I think inevitably, when looking for an OS with many of the good qualities of GNU/Linux, you end up considering the BSD family.

FreeBSD and how it differs from GNU/Linux

Some history

Unix was an OS first developed at Bell Labs by AT&T and had its first release in 1969, the year of the first moon landing. This was a proprietary OS, but it was licenced to a number of universities (as 'Research Unix'), one of which was UC Berkeley. In those days the source code (written in C at this point) was distributed with the licence, and UC Berkeley's Computer Systems Research Group made significant changes and additions to their Research Unix source code. This became known as the Berkeley Software Distribution (BSD) or Berkeley Unix, and the rest is a history better covered elsewhere. The short version is that the source code was rewritten file by file so it could be released as open-source. This was then forked into different BSD derivatives, one of which was FreeBSD. FreeBSD 2.0 was the first version without any AT&T code, released in November 1994. For context, this was also the year of Linux kernel version 1.0, and distros such as Slackware, Redhat and SUSE all published their first stable releases that year.

Some differences

While Linux is, technically speaking, just a kernel since you need GNU or another userland to actually do anything with it, FreeBSD is a complete operating system: The FreeBSD base system contains all the software needed to make use of the kernel. (But there is no desktop environment or graphical user-interface; this is instead covered by the ports and packages collection.) This makes for a more coherent OS as the same development team is responsible for both kernel and userland base system. The FreeBSD documention also benefits from this: There is a single 'Handbook' user manual which documents the entire OS and is constantly kept up-to-date.

While both GNU/Linux and FreeBSD are Unix-like OSes, it could be said that FreeBSD is arguably more Unix-like as it is considered "genetic Unix", i.e. is derived from the original Unix source code whereas GNU/Linux is only "functional Unix", i.e. it behaves roughly in a manner consistent with the Unix specification, but beyond that the source code has no relationship to the Unix source code. And let's not forget: GNU is Not Unix!

While GNU/Linux distros are licenced largely under GPL, which is a copyleft licence, FreeBSD is licenced under permissive free software licenses such as the BSD-style licences. This means that GNU/Linux code can not be used in proprietary products whereas FreeBSD code can be. Some well-known examples: Code from FreeBSD was used in Apple's experimental Darwin OS which they later developed further to become e.g. OSX, MacOS and iOS. Also: CellOS and Orbis OS, the operating systems in Sony PlayStation 3 and 4, respectively, both appear to be forks of FreeBSD. FreeBSD is also used in several embedded devices such as routers and NAS.

To some free and open-source enthusiasts the idea of such permissive open-source licences might seem inherently problematic: Simply giving your code away for someone else to bundle it with their proprietary software and make a profit? Madness! But let's be clear: Usually, to make money off of someone else's permissively-licenced software, you need to first spend significant effort to turn it into a compelling product: You might have to develop hardware as well as other software, as in the case of Apple and the PlayStations using FreeBSD, or you need to develop significant software infrastructure, as in the case of e.g. cloud vendors using open-source as a basis in services like the AWS Aurora databases. So your open-source code would usually only be one component of their product. And you would of course retain all the rights to your code, and you are free to use the code in a similar product and make your own profit off of it, if you so wish.

It is my impression that changes, especially user-facing changes, happen at a slower pace in FreeBSD-land than they do in the "big 3" OSes. This has both advantages and disadvantages. On the one hand, it means that users don't have to constantly learn new ways of doing the same.

But on the other hand, it is also true that FreeBSD does not receive as many commits and has a smaller number of "eyes" and contributors than does GNU/Linux. Below is an "apples and oranges" comparison of commit activity in the FreeBSD base system versus the Linux kernel. Although the FreeBSD base system is obviously much more than the kernel, it is clear that the Linux kernel receives a lot more commits than its FreeBSD counterpart.

FreeBSD commit activity - 1yr to 2022-07-31

FreeBSD base system commit activity - 1yr to 2022-07-31

Linux commit activity - 1yr to 2022-07-31

Linux kernel commit activity - 1yr to 2022-07-31

Concluding remarks and further reading

Which OS is "better"? Do the permissive licences make sense? The jury is still out. Both GNU/Linux and FreeBSD have stood the test of time, although clearly GNU/Linux is significantly more widespread and popular. However, FreeBSD also has a healthy following. It seems to be a great server OS with some benchmark tests showing it outperforms GNU/Linux for certain common server workloads (network, web servers, database servers and so on). I suppose it is not for no reason that Netflix is famously using FreeBSD for their content delivery.

However, there are still challenges especially when running FreeBSD on personal computers. In particular, there are problems related to missing or not fully developed device drivers, although I feel like the project is now moving in the right direction.

While I have outlined some of the differences between these OSes, I feel like the things they have in common - open-source, Unix-likeness and portability - are much more important. These are after all some of the factors I value the most in OSes.

I hope this goes some way to explain why a longtime GNU/Linux enthusiast like myself might be interested in learning more about FreeBSD. If you would like to explore this topic further, I can recommend the below articles whose authors are far more experienced than I.

Addendum: But what about databases?

Almost not a single word about databases so far!

For someone who has been following open-source database systems for a while, it might be interesting to note: 1) How well MySQL aligns with GNU/Linux, and 2) how well PostgreSQL lines up with FreeBSD:

  • Licences: GNU/Linux and MySQL have copyleft (GPL-style) open-source licences whereas FreeBSD and PostgreSQL both have permissive open-source licences.
  • Standards: FreeBSD and PostgreSQL are considered to be very standards-compliant (POSIX and the SQL Standard). On the other hand, both GNU/Linux and MySQL have long been considered to be more relaxed about their standards-compliance.
  • Fun fact: The original authors of both the Linux kernel and MySQL come from Finland: Torvalds and Widenius were both born in Helsinki and both belong to the Swedish-speaking minority. On the other hand, both FreeBSD and PostgreSQL have their roots at UC Berkeley and therefore have 'The Regents of the University of California' amongst their copyright holders.

Does this mean that MySQL is "the Linux database system" and that PostgreSQL is "the FreeBSD database system"? Not exactly! As far as I know, PostgreSQL is widely used in the GNU/Linux world and MySQL is widely used in the FreeBSD world. Also, these are of course not the only database systems around, although they have been and continue to be very dominant. But, let's not forget that Linux and MySQL provided the 'L' and 'M' letters in the LAMP stack. And, everything else being equal, I do suspect someone who is personally invested in one of the two OSes might tend to lean more towards a database system whose licence is more compatible with the licence of their OS.