UNIX: Old School

by Matthew Hoskins

I have been called “nostalgic beyond my years” by some, and I suppose that is accurate. I was born in 1976 and have always had a voracious appetite for early minicomputer and mainframe history. I believe recorded history itself is the single-most important innovation of human existence. We humans seem to have a hard-wired compulsion to record, pass on and learn from the mistakes and successes of those before us. Open-source software is the natural evolution of this concept applied to computer technology. In the Open Source philosophy, we are all free to learn from the wealth of software created by the masses that came before us. By examining the evolution of a project, we can learn from the mistakes of others and, perhaps most important, copy verbatim from their successes. By harnessing this freely available history as well as unfettered cooperation, we advance the common good.

Recently, companies have begun to loosen their grip on their early computing “intellectual property”. Although some have not fully embraced open source, these sometimes small, token gestures offer us a wealth of knowledge. In this article, I focus on how we can explore early operating system history by running “historic” UNIX releases on our very own Linux boxes using a simulator. The SCO Group (Yes, “them”, previously Caldera, Inc.) claims current ownership of early UNIXes and has released them under an “Ancient Unix” license, which allows for noncommercial use. I focus here on the UNIX V5 release, because it is the earliest available. UNIX V6, V7 and various early BSD releases are also available. If you plan on trying out any of these OSes, examine the licenses included with each before booting them up.

Stranger in a Strange Land: the UNIX V5 User Environment

The UNIX V5 system provided in the disk image is rather stark and unfriendly compared to modern, lush UNIX/Linux systems. Here are a few pointers to get you started:

  • sh is the shell. It's only 858 lines of C; don't expect it to work like bash.

  • Use chdir to change the default directory.

  • Backspace and arrow keys rarely work.

  • ed is the text editor; see en.wikipedia.org/wiki/Ed.

  • bas is a basic interpreter.

  • fc is a FORTRAN interpreter.

  • cc is the C compiler.

  • Source code is in /usr/source.

  • There are not many files, so use find / -print to see what else is included.

In order to explore these OSes, we need to be able to run them on commonly available computing hardware. Luckily, we have simulators for this purpose. Because of its quality and depth of support, one of the most popular simulators is SIMH, available from the SIMH Web site (see the on-line Resources). SIMH runs on every popular *nix OS, as well as Microsoft Windows, and is capable of simulating a wide range of early computer systems, including Digital Equipment Corp.'s PDP and VAX systems, the MITS Altair, early IBM systems and many more. Some of the most historically significant systems are DEC's PDP series, the birth-system of UNIX.

SIMH is a ground-up system simulator; it simulates the CPU, memory, firmware and devices of a number of early computer systems. This means that original distributed software can run unmodified on these simulated systems. SIMH successfully simulates devices such as disks, tape drives, printers and networking devices. This means that not only can we run these historic systems, but we can communicate and transfer data to and from them using modern technologies and protocols. A great deal of thanks is owed to the contributors of SIMH. Their decision to contribute and release under open source furthers all our understanding of our history and guarantees that this history will always be free.

Getting Started: Installing SIMH

Download the latest SIMH release, V3.4-0 at the time of this writing, compile and install. If you want to use Ethernet emulation, you may need to upgrade the libpcap library bundled with your OS as most currently distributed versions are too old. The SIMH installation documents explain how to do this, and you can skip this step if you're not going to be using networking support on your simulated machines. Compiling can be done as any user and is as simple as:

$ mkdir simh
$ cd simh
$ unzip /path/to/simhv34-0.zip
$ mkdir BIN  # Note all CAPS
$ gmake USE_NETWORK=1 all
# Only include USE_NETWORK=1 if your PCAP lib is up to date.

(compilation chatter omitted)
$ ls -l ./BIN/
total 11624
-rwxrwxr-x  1 matt matt  301959 Jul 16 18:45 altair
-rwxrwxr-x  1 matt matt  482274 Jul 16 18:45 altairz80
-rwxrwxr-x  1 matt matt  529317 Jul 16 18:44 eclipse
-rwxrwxr-x  1 matt matt  297590 Jul 16 18:45 gri
-rwxrwxr-x  1 matt matt  375737 Jul 16 18:44 h316
-rwxrwxr-x  1 matt matt  577678 Jul 16 18:44 hp2100
-rwxrwxr-x  1 matt matt  355225 Jul 16 18:44 i1401
-rwxrwxr-x  1 matt matt  381672 Jul 16 18:45 i1620
-rwxrwxr-x  1 matt matt  441079 Jul 16 18:46 ibm1130
-rwxrwxr-x  1 matt matt  502037 Jul 16 18:46 id16
-rwxrwxr-x  1 matt matt  508378 Jul 16 18:46 id32
-rwxrwxr-x  1 matt matt  294614 Jul 16 18:46 lgp
-rwxrwxr-x  1 matt matt  434940 Jul 16 18:44 nova
-rwxrwxr-x  1 matt matt  345034 Jul 16 18:41 pdp1
-rwxrwxr-x  1 matt matt  752055 Jul 16 18:43 pdp10
-rwxrwxr-x  1 matt matt 1055376 Jul 16 18:43 pdp11
-rwxrwxr-x  1 matt matt  474153 Jul 16 18:42 pdp15
-rwxrwxr-x  1 matt matt  459203 Jul 16 18:41 pdp4
-rwxrwxr-x  1 matt matt  460363 Jul 16 18:41 pdp7
-rwxrwxr-x  1 matt matt  499473 Jul 16 18:42 pdp8
-rwxrwxr-x  1 matt matt  467662 Jul 16 18:42 pdp9
-rwxrwxr-x  1 matt matt  352233 Jul 16 18:45 s3
-rwxrwxr-x  1 matt matt  429312 Jul 16 18:46 sds
-rwxrwxr-x  1 matt matt  982694 Jul 16 18:43 vax

