Photo by Jr Korpa / Unsplash

Introduction to the BSD World

Aug 14, 2021

Almost everyone in the tech sector is familiar with Linux in some capacity. Their use of it may be on the server as a sysadmin, Android phone user, desktop experience, deploying a micro-service via the cloud or in the embedded space. In some way, shape, or form, everyone in the tech sector (and anyone who has interfaced with the internet) has touched Linux server. However, there is a lesser known group of Free and Opened Sourced operating system out there in the wild that is often forgotten about or misunderstood: the Berkeley Standard Distribution (BSD) based operating systems.

The History of BSD

The initial story of BSD starts out shortly after the arrival of UNIX in the world. Some may know the story. Dennis Richtie, Ken Thompson, and couple of others hacked away at created an operating system inspired by their work on MULTICs on a PDP-7, and thus, UNIX was born, along with the C programming language. However, AT&T and BellLabs were not able to sell this as part of a prior lawsuit that cut them out of directly competing in the software space due to their pretty much government granted monopoly in telecommunications. So, BellLabs and AT&T essentially started giving it out to research universities and even people who wrote them letters asking for it.

Originally UNIX was only written for the PDP-7, but due to the flexibility of the C programming language, it would be easy (or at least easier than before C) to port it to new machines. As research universities got ahold of it, they often had to modify and port it to their own machines if they did not have a PDP-7.

Now, the story takes up to Berkeley. Berkeley ported and continued to do operating system research by continuing their own development on the copy of UNIX they received, and thus BSD was born.

Fast forwarding to the late 80s, Berkeley began to focus less on BSD and users at Berkeley had wish to bring it more out into the open essentially. Then happened 386BSD and lawsuits upon the release of source code. Long story short, BSD was held back due to lawsuits. Interestingly enough, if these lawsuits had not occurred, Linux would not have been created. As Linus Torvalds created his kernel in order to get a UNIX or UNIX like operating system for his 386 machine. Since the BSD was being held up in court, he decided to do his own clean room implementation (using no original UNIX source). Hence why Linux is referred to as UNIX-like. From the user perspective (at the time), it was no different or virtually no different than a UNIX machine. However code wise, that was not the case.

As lawsuits were going on and BSD was coming out of the research lab, projects began to form. Depending on where one starts the count, NetBSD or FreeBSD was the first. Then later on Theo forked NetBSD to create OpenBSD. Each one has a niche they rather serve. FreeBSD focused on speed and general usability more. NetBSD made a point to focus on keeping with BSD 4.2 design principles and portability and OpenBSD was focused on developing a secure operating system (not even risking security for performance).

Due to the lawsuits holding back the development of BSD operating systems, Linux took hold among computer enthusiasts, and later on started to become adopted in the server world at an exponential speed.

What is BSD?

Now, down to more technical details. Each flavor of BSD is its own independent operating system. While they all have the same origin, they all have diverged off of that path. Neither of the big 3 BSDs (Free, Net, and Open) are binary compatible and have changed their tooling., and to explain this, one needs to look at licensing.

A lot of tech users are probably aware of the GNU GPL. The gist of the GPL, without diving into GPLv2, GPLv3, AGPL or LGPL, is that software is Free and Opened Source, but modifications have to be contributed upstream or made public.

The BSDs make use of the BSD-license or like minded license (OpenBSD prefers the ISC, as an example). The short version of the BSD license is that software is made Free and Opened Sourced, but code changes are not required to be upstreamed and do not have to stay open sourced. One can compile FreeBSD from source, slap a new name, change branding, and sell it. Examples of this are the PlayStation (3/4/5) which use FreeBSD as the base of the operating system and Apple's Airport Extreme, which ran NetBSD. Even Apple's MacOS is essentially just a fusion of different components of UNIX derivatives like Mach and BSD.

So we've covered the licenses, but why have they diverged? The various BSDs are meant to be absorbed by the user as a full and complete operating system. FreeBSD owns their stack from bootloader to kernel to userland tools. However, this is not the case on Linux. Linux is just a Kernel, and every distro of Linux is usually that kernel, GNU userland tools (think ls, top, cd), and various other software pieces. Linux is a mix of software from separate projects all pieced together. Think about GNOME as an example, which is a separate and independent project that just happens to so work closely with Linux. In BSD land, OpenBSD works on their own version of their init system or ls and it is not kept in lock step with GNU tools (GNU ls), FreeBSD ls/init or NetBSD init/ls.

This article is not to convince someone to start using BSD, more of less to introduce people to BSD and a little history, and to understand the how and why. This is not total and comprehensive, but it gives a good introduction to the world of BSD and why it is different while also maybe giving some interesting history to the reader.

Todd Martin

Software engineering student who likes hardware, NetBSD, FOSS, and learning. Feel free to also check out some of my work with AdvanceBSD.