<h1 >UNIX, Linux, and BSD</h1>
<blockquote><p><q>Linux was created by PC users attempting to use mainframe UNIX. BSD was created by mainframe UNIX users attempting to use a PC.</q></p></blockquote>
<p>BSD is what I like to call a “Pedigree UNIX”, meaning that it is a pure blooded descendant of AT&amp;T UNIX. Although all of the original AT&amp;T code has been re-written so a permissive license, the heritage persists.</p>
<p>In contrast to Linux (which shares no original Bell Labs code), BSD was originally all Labs code.</p>
<h1 >BSD in the wild</h1>
<p>BSD style licensing is quite simple to understand compared to the tome that is the GPL. Interpreting it usually goes something like follows:</p>
<blockquote><p><q>Do whatever the hell you want with this code, just don’t blame me when it breaks something and don’t claim you wrote it</q></p></blockquote>
<p>Permissive licensing means that various companies can put lipstick on the UNIX pig and falsely assert that it’s anything other than lipstick on the UNIX pig. Not that UNIX is a pig, but you cannot disguise a pig with lipstick. Those burdened with the gift of sight and knowledge can spot a UNIX system quite easily.</p>
<ul >
<li>Apple software is basically stolen BSD</li>
<li>Windows TCP/IP stack (and ftp/rcp/rsh/ssh/scp and other various non-trash networking protocols) is basically stolen BSD</li>
<li>Sony PlayStation is basically stolen BSD</li>
<li>Nintendo switch is basically stolen BSD</li>
<li>a million others that I can’t be bothered to list because they’re either abandonware or are embedded in your e-toaster and internet enabled dishwasher so no one cares</li>
</ul>
<h1 >Interacting with BSD guys</h1>
<p>Most Linux enthusiasts are missionaries. They are generally helpful and seek to guide the computing neophyte into the inner circle of FSF initiates.</p>
<p>The BSD guys tend to be like hermits. They don’t care if you use their code, they only care that the code works for them. When you ask for help, a typical response will be “did you even read the error logs?” or “did you even RTFM? What about supplemental documentation? We didn’t write TFM just so you could go online and ask something clearly documented in TFM.”</p>
<p>Not all BSD guys are bitter, but you really should consult available resources before asking questions</p>
<h1 >Forking vs distros</h1>
<p>In Linux land, all the distros are basically the same with varying coats of paint. We call these distributions because all “implementations” of linux are nearly identical code bases built with varying compile time options.</p>
<p>In BSD land, distros don’t exist. Free/Net/Open are entirely independent and don’t share a common upstream. They are forks of primordial BSD that run separate kernels, separate userlands, etc. Although code is shared amongst each other, a statically linked binary can’t simply be dumped from one to another and still run as it would in Linux land.</p>
<p>Meta-distos of FreeBSD do exist but they are short lived unless they have corporate backers.</p>
<h1 >Idiot’s guide to picking a BSD</h1>
<blockquote><p><q>I want basically Linux desktop out of the box but with a BSD kernel so I can look cool when I post a neofetch screenshot to the /g/ desktop thread!!</q></p></blockquote>
<p>Selecting a FreeBSD fork that comes with a desktop is your goto. The currently maintained desktop distros are HelloSystems, GhostBSD, NomadBSD, and MidnightBSD.</p>
<blockquote><p><q>I want a viable desktop operating system</q></p></blockquote>
<p>FreeBSD with a non-GNOME DE is fairly reliable. I’ve had success with KDE, XFCE, and various tiling window managers. GNOME is too reliant on systemd so the port is janky.</p>
<blockquote><p><q>I want something to learn by example with</q></p></blockquote>
<p>OpenBSD is a great learning platform. The source code for userland utils is simple, short, and generally free from OS specific function calls. RTFM goes by the wayside when you easily RTFSC.</p>
<blockquote><p><q>I want to prevent foot shooting incidents</q></p></blockquote>
<p>OpenBSD eliminates many foot shooting scenarios by being a thorn in the side of the user who wants to do stupid things</p>
<blockquote><p><q>I want to run UNIX to an obscure device</q></p></blockquote>
<p>OpenBSD runs on a lot of architectures: i386, amd64, arm64, arm7, alpha, sparc64, risc64, ppc64, etc. The devs self-host these ports (ie build the release on a physical processor instead of cross compiling). This means that the alpha port is actually built on a VAX machine, the sparc port is actually built on a sparc machine, etc.</p>
<p>NetBSD runs on everything.</p>
<blockquote><p><q>I can’t decide!!! Pick one for me!!!</q></p></blockquote>
<p>Just go with FreeBSD. It feels a lot like old Debian.</p>
<h1 >Hardware</h1>
<p>Lenovo Thinkpads are bulletproof. Buy something on ebay. Dell desktops generally work quite well. Intel components are most stable. You will suffer less if you can find a pure Intel machine. The biggest things to look for are an intel CPU, intel wireless chipset, intel integrated graphics, and an intel sticker. Vpro vs no vpro doesn’t seem to make a difference in my anecdotal experience.</p>
<blockquote><p><q>But what about a GPU????</q></p></blockquote>
<p>no.</p>
<h1 >FreeBSD</h1>
<h3 >Goal: general purpose, easy to use operating system</h3>
<h3 >Use cases: server, desktop, NAS, hypervisor</h3>
<h3 >Features:</h3>
<ul >
<li>Core OS
<ul >
<li>system feels clean and organized.
<ul >
<li>Everything required to boot the system is in /</li>
<li>Everything not required to boot the system is in /usr/local</li>
</ul></li>
<li>ZFS boot environments allow modification and upgrading without worrying</li>
<li>Familiar enough to linux users</li>
<li>System feels well integrated instead of hacked together like a GNU+/Linux</li>
</ul></li>
<li>storage
<ul >
<li>UFS is dead, long live ZFS (the only actually good RAID)</li>
<li>Disk encryption via GELI and encrypted ZVOLS</li>
</ul></li>
<li>Third party software
<ul >
<li>Largest ports system of the BSDs</li>
<li>Can install precompiled packages with the pkg utility or compile yourself via the ports tree</li>
</ul></li>
<li>Jails
<ul >
<li>Like a chroot but actually secure</li>
<li>Like docker but without the aspect of downloading random stuff from github</li>
<li>all jails share a kernel but have separate hostnames, ip addrs, etc</li>
</ul></li>
<li>Virtualization
<ul >
<li>bhyve hypervisor, similar to kvm</li>
</ul></li>
<li>Security
<ul >
<li>Capsicum (sandboxing framework)</li>
<li>ACLs</li>
</ul></li>
<li>OS compat layers
<ul >
<li>Linux compat layer (can even run steam).</li>
<li>wine</li>
</ul></li>
<li>Documentation
<ul >
<li><a href="https://docs.freebsd.org/en/books/handbook/">FreeBSD handbook</a></li>
</ul></li>
</ul>
<h3 >Detriments:</h3>
<ul >
<li>storage
<ul >
<li>UFS is not journaled by default, just use ZFS</li>
</ul></li>
<li>Virtualization
<ul >
<li>there is a virtualbox port</li>
</ul></li>
<li>Security
<ul >
<li>Fast rather than secure by default</li>
<li>read security(7) and you’ll be fine</li>
</ul></li>
</ul>
<h1 >OpenBSD</h1>
<h3 >Goal: simplicity, portability, standardization, correctness, proactive security, and integrated cryptography</h3>
<h3 >Use Cases: Networking appliances, desktops, servers</h3>
<h3 >Merits:</h3>
<ul >
<li>Core OS
<ul >
<li>webcam and microphone disabled by default</li>
</ul></li>
<li>Security
<ul >
<li>API changes to prevent foot shooting (ie strlcpy and strlcat because string functions in C are a memory leak waiting to happen).</li>
<li>kernel is randomly relinked and randomized at boot time</li>
<li>Memory protection
<ul >
<li>W^X protection means that memory is either exclusively writable or exclusively executable</li>
<li>malloc’d memory is randomly allocated (bonus: makes buggy programs segfualt loudly)</li>
</ul></li>
<li>Crypto
<ul >
<li>full disk encryption (including swap)</li>
<li>various algos</li>
<li>TCP/IP stack randomizes things to reduce predictibality</li>
</ul></li>
<li>Xenocara
<ul >
<li>X11 fork</li>
<li>privilege separation (ie all Xsessions don’t run as root)</li>
</ul></li>
<li>Pledge/unveil syscalls
<ul >
<li>pledge restricts process capabilities, kernel kills misbehaving processes</li>
<li>unveil restricts filesystem access to a minimul level</li>
</ul></li>
<li>All of the standard daemons run in a chroot with privilege separation</li>
<li>ASLR</li>
<li>A million other things</li>
</ul></li>
<li>Third party software
<ul >
<li>Everything you need is in the base system. Some of what you want is available via ports or pkg_add</li>
</ul></li>
<li>Subprojects:
<ul >
<li>CARP, doas (like sudo but less spaghetti), OpenBSD httpd, LibreSSL, OpenBGPD, OpenNTPD, OpenSMTPD, OpenSSH, pf (the only easy to use firewall), spamd (email filter that plugs into pf), a million other things</li>
</ul></li>
<li>Virtualization
<ul >
<li>vmm and vmd</li>
</ul></li>
<li>Documentation
<ul >
<li><a href="https://www.openbsd.org/faq/">FAQ</a></li>
<li><a href="https://www.openbsdhandbook.com/">Handbook</a></li>
</ul></li>
<li>Source code is the only good “learn by example” for C</li>
</ul>
<h3 >Demerits:</h3>
<ul >
<li>Security features can cause slowness</li>
<li>sometimes you can’t shoot your foot even if you really really want to</li>
<li>critics claim it’s all security theater</li>
<li>Requires opening vulnerabilities back up if you want a “Just Werks™” Linux desktop experience</li>
<li>No MAC</li>
</ul>
<h1 >NetBSD</h1>
<h3 >Goal: clean and careful design, scalability, portability</h3>
<h3 >Use cases: server, embedded, desktop if you’re a flagellant</h3>
<h3 >Features:</h3>
<ul >
<li>Portability
<ul >
<li><a href="https://netbsd.org/ports/">It actually runs everywhere</a></li>
<li>Designed for cross compiling (via build.sh)</li>
</ul></li>
<li><a href="https://www.pkgsrc.org/">pkgsrc</a>
<ul >
<li>UNIX and arch agnostic third party packing framework</li>
</ul></li>
<li>virtualization
<ul >
<li>xen</li>
<li>nvmm (similar to kvm, works with qemu)</li>
</ul></li>
<li>storage
<ul >
<li>a bunch of filesystems, including journaling UFS and ZFS</li>
<li>LVM</li>
</ul></li>
<li>entirely POSIX compliant</li>
<li>kernel is scriptable with Lua</li>
</ul>
<h3 >Demerits:</h3>
<ul >
<li>haven’t used it enough to die the death of a thousand papercuts</li>
</ul>

