Preview Mode Links will not work in preview mode

Episode 5 Notes - How much has UNIX changed?

Jun 3, 2019

UNIX-like systems have dominated computing for decades, and with the rise of the internet and mobile devices their reach has become even larger. True, most systems now use more modern OSs like Linux, but how much has the UNIX-like landscape changed since the early days?

So, my question was this: how close is a modern *NIX userland to some of the earliest UNIX releases? To do this I'm going to compare a few key points of a modern Linux system with the earliest UNIX documentation I can get my hands on. The doc I am going to be covering(https://www.tuhs.org/Archive/Distributions/Research/Dennis_v1/UNIX_ProgrammersManual_Nov71.pdf) is from November 1971, predating v1 of the system.

I think the best place to start this comparison is to look at one of the highest-profile parts of the OS, that being the file system. Under the hood modern EXT file systems are completely different from the early UNIX file systems. However, they are still presented in basically the same way, as a heirerarchicat structure of directories with device files. So paths still look identical, and navigating the file system still functions the same. Often used commands like `ls`, `cp`, `mv`, `du`, and `df` function the same. So are `mount` and `umount`. But, there are some key differences. For instance, `cd` didn't exist, yet instead `chdir` filled its place. Also, `chmod` is somewhat different. Instead of the usual 3-digit octal codes for permissions, this older version only uses 2 digits. Really, that difference is due to the underlying file system using a different permission set than modern systems. For the most part, all the file handling is actually pretty close to a Linux system from 2019.

The other really high-profile part of any *NIX system in the shell. This '71 version of UNIX already has a user-land shell: `sh`. A lot of Linux distros actually still default to using a much newer version of `sh`. But, the question is how much of that shell was already set in stone in the early 70s? Surprisingly, a lot. The basic layout of commands is totally unchanges: command followed by arguments and switches. Both `;` and `&` still function as command separators. File input and output redirects are still represented with `<` and `>` respectively. The biggest difference is there are no pipes, those won't appear on UNIX until at least 1973. Also, `sh` can already run script files in '71. Overall, I'm shocked by how similar the shell seems to today's version.

So superficially, this pre-release of UNIX looks remarkably close to a modern system. But what about programming utilities? This is where some big changes start to appear. First off, you won't find any C compiler here. UNIX wouldn't switch from assembly to C for another few years. I decided for this comparison to take a look at a fresh Debian 9.9.0 install(released April, 2019). The assembler, `as` still exists, but obviously for a different target than the PDP-11 used in '71. A liniker, `ld`, is still present and accounted for today. However, text editor, `ed`, is nowhere to be found in Debian. The same goes for the FORTRAN compiler `for`, nowadays `for` is used for loops instead of compiling mathematics programs. Something that surprised me to even see in the UNIX documentation was `bas`, a basic interpreter. Obviously, `bas` is not in the standard Debian install list today. Another relic is the `B` compiler described in the documentation(Just as a side note, in the command index it shows a lowercase `b` but capitalizes it in the actual man page).

Overall, it would appear that the core UNIX-like experience has changed little. A lot of the tech under the hood has been completely revamped many times over, but the core way we interact with the system and most of the commands that come stock have remained the same since the 1970s. As a final note, I was blown away by just how much the very earliest man pages resemble current man pages. As an example, here is a side-by-side of `ls` from 1971 on the left, and `man ls` from Debian 9.9.0 on the right.