
A researcher has recovered the oldest known machine-readable version of Unix yet, an early Unix version 2 release from 1972.
The backstory is incredible.
In 1997, Dennis Ritchie–who co-created Unix and the B and C programming languages with Ken Thompson–donated a set of “old DECtapes,” tape backups made on a Digital Equipment Corporation (DEC) PDP-11 minicomputer, to Warren Toomey. Toomey founded the Unix Heritage Society to “preserve, maintain and restore historical and non-mainstream UNIX systems.” And in the years since, Toomey and others have been trying to access the data on those tapes with varying degrees of success. A 2009 paper discusses some of that work, which included recovering early C compilers but not the long-sought first Unix kernel.
Now, however, forensic code researcher Yufeng Gao discovered even more of Unix’s history lurking on Ritchie’s tapes after undergoing “a more comprehensive analysis” and converting the tapes to the POSIX USTAR format, which allowed him to recover some deleted and overwritten files.
“I’ve managed to get a working system out of the tapes,” Yufeng reported last week. “The s1 tape is a UNIX INIT DECtape containing the kernel, while s2 includes most of the distribution files. The s1 kernel is, to date, the earliest machine-readable UNIX kernel, sitting between V1 and V2.”
How early is this code? It dates back to 1972 and because it predates the creation of the C programming language, it represents a version of Unix so old that it was written in PDP-11 assembly language. The Register notes that its essentially an in-progress version of Unix V2 that didn’t yet include any V2 API calls. It is what Yufeng calls a “V2 beta.” “It aligns with V1 in terms of syscalls,” he writes, but “has the V2 core size and can run V2 binaries.”
Yufeng was able to get this Unix “V2 beta” up and running on a specific PDP-11 emulator that he says is the only one he’s found capable of booting it. He’s made the disk image available on GitHub, along with a more detailed explanation of the work he did and the files found in the image.
“Research-UNIX-V2-Beta is a research UNIX V2 beta from 1972 brought back to life,” he writes on GitHub. “This copy of Research UNIX is dated mid-1972 and sits between V1 and V2 … It is the earliest surviving version of UNIX in machine-readable form.”
Unix was created in 1969 for the DEC PDP-7, an 18-bit curiosity dating back to 1965. Originally called Unics, it was written in DEC assembly language and hosted the first computer game, Space Travel. The source code for Unix V1–it didn’t really have a version number at the time–was restored using scanned source code listings, and that source code can be found on GitHub as well. But V2 was the first version ported to other computers, including the PDP-11.
That researchers are still pulling information out of Ritchie’s original tapes all these years later is rather astonishing.
“The files here were read from old DECtapes made in the early 1970s,” Ritchie wrote in 1997. “I haven’t cracked this [s1] yet … s2 [is] not source, but a dump of (parts of) /bin, /etc, /usr/lib, and bits of a few other directories. The tape … is dangerous to extract unless you want to install old PDP-11 binaries.”
That is exactly what the researchers wanted to do. And now they have.