The BSD Family
While Linux is the most popular open-source OS, the BSD (Berkeley Software Distribution) systems are often considered the most refined. Unlike Linux, which is just a kernel, each BSD is developed as a “Complete OS”—the kernel, the drivers, and the core tools (like the shell and compiler) are all managed by a single team in a single code repository.
The Three Great Pillars
There are dozens of BSD variants, but they almost all descend from the work of UC Berkeley. The “Big Three” each focus on a specific engineering goal.
1. FreeBSD: Performance and Features
FreeBSD is the most widely used BSD. It is designed for high-performance servers and workstations.
- Netflix: Almost every byte of video you watch on Netflix is served by a FreeBSD machine. Why? Because FreeBSD’s network stack is significantly faster and more efficient than Linux’s for high-bandwidth streaming.
- ZFS: FreeBSD was the first open-source OS to perfectly integrate ZFS, the “God File System,” which includes features like data self-healing and instant snapshots.
2. OpenBSD: Security above All
OpenBSD’s motto is: “Only two remote holes in the default install, in a heck of a long time.”
- Proactive Auditing: The team manually reads every single line of code in the OS looking for bugs.
- Pioneering Tech: Many security features you use today (like OpenSSH, ASLR, and Pledge/Unveil) were invented or popularized by OpenBSD. It is the “gold standard” for firewalls and secure gateways.
Below is a C implementation using OpenBSD’s unique pledge system call to restrict system resources, illustrating proactive capability-based security:
#include <unistd.h>
#include <stdio.h>
#include <err.h>
int main(void) {
// Restrict system calls to basic input/output (stdio) and read-only paths (rpath)
if (pledge("stdio rpath", NULL) == -1) {
err(1, "pledge restriction failed");
}
printf("Pledge initialized. This process can no longer execute commands or use sockets.\n");
// Any attempt to spawn a shell (execve) will result in immediate termination by the kernel
return 0;
}
3. NetBSD: Portability Extreme
NetBSD’s motto is: “Of course it runs NetBSD.”
- It is designed to be highly portable. It runs on more than 50 different hardware architectures, from ancient VAX mainframes to modern ARM processors.
- If you have a toaster or a weird old NASA computer, NetBSD is the OS most likely to run on it.
The BSD License vs the GPL
The biggest difference between Linux and BSD isn’t the code; it’s the License.
- Linux (GPL): If you modify the kernel, you must share your changes.
- BSD License: You can do whatever you want. You can take the BSD code, modify it, keep it secret, and sell it for a billion dollars.
The Commercial Impact
Because of the permissive license, many companies use BSD as the “base” for their proprietary products:
- Sony PlayStation: The OS on the PS4 and PS5 is based on FreeBSD.
- Apple macOS/iOS: As we saw earlier, the core of Darwin is heavily based on FreeBSD code.
- Juniper Networks: Their high-end internet routers run Junos OS, which is based on FreeBSD.
Compare the copyright headers below showing the permissive BSD copyright versus the copyleft GPL requirement:
/* 2-Clause BSD License Header */
Copyright (c) 2026, The FreeBSD Project.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice.
2. Redistributions in binary form must reproduce the above copyright notice.
/* GNU General Public License (GPL) Header */
Copyright (c) 2026, Linus Torvalds.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
BSD Architecture: The “Base” Concept
In Linux, if you want to know what version of ls you are using, you have to check if it’s the GNU version or the Alpine version. In BSD, ls is part of the “Base System.”
This centralized approach means that BSD systems feel more “cohesive.” The documentation (the Man Pages) is legendary for its accuracy because the person who wrote the code is usually the one who wrote the documentation in the same repo.
Rebuilding the entire OS from source in BSD can be accomplished with a unified command sequence within the system source tree:
# Atomic rebuild of the FreeBSD base operating system and kernel from source
cd /usr/src
make buildworld # Compile standard libraries, compilers, and base utilities
make buildkernel # Compile the FreeBSD kernel binary
make installkernel # Install the fresh kernel to /boot
make installworld # Install base libraries and utilities
Jails: The Father of Containers
Long before Docker existed, FreeBSD introduced Jails in the year 2000. A Jail is a way to partition a computer into several independent “mini-computers.” Each jail has its own files, users, and network address, but they all share the same kernel. This provided a level of security and resource efficiency that took Linux nearly a decade to match with Namespaces.
An example of a jail configuration defined in /etc/jail.conf shows how isolation is declared natively on FreeBSD:
# /etc/jail.conf - Declarative FreeBSD Jails Configuration
webserver {
path = "/usr/jails/webserver";
ip4.addr = 192.168.1.50;
host.hostname = "webserver.local";
mount.devfs;
exec.start = "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown";
}
Why use BSD over Linux?
- Documentation: BSD documentation is vastly superior for professional system administrators.
- Stability: The “Base System” doesn’t change every week. You can set up a server and expect it to work exactly the same way for 10 years.
- Networking: If you are building a router, firewall, or streaming server, the BSD network stack is often the best choice.
Below is an example of an OpenBSD Packet Filter (pf.conf) firewall configuration, showing the clean syntax used to control interface routing and filtering:
# /etc/pf.conf - OpenBSD Packet Filter Configuration
block in all # Block all incoming traffic by default
pass out all # Allow all outgoing traffic to proceed
pass in on egress proto tcp to any port { 80, 443 } # Permit incoming HTTP/S
Interactive Practice: Comparing Licenses and Architectures
Test your understanding of the BSD licensing model and codebase organization.
Which of the following describes the key difference between the BSD license and the GNU General Public License (GPL)?
References & Further Reading
- FreeBSD Project (Official homepage)
- OpenBSD Project (Official homepage)
- NetBSD Project (Official homepage)
- Berkeley Software Distribution (Wikipedia, CC-BY-SA 4.0)
- McKusick, M. K., Neville-Neil, G. V., & Watson, R. N. M. (2014). The Design and Implementation of the FreeBSD Operating System (2nd ed.). Addison-Wesley Professional.