This builds all possible system simulators. Each simulator becomes a separate binary in the ./BIN/ directory. SIMH can be run as any normal user, but if you want to use Ethernet network simulation, you need to execute it as root (under UNIX) to allow libpcap access to the Ethernet device.

Running UNIX V5

UNIX V5, released in June 1974, was still very early in UNIX development at Bell Labs. Much of the system was still written in assembler. This disk image includes a working C compiler (cc) and a great deal of interesting source code under /usr/source. To begin our exploration, we must download the UNIX V5 disk image (see Resources). This zip archive contains the pre-installed image file as well as a README and file containing license information. The disk image is a snapshot of a working installed system. In this case, it is simulating an RK05 disk drive. We must now collect the pieces we need to get this system booted. Begin by creating a directory, then copy the BIN/pdp11 binary from under the SIMH build directory as well as the contents of the uv5swre.zip archive uncompressed. Then, create a pdp11.ini file to control the simulator, using an editor of your choice, and place the following lines in the ini file:

set cpu U18
attach rk0 unix_v5_rk.dsk
boot rk0

This tells the simulator what kind of CPU to emulate and to attach the unix_v5_rk.dsk file as a simulated RK-style disk using the rk0 device name. Finally, this file tells the simulator to boot the OS image on that disk.

Your simulator directory should look like the following:

-rw-rw-r--  1 matt matt   12299 Jan 24  2002 AncientUnix.pdf
-rwxrwxr-x  1 matt matt  913614 Jul 22 19:33 pdp11
-rw-rw-r--  1 matt matt      47 Jul 22 23:59 pdp11.ini
-rw-rw-r--  1 matt matt     263 Nov 25  1996 README.txt
-rw-rw-r--  1 matt matt 2494464 Jul 23 00:39 unix_v5_rk.dsk

To boot up UNIX V5, simply type ./pdp11 in the current directory, then when prompted, type unix at the @ prompt. You almost immediately will get the login: prompt; there was not much in the way of boot messages in these old UNIXes. There is no root password, so you will be given a command prompt. Your session could look as follows:


$ ./pdp11

PDP-11 simulator V3.4-0
Disabling XQ
@unix

login: root

# ls -l /
total 60
drwxr-xr-x  2 bin       944 Nov 26 18:13 bin
drwxr-xr-x  2 bin        80 Nov 26 18:13 dev
drwxr-xr-x  2 bin       240 Mar 21 12:07 etc
drwxr-xr-x  2 bin       224 Nov 26 18:13 lib
drwxr-xr-x  2 bin        32 Nov 26 18:13 mnt
drwxrwxrwx  2 bin       112 Mar 21 12:11 tmp
-rwxrwxrwx  1 bin     25802 Mar 21 12:07 unix
drwxr-xr-x 14 bin       224 Nov 26 18:13 usr

# chdir /usr/source/s1

# cat echo.c
main(argc, argv)
int argc;
char *argv[];
{
        int i;

        argc--;
        for(i=1; i<=argc; i++)
                printf("%s%c", argv[i], i==argc? '\n': ' ');
}

# cc echo.c

# mv a.out newecho

# ./newecho Hello World
Hello World

# chdir /tmp

# cat >hello.c
main()
{
   printf ("Hello World!\n");
}

# cc hello.c

# ./a.out
Hello World!

# cat >hello.b
10 print "Hello World!"

# bas hello.b
run
Hello World!

That's it; you're up and running. You have officially set your fingers on a “real” historical UNIX system. As you can see, there is plenty of source code to look over and a working compiler to play with. UNIX V5 is only one of the early operating systems you can explore with SIMH. On the SIMH Web site, you will find a repository of disk images for other systems.

If you are interested in seeing what a PDP-11 system and RK05 disk actually looked like, take a look at the photo gallery on the SIMH Web site (see Resources). Also, try searching Google Images for a wealth of great photographs.

Resources for this article: /article/8587.

Matthew Hoskins is a Senior UNIX System Administrator for The New Jersey Institute of Technology where he maintains many of the corporate administrative systems. He enjoys trying to get wildly different systems and software working together, usually with a thin layer of Perl (locally known as “MattGlue”). When not hacking systems, he can often be found hacking in the kitchen. Matt can be reached at matt@njit.edu.

Load Disqus comments