Friday, September 20, 2024

Ancient Unix

I had noticed The Computer History Simulation Project some time ago, but I never got around to doing anything with it. This July Fourth, with nothing else pressing me, I decided to take a more in depth look.

The first thing was to download the sources for the SIMH emulator. Create a directory, unzip the sources, “mkdir BIN” and then just do a “make all”. Don’t neglect the “mkdir BIN”; you need that. This took a fair amount of time on my MacBook Pro – you could just make the actual emulators you want, but that can sometimes be hard to figure out.

Doing this compiles without networking support. If you must have that (I see no reason for the messing around I’m doing), you apparently need libpcap; I assume the one from DarwinPorts will do, but I didn’t try it.

I started with Unix System 5 from the Software Kits page. Create a directory for that, unzip the Unix V5 kit, and copy BIN/pdp11 into it. Finally, create “pdp11.ini” to contain:

set cpu U18
attach rk0 unix_v5_rk.dsk
boot rk0

Unix V5 is pretty raw stuff. The shell is primitive, no backspace handling, and certainly no command history. It annoyingly uses “chdir” rather than “cd”. I fixed that by finding the source (/usr/source/s2/sh.c) and copying it to “mysh.c”. I then did “ed mysh.c”.

Amazingly enough, I remembered enough “ed” to do what I wanted:

# cp sh.c mysh.c
# ed mysh.c
11135
/chdir/p
if(equal(cp1, "chdir")) {
s/chdir/cd/p
if(equal(cp1, "cd")) {
w
11132
q

I then did “cc mysh.c;cp a.out /bin/mysh;/bin/mysh”. I could now at least use “cd”.

But there’s not much else you can do. There are no man pages, so the only way to figure out how commands work is to paw through the source. As most of the source is charmingly simple, that’s not a great hardship, but you probably won’t spend a great deal of time here without frustration (unless you are old enough to have used this and have a better memory than I).

Exit the simulator with CTRL-E and “quit”. I next downloaded the Unix V7 kit, which requires the “id32” emulator. My “id32.ini” file contains (as per iu7_readme.txt):

set ttp ena
set pas dev=12
att -e dp0 iu7_dp0.dsk
att -e dp1 iu7_dp1.dsk
boot dp0

Type “dsk(1,0)unix” at the Boot: prompt, do CTRL-D at the single-user prompt, and then login as “root” with password “root”, and you have something a little more like a modern Unix system. No, I’m kidding. Yes, at least there are man pages (though they just spill out on the screen and there is no “more” to pipe them to). There is still not much else: it’s still “ed” and this time the source for commands is not installed. If you are old enough to have used Tandy Model 16 Xenix, you’ll see that this isn’t all that far removed from that. The minimalist /etc/rc contains only 14 lines; it uses /etc/ttys and not inittab.

My, we have come a long way, haven’t we?

*Originally published at APLawrence.com

A.P. Lawrence provides SCO Unix and Linux consulting services http://www.pcunix.com

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles

City ave maria. What is third party intent data ?.