Installing UNIX v6 (PDP-11) on SIMH

From Computer History Wiki
Jump to: navigation, search

I'm going to try to describe the install procedure used by Tim Newsham for Unix v6 on the PDP-11/40.

NOTE: Comments at the end of a line of the form:

[## Comment]

are just to tell you what to do when there is ambiguity; please do not type them in literally!.


Materials

I'm going to expect you to have the SIMH emulator, 3.8-1 or higher, and a Unix v6 tape Unix-v6-Ken-Wellsch.tap

Tape boot

Here we load the bootblock and load up the root partition onto the rk disk file...

First the tboot.ini file. On more recent simh builds, remove the semicolons and the comments behind them.

set cpu 11/40
set tm0 locked
attach tm0 dist.tap
attach rk0 rk0
attach rk1 rk1
attach rk2 rk2
d cpu 100000 012700        ; mov #172526,R0
d cpu 100002 172526
d cpu 100004 010040        ; mov R0,-(R0)
d cpu 100006 012740        ; mov #60003,-(R0)
d cpu 100010 060003
d cpu 100012 000777        ; br 100012
g 100000

Once this is run, the simulation will 'lock', hit CTRL+E to break the emulation, and then execute the stand alone program to prepare the hard disk. Type in:

g 0

And the stand alone program will be ready to respond. Here is my install session:

PDP-11 simulator V3.8-1
sim> set cpu 11/40
Disabling XQ
sim> set tm0 locked
sim> attach tm0 dist.tap
sim> attach rk0 rk0
RK: creating new file
sim> attach rk1 rk1
RK: creating new file
sim> attach rk2 rk2
RK: creating new file
sim> d cpu 100000 012700
sim> d cpu 100002 172526
sim> d cpu 100004 010040
sim> d cpu 100006 012740
sim> d cpu 100010 060003
sim> d cpu 100012 000777
sim> g 100000

Simulation stopped, PC: 100012 (BR 100012)
sim> g 0
=tmrk
disk offset
0
tape offset
100
count
1
=tmrk
disk offset
1
tape offset
101
count
3999
=                                              [## Hit CTRL-E here]
Simulation stopped, PC: 137300 (BGE 137274)
sim> q
Goodbye

disk install

Here is our dboot.ini for booting from the hard disk:

set cpu 11/40
set tto 7b
set tm0 locked
attach tm0 dist.tap
attach rk0 rk0
attach rk1 rk1
attach rk2 rk2
dep system sr 173030
boot rk0

Booting up to single user mode

And this will boot us up to the bootloader, to which we just tell it to load the 'unix' kernel.

PDP-11 simulator V3.8-1
sim> set cpu 11/40
Disabling XQ
sim> set tto 7b
sim> set tm0 locked
sim> attach tm0 dist.tap
sim> attach rk0 rk0
sim> attach rk1 rk1
sim> attach rk2 rk2
sim> dep system sr 173030
sim> boot rk0
@rkunix
mem = 1030
RESTRICTED RIGHTS

Use, duplication or disclosure is subject to
restrictions stated in Contract with Western
Electric Company, Inc.
#

Fixing the Terminal

The first thing we are going to do with UNIX loaded is set the terminal back to lowercase... Enter the following command in lower case, it'll echo back in upper case, but that's just the way it works.

# STTY -LCASE

Rebuilding the kernel

We are going to rebuild the kernel to support the appropriate hardware that SIMH provides. First we must build the mkconf program

chdir /usr/sys/conf
cc mkconf.c
mv a.out mkconf

With the mkconf program built, we then feed it a basic configuration file. To do this we just run mkconf, then type in the list of devices we want.

rk
tm
tc
8dc
lp
done

And you'll get this:

# ./mkconf
rk
tm
tc
8dc
lp
done
#

Now we can compile the config, and link in the rest of the kernel, and copy it to the root.

as m40.s
mv a.out m40.o
cc -c c.c
as l.s
ld -x a.out m40.o c.o ../lib1 ../lib2
mv a.out /unix

And to verify, our kernel should be 30kb

# ls -l /unix
-rwxrwxrwx  1 root    30346 Oct 10 12:43 /unix

building device files

Now we'll build the device files. Just copy & paste this in.

/etc/mknod /dev/rk0 b 0 0
/etc/mknod /dev/rk1 b 0 1
/etc/mknod /dev/rk2 b 0 2
/etc/mknod /dev/mt0 b 3 0
/etc/mknod /dev/tap0 b 4 0
/etc/mknod /dev/rrk0 c 9 0
/etc/mknod /dev/rrk1 c 9 1
/etc/mknod /dev/rrk2 c 9 2
/etc/mknod /dev/rmt0 c 12 0
/etc/mknod /dev/lp0 c 2 0
/etc/mknod /dev/tty0 c 3 0
/etc/mknod /dev/tty1 c 3 1
/etc/mknod /dev/tty2 c 3 2
/etc/mknod /dev/tty3 c 3 3
/etc/mknod /dev/tty4 c 3 4
/etc/mknod /dev/tty5 c 3 5
/etc/mknod /dev/tty6 c 3 6
/etc/mknod /dev/tty7 c 3 7
chmod 640 /dev/*rk*
chmod 640 /dev/*mt*
chmod 640 /dev/*tap*

Restoring the rest of the OS

dd if=/dev/mt0 of=/dev/rk1 count=4000 skip=4100
/etc/mount /dev/rk1 /usr/source
dd if=/dev/mt0 of=/dev/rk2 count=4000 skip=8100
mkdir /usr/doc


configure boot

I just use cat to append the boot statements for the other disks.

/etc/mount /dev/rk1 /usr/source
/etc/mount /dev/rk2 /usr/doc

And I append them like this:

# cat >> /etc/rc
/etc/mount /dev/rk1 /usr/source
/etc/mount /dev/rk2 /usr/doc

then hit CTRL+D

rebuild the df command

To config the df:

# chdir /usr/source/s1
# ed df.c
/rp0/d
.-2a
  "/dev/rk0",
  "/dev/rk1",
.
w
q
# cc -s -O df.c
# cp a.out /bin/df
# rm a.out

check filesystems

fsck didn't exist back then... So we run icheck/dcheck.

icheck /dev/rrk0
dcheck /dev/rrk0
icheck /dev/rrk1
dcheck /dev/rrk1
icheck /dev/rrk2
dcheck /dev/rrk2

enable multiser

The default /etc/ttys file isn't listening on the serial ports, so we change that by simply editing the file....

# ed /etc/ttys
1,8s/^0/1/p
w
q
# 

reboot

There is no reboot command so run sync a few times, then Control+E to interrupt and quit the simulator.

# sync
# sync
# sync
# sync
#                               [## Hit CTRL-E here]
Simulation stopped, PC: 002502 (MOV (SP)+,177776)
sim> q
Goodbye

C:\temp\v6\myv6>

Running normally

With the install all done, let's use the following ini file for normal operations.

set cpu 11/40
set cpu idle
set tto 7b
set tm0 locked
attach rk0 rk0
attach rk1 rk1
attach rk2 rk2
attach lpt printer.txt
set dci en
set dci lines=8
set dco 7b
att dci 5555
boot rk0

When we fire up the emulator we can then attach on tcp port 5555 for additional users. To boot unix, just pass the name unix to the bootloader.


PDP-11 simulator V3.8-1
Disabling XQ
Listening on port 5555 (socket 108)
@unix

login: root
#

It's also worth noting that there is no root password.