Running and administrating a 2.11 BSD system
2.11 BSD is a fun beast of an OS. Originally intended to not exist, it is probably the pinnacle of the jankiest possible hacks to shove an OS (4.3BSD-Tahoe) intended for much more powerful machines (VAX superminis and the POWER 6/32) in the smallest possible space. I’d say it used every trick in the book, but that’s probably not doing it justice. It probably wrote most of the book, and then some.
2.11 BSD is also fun for another reason: it’s still maintained. Last patch was a few days ago. It’s actually getting more patches now in the 2020s than almost all of the 2010s. Including some frankly ridiculous ones. For an OS that runs on minicomputers originally released in 1975 (with networking), it certainly punches above its weight!
So, let’s get to running!
Booting the system #
At first what I did was install from tape on an emulated PDP-11/70. This was a terrible idea for one simple reason, one of the many hacks involved in getting 2.11BSD to run is kernel overlays. Kernel overlays divide and swap in parts of the kernel dynamically. However, these kernel overlays are manually defined in the kernel makefile. The system installed, but had no networking. Attempting to add networking led to linker failures because my kernel was too big. Eventually, I said fuck it and started from scratch, learning my lesson to never roll my own kernel config again.
So I grabbed a premade install and started rolling. The system already had networking configured, but I changed it to NAT and edited /etc/netstart to reflect the SIMH NAT network configuration. Networking then started working pretty well. Onto the next stage.
Patching the system #
My install was moderately out of date. Much better than most systems but still pretty out of date. It was time to fix that. All the patches are stored on FTP, and 2.11BSD has an FTP client. Simple enough. Pointing FTP at the FTP server worked, until I tried to grab any files.
My FTP client doesn’t support passive mode. Oops.
Luckily, there is source for an FTP client with PASV floating around. Attaching the tar archive to SIMH and using tar x was a quick and painless solution. We have FTP!
I grabbed every patch from FTP, wrote a quick sed script to remove the patch notes from the files, slowly but surely patched my system all the way up to the latest version. A few times I had to recompile the kernel, but being already configured for my hardware made it a quick and painless process. It took several hours but was prety easy, besides having to restart once or twice to free up more RAM to compile the kernel, even on my machine with a gargantuan 4 megabytes of RAM! The patch instructions are very well written and overall anyone with a small bit of UNIX knowledge could easily do this too.
On the latest patch, I decided to remove some of the original configuration. I removed a few lines from hosts and changed my hostname from pdp11.home.lan to just pdp11. And broke networking again. Oops. Turns out I had set my hosts file wrong and the system was using itself as the default gateway. 20 minutes of debugging later and I was back online.
Now all of this was pretty sane. The next part, we are not so blessed for.
Seeing what builds #
2.11BSD is in an awkward position. It has a lot of modernizing patches but still is not a very modern sysetem. It’s in a limbo state that makes getting new software very difficult.
Simple period software builds fine. But complex software starts to have a lot of issues very quickly.
Getting IRC working was a chore. ircII reportedly is too big to compile, so I aimed a little bit lower and tried to compile a one-file IRC client called TinyIRC on ftp.funet.fi. It compiled fine, but didn’t work on Libera. Protocol changes, I guess. I then decided to try smallirc, another one-file IRC client but with a few more bells and whistles. Same thing. Poking around I heard of a mythical smallirc 1.1 beta that worked fine on more modern (as of 1996 lmao) IRC servers. After spending several hours digging, I finally tracked down the accursed thing on a faraway corner of an FTP archive. Compiling it went without a hitch, but it still didn’t work. However, the error returned was different and it was a sign of a less egregious protocol drift. 5 minutes of hammering later and I had IRC! It’s fully functional for sending messages to a channel, and what more can you expect from a program that’s barely 1200 SLoC in C?
Then, I tried to get a kermit binary. After pasting a uuencoded binary, it crashed with a bad system call error. Damn it. I decided to shelve this and try and compile some software I could get off of FTP. So I took a crack at pdksh. Running configure worked fine, and then running make proceeded to core dump (I think it was a bus error?) so I decided to get a different make. Grabbing a version of GNU make that worked on 2.11BSD’s sister OS, 4.3BSD, started to compile and then failed with compiler errors pretty rapidly. Damn. I then decided to try and scrap using the BSD cc compiler and make a more compliant C compiler, gcc. It then failed to configure repeatedly with a completely baffling “no space” error. I don’t even get this one: There was still plenty of RAM, and plenty of disk space. So I said screw it and shelved it.
It didn’t help that most archives of comp.sources.unix are all gzipped now, which I also cannot compile on 2.11BSD! Didn’t stop me from trying though. I tried compiling gunzip to little success. Then I saw 4.3BSD-Quasijarus added a format of strong compressed archives to compress that was compatible with gzip. Trying to hack it to install on 2.11BSD was, however, a monumental waste of my time and a complete failure. Another several hours wasted. Then, an idea hit me. A very stupid one, that might just work.
I have networking, fully functional networking. And a recent patch on 2.11BSD added netcat. What if I send gzip over netcat to a server, which decompressed the archive and sent back the uncompressed data? And thus, the gzip server was born. I can now send gzip files over the network to the host machine, and a python script will decompress them and send them back! Finally! Gzip “on” 2.11BSD!
Now, I can gunzip any gzip archive I grab off of FTP! Success! I proceeded to then compile a forth interpreter and a few other things I grabbed off of comp.sources.unix. I also made a sed script to automatically remove the USENET message headers from files, those things can get pretty massive. Removing them with vi is just a pain.
Conclusion #
The system is still currently running with 4 users. I can now get old software to compile if its not too messsed up. It’s a very impressive system for what it is, and it’s probably the single most currently supported ancient UNIX around. I’m going to try and get ksh compiled and some other odds and ends. It’s a very quirky system, but that’s to be expected from a system shoved onto a PDP-11 with full networking, especially one that predates most of the common UNIX standards!