VTserver: Installing a PDP-11 UNIX with No Tape Drive

Warren Toomey

wkt@cs.adfa.edu.au

Version 2.3, March 2001

Caveat

Before you even start looking at this software, there are some caveats which go with it.

  1. The VTserver software should be considered in beta release. Your feedback is most definitely requested, to fix any bugs and to improve the software. In particular, I haven't tried this software on all PDP-11 platforms: it should work on a system without split I&D, but it does require 128 Kwords of memory.

  2. I have never owned or used a real PDP-11. The VTserver software was developed using a number of PDP-11 emulators. For this reason, there may be hardware-specific bugs in the software which were not found using the emulators. As well, the terminology in this manual may not be correct PDP-11 speak. Again, please send me your suggestions and improvements!

Introduction

Several members of the PUPS mailing list (see http://minnie.cs.adfa.edu.au/PUPS/) have wanted a way of installing UNIX onto a PDP-11 which has no tape drive. One solution, if the PDP-11 has software already installed (RT-11, RSX etc.) is to leverage from the installed software to download and write UNIX onto a spare disk. This approach is not covered here, and someone who has done this should be encouraged to write it up.

The approach here has been to modify the initial UNIX tape loading software so that bits can be downloaded from a nearby computer over a serial cable. The modified boot straps thus perceive a Virtual Tape drive; hence the name of the software.

The VTserver software comes as two components: a set of PDP-11 software which acts as the client, and the server which is hosted on a second machine, running Unix.

The two computers are connected via an RS-232 null modem with hardware handshaking. A KL/DL-11 unit on the PDP-11 is used as the serial port: the highest transfer rate is 9,600 bps [I could be wrong here - please let me know otherwise]. Although this is a way to install UNIX on a PDP-11, its a pretty slow way.

Manifest

The VTserver software is available from ftp://minnie.cs.adfa.edu.au/pub/PDP-11/Vtserver as the file
vtserver2.3.tar.gz.

For now, the vtserver/ directory is where you want to go, because this contains the PDP-11 binaries and the server program you need. You should have received the following files as part of the VTserver software:

vtreadme.txt:
This document in plain ASCII. There may be translations of this document in other formats, too.
vtserver.c:
The source code to the server program.
.vtrc:
The server's configuration file.
vtboot.pdp:
The machine code to bootstrap using the vtserver.
boot:
Second stage bootstrap.
copy:
Essentially a standalone copying program.

You will also need a root disk image for your PDP-11, one that is known to work for your model. I recommend that you use one of the available PDP-11 emulators plus the versions of UNIX in the UNIX Archive to create one of these. Don't bother reading any further until you know that your disk image will work.

Alternatively, you may want to install 2.11BSD using the standard tape installation procedure. In this case you will also find modified versions of disklabel, mkfs, icheck and restor. You will need to obtain the 2.11BSD root filesystem dump and the 2.11BSD /usr tar archives from elsewhere.

In the following section, we will discuss how to copy an existing disk image from the virtual tape server to your disk. Towards the end, there is a section on installing 2.11BSD using the standard tape installation procedure.

Compiling vtserver

The first thing to do is to compile vtserver.c:

  $ cc -o vtserver vtserver.c

The code is pretty vanilla ANSI C. The only system-specific sections are that to set the serial port to raw mode, and the use of select(). I have used the Posix termios system calls, and you may need to modify the server code if your system isn't Posix-compatible. Please send patches back to me for this.

Connecting the PDP-11 to the vtserver

The console KL-11 unit needs to be connected via RS-232 to the serial port on the Unix server where you compiled vtserver.c. Ok, I have no experience here as I don't have a real PDP-11. I'd strongly recommend using a null modem cable with full hardware handshaking lines (RTS/CTS and DTR/DSR) - however, I have been told that the console line doesn't support hardware handshaking. Can anybody clear this up for me?

I'd also recommend having a copy of Kermit on the Unix server end. If no communication seems to be taking place, open the serial line with Kermit, and see if characters are being received from the PDP-11. An RS-232 breakout box here could also be useful.

The .vtrc File

The file .vtrc is the server's configuration file. Lines beginning with hashes are ignored. The first (non-hashed) gives a shell command to set the correct speed and parity of the serial line. The second line names the serial device. Remaining lines name the fictitious tape's records, and should be boot, copy, and the name of your disk image.

An example .vtrc would be:

  #       Configuration file for Virtual Tape Server
  #
  # First line is any Unix command needed to set the serial port up
  stty -f /dev/ttyid1 9600 cs8 clocal -crtscts
  #
  # Second line in this file is the serial port device
  /dev/ttyd1
  #
  # After that is the list of files on the virtual tape, e.g
  #   Record 0: the boot program
  #   Record 1: the copy ptogram
  #   Record 2: a disk image for your root disk
  #
  boot
  copy
  disk.img

You will most likely need to change the name of the serial port device and the shell command in .vtrc to set it up. You should configure the KL-11 for 9600 baud, 8 bits, no parity, and you should do the same for the Unix server. On my FreeBSD box, the shell command in my .vtrc is:

  stty -f /dev/ttyid1 9600 cs8 clocal -crtscts

If you are using hardware handshaking lines (and you should), change this to:

  stty -f /dev/ttyid1 9600 cs8 -clocal crtscts

Starting vtserver

vtserver is started with no arguments, and reads its configuration file .vtrc. vtserver then starts up with a short description of the tape's contents:

  Virtual tape server, $Revision: 2.3 $ 
  Running command stty -f /dev/ttyid1 9600 cs8 clocal -crtscts

  Tape records are:
     0 boot
     1 copy
     2 disk.img

  Opening port /dev/ttyd1 .... Port open

At this point, you can use vtserver as your PDP-11's console. However, when the VT client starts sending VT commands to vtserver, you will see messages from the server describing which file is being transferred.

As each file is opened, its name is shown on the screen. An `r' signifies a read of 512 bytes. If the VT client on the PDP-11 tries to read past the file's end, an EOF is shown. Finally, a progress message is shown every 100K of a file's download.

When not downloading a file, you can exit vtserver by typing two consecutive ESC keys at the console.

Booting via vtserver

The first stage of the boot process is to enter the boot code which retrieves the file boot from the vtserver. This code should be entered at address 140000 onwards. The code is given in the vtboot.pdp, and also in octal below.

0140000: 010706 005003 012701 177560 012704 140106 112400 100406
0140020: 105761 000004 100375 110061 000006 000770 005267 000052
0140040: 004767 000030 001403 012703 006400 005007 012702 001000
0140060: 004767 000010 110023 005302 001373 000746 105711 100376
0140100: 116100 000002 000207 025037 000000 000000 177777

Help! It would be nice for the server to send ODT commands to the PDP-11 to make this easier. Can someone send me some details on ODT (i.e what prompt it gives, what commands can be used to deposit values in memory), and I will modify the vtserver to send this automatically.

Toggle in the code, and start execution at address 140000. If all goes well, the bootstrap code will start to send VT commands, and you will see the following from the vtserver:

  Opened boot
   rrrrrrrrrrrrrr EOF

  xxBoot from vt(0,0,0) at 0177560
  :

The xx identifies which CPU you have: see the 2.11BSD installation guide for details.

This is the standard 2.11BSD boot program. Enter the name of the tape record that you wish to load (most likely record 1 for copy). This is done by entering the word vt(0,0,1).

When copy loads, you will be prompted for the input record and the output disk device. Both boot and copy use the 2.11BSD terminology for devices, units and partitions, and you should probably read the 2.11BSD setup documentation here.

Available devices are:

br
RP03-like disk driver, modified to handle BR 1537 and 1711 controllers with T300, T200, T80 and T50 drives.
hk
RK06/07 disk driver.
ra
MSCP disk device driver (rx23, rx33, rx50, rd??, ra??, rz??).
rk
RK disk driver.
rl
RL disk driver.
rx
RX02 disk driver.
si
SI 9500 CDC 9766 disk driver.
xp
SMD disk driver.

vt
Virtual Tape drive.
ht
TU16/TE16/TU77 tape driver.
tm
TU10/TE10/TS03 tape driver.
ts
TS11/TU80/TS05/TK25 tape driver.

Use the name vt(0,0,x) to read from virtual tape record x. Use the name ra(0,0,0) to write directly to the MSCP disk device. Note: copy will complain that the disk doesn't have a 2.11BSD disklabel, and that the copying will ``span the volume''. This just means that the copy will write across the entire disk, which is probably what you want.

An Example Disk Image Copy

Here is an example output where the user has booted from the vtserver, loaded boot and then copy, and then copied the image disk.img to their RL02 disk.

  Opened boot
  rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr EOF

  53Boot from vt(0,0,0) at 0177560
  : vt(0,0,1)

  Opened copy
  rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrBoot: bootdev=06401 bootcsr=0177560
  copy
  Infile: vt(0,0,2)

  Opened disk.img
  Outfile: rl(0,0,0)
  rl(0,0,0) disklabel missing/corrupt
  rl(0,0,0) spans volume
  rrrrrrrrrrrrrrrrrrrrrrr ...
  53Boot from vt(0,0,1) at 0177560
  :

At this point, the PDP-11 can be rebooted. If the downloaded disk image is bootable, the user should now have a working PDP-11 operating system.

Installing 2.11BSD with Vtserver

To install 2.11BSD via the vtserver, you need to set up a virtual tape with records corresponding to the standard 2.11BSD tape. You don't need any boostrap records on your virtual tape, and so your .vtrc file should look something like this (minus the comment lines):

  stty -f /dev/ttyid1 9600 cs8 clocal -crtscts
  /dev/ttyd1
  boot
  disklabel
  mkfs
  restor
  icheck
  root.dump
  usr.tar
  otherusr.tar

Don't use the standalone programs disklabel, mkfs, icheck and restor from standard 2.11BSD, as they don't speak the VT protocol. Instead, use the VT-enabled programs supplied with the vtserver.

Apart from setting up the serial line, compiling and starting vtserver, and entering in the VT boot code, you should be able to follow the standard 2.11BSD installation instructions. As an example, here is an example output where a user made a root filesystem on an RL02, and then restored the root.dump to this disk:

  $ vtserver 
  Virtual tape server, $Revision: 2.3 $ 
  Running command echo

Tape records are:
   0 boot
   1 disklabel
   2 mkfs
   3 restor
   4 icheck
   5 root.dump

Opening port /dev/ptyp9 .... Port open

Opened boot
 rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr EOF

53Boot from vt(0,0,0) at 0177560
: vt(0,0,1)

Opened disklabel
 rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrBoot: bootdev=06401
                                                             bootcsr=0177560
disklabel
Disk? rl(0,0,0)
d(isplay) D(efault) m(odify) w(rite) q(uit)? d

type: old DEC
disk:
label: DEFAULT
flags:
bytes/sector: 512
sectors/track: 20
tracks/cylinder: 2
sectors/cylinder: 40
cylinders: 512
rpm: 3600
drivedata: 0 0 0 0 0 

1 partitions:
#        size   offset    fstype   [fsize bsize]
  a: 20480 0  2.11BSD    1024 1024      # (Cyl. 0 - 511)

d(isplay) D(efault) m(odify) w(rite) q(uit)? D
d(isplay) D(efault) m(odify) w(rite) q(uit)? w
d(isplay) D(efault) m(odify) w(rite) q(uit)? q

53Boot from vt(0,0,1) at 0177560
: vt(0,0,2)

Opened mkfs
 rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrBoot: bootdev=06402
                                                     bootcsr=0177560
Mkfs
file system: rl(0,0,0)
file sys size [10240]: 
bytes per inode [4096]: 
interleaving factor (m; 2 default): 
interleaving modulus (n; 20 default): 
isize = 2560
m/n = 2 20
Exit called

53Boot from vt(0,0,2) at 0177560
: vt(0,0,4)

Opened icheck
 rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrBoot: bootdev=06403
                                                         bootcsr=0177560
Icheck
File: rl(0,0,0)
rl(0,0,0):
files 3 (r=1,d=2,b=0,c=0,l=0,s=0)
used 2 (i=0,ii=0,iii=0,d=2)
free 10076
missing 0

53Boot from vt(0,0,4) at 0177560
: vt(0,0,3)

Opened restor
 rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrBoot: bootdev=06404
                                                           bootcsr=0177560
Restor
Tape? vt(0,0,5)

Opened root.dump
 Disk? rl(0,0,0)
Last chance before scribbling on disk. rrrrrrr .....
rrrrrrrrrEnd of tape

53Boot from vt(0,0,5) at 0177560
: rl(0,0,0)unix
Boot: bootdev=03400 bootcsr=0174400

2.11 BSD UNIX #115: Sat Apr 22 19:07:25 PDT 2000
    sms1@curly.2bsd.com:/usr/src/sys/GENERIC
[etc.]

Other Comments

The vtserver/ directory holds the source code vtserver.c as well as the client binaries boot, copy, disklabel, mkfs, icheck and restor.

The pdpvtstand/ directory holds the source code for the PDP-11 side of things: vtboot.pdp, boot, copy, disklabel, mkfs, icheck and restor. In fact, this is a copy of /sys/pdpstand from 2.11BSD which has been modified to have the vt.c client, the source code for copy and vtboot.pdp.

To compile all of this, you'll need a 2.11BSD system. Place this directory in /usr/src/sys, change into pdpvtstand/ and run make. See the RCS comments for details.


Warren Toomey
2001-03-23