UNIX: Old School

Experience historical UNIX releases first-hand using the SIMH simulator on Linux.
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.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Addition to makefile

Anonymous's picture

Great article! FYI for others: in order to get the simh binaries to compile on my Linux box (Ubuntu 7.04), I had to add the following line just below the '#Unix Environments' line b/c clock_res is in the real time library:

LDFLAGS = -lrt

Great

Marek Brunda's picture

Really great!

Nice post

nerio's picture

I want to use an old UNIX system, this is a great post, it's really cool, thanks, great work, greetings!!

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix