Introduction

The AT&T 3B2/400 was a small, multi-user UNIX computer developed by
AT&T in 1985. It was part of the larger 3B family of UNIX computers
based on the Western Electric WE32000 and WE32100 series of CPUs and
peripherals. What makes the 3B2 historically interesting was its use
as the primary porting platform for AT&T UNIX System V Release 3.

This emulator is part of the SIMH simulation framework, and emulates a
standard desktop 3B2/400 with the following devices:

1MB, 2MB, or 4MB of system memory

One 720KB floppy diskette

One or two 30MB, 72MB, 135MB, or 161MB MFM hard disk drives.

One 23MB QIC Cartridge Tape (CTC)

Up to twelve 4-port serial cards for remote terminals (PORTS)

Since internals documentation for the 3B2 series are not readily
available, the emulator was made possible through a
reverse-engineering effort, studying the System V Release 3 source
code, and lots of caffeine.

Usage

A complete description of SIMH would be much too long for this
document, but in brief, it is a platform for writing and hosting
computer simulators. SIMH implements a great number of simulators, of
which the 3B2/400 is only one.

Below is a "Getting Started" guide to help ease you into the world of
SIMH in general, and using the 3B2/400 specifically.

Getting Started

The 3b2 binary (or 3B2.exe under Windows) is a standalone application.
On Linux, all you need to do is CD into the directory where you've downloaded
3b2, and type:

$ ./3b2

On Windows, open the cmd.exe shell, CD into the directory where you've downloaded
3B2.exe, and type:

C:\some\directory> 3B2

In either case, you will be greeted with an interactive SIMH shell where you can
type commands. It looks like this:

Example Startup File

Any command that you can type to the SIMH sim> prompt can be stored
in a startup file, and thiks is generally the easiest way to do
things. For example, you may create a file named boot.ini, and enter
the following commands:

When you start the 3B2 simulator, you can pass the name of this file
to the program as an argument, for example under Linux

./3b2 boot.ini

And under Windows

C:\some\directory> 3B2 boot.ini

This will launch the simulator and run all the commands in the file.

We'll look at all of the options specified in this example file in
greater detail below

Simulator Options

CPU Memory

set cpu 4M

This line sets the available system memory to 4MB, which is the maximum
amount that a 3B2/400 could address. Other options are 1M and 2M.

IDLE support

set cpu idle

This enables CPU idle support. Idle support lets the emulator use less
host CPU. If this line were not present, the emulator would use 100%
of one host CPU core.

Hard Disk Type

set id0 HD161

This command tells the emulator what type of hard disk is attached.
id0 is the first emulated hard disk drive (id stands for "Internal
Disk"). A second hard disk may optionally be attached as id1.

HD161 tells the emulator that the hard disk is a Maxtor XT1190 161MB
MFM hard disk.

Other options include HD30 for a 30MB hard disk, and HD72 for a
72MB hard disk.

Unless otherwise specified, HD72 is the default, because a 72MB hard
disk was the largest that AT&T originally shipped with the 3B2/400.

Hard Disk Image

attach id0 hard_disk.img

This line attaches the disk id0 to a virtual hard disk file named
hard_disk.img, creating the file if it doesn't exist.

Note that the 3B2/400 expects hard disks to be low-level formatted
before they can be used. That is addressed later in this document.

Floppy Disk Image

attach if floppy_disk.img

This line, similar to the line above, attaches a virtual floppy disk
image to the floppy drive. (if for "Internal Floppy")

The 3B2/400 floppy disk uses double sided 80-track diskettes with 9
tracks per sector and 512 bytes per track, for a total disk size of
720KB.

NVRAM and Time-of-Day Clock

attach nvram nvram.bin
attach tod tod.bin

These two lines create files to store the state of NVRAM (Non-Volatile
RAM) and the Time-of-Day Clock. When these devices are attached, the
3B2/400 emulator will remember important settings and the current time
of day between boots.

CONTTY Serial Port

attach contty 8000

All 3B2/400s have two serial ports on the system board: One for the
console terminal, labled CONSOLE, and one for a second serial
connection, labeled CONTTY. This command enables the secondary
serial port and attaches it to Telnet port 9000. You can then use a
Telnet client to connect to the host that the emulator is running on
on port 8000, and you will be connected to the virtual CONTTY serial
line.

CTC Tape Drive

set ctc enabled
attach ctc tape.img

This enables the Cartridge Tape Controller (CTC) card. This is a 23 MB
Cipher "FloppyTape" QIC tape device present on 3B2/400 computers. The
virtual tape drive may be connected to a file with the command
attach ctc <filename>

PORTS Serial Ports

set ports enabled
set ports lines=16
attach ports 9000

The PORTS card is an optional expansion card for the 3B2/400. Each
PORTS card supports 4 serial terminals, and up to 4 PORTS cards
may be installed in a 3B2/400.

These commands enabled PORTS support, sets the number of simulated
terminal lines to 16 (4 cards), and listens for connections on port 9000.

Booting The 3B2/400

To boot the simulated 3B2/400, type:

sim> boot

You may see several different messages.

First Time Booting

If you have never booted the 3B2/400 before, or if you have deleted
the nvram.bin NVRAM file, you will see the message

The "Full Install" hard disk was installed from the full set of
all 26 floppy disks making up a standard System V Release 3.2
distribution, plus the following extras:

Set default terminal type to VT100

C-Kermit 5A(189) installed as /usr/bin/kermit

GNU Bison 1.25 installed under /usr/gnu

GNU gzip 1.2.4 insatlled under /usr/gnu

GNU tar 1.09 installed under /usr/gnu

The "Blank Disk" image is a blank 161 MB hard disk, useful for
doing a fresh install, or for adding a second hard disk drive
to your installation.

Transferring Data Between the Emulator and a Host

One interesting challenge is, "How do we share data between the host
system and the emulated 3B2?"

There are three options available for this, ranging from simplest to
hardest.

C-Kermit

C-Kermit is a very simple program that transfers data over serial
lines. It's very easy to use. The main downside is that transfers are
very slow. They're limited to the speed of the emulated serial port,
which is 9,600 baud by default, and cannot go above 115,200 bps.

Caveat: On the emulated 3B2, the size of file you can transfer is
limited by the ulimit setting, and by default cannot be more than
1MB in size. You may increase the ulimit to overcome this
limitation.

From C-Kermit on your host system, use the following command to
connect to the CONTTY device:

C-Kermit> TELNET /NOWAIT 127.0.0.1 8888

Be sure to replace the IP address and port with the appropriate
values.

When Kermit has connected to the CONTTY device, press Enter a few
times until you see a login prompt. Log in as your standard user on
the 3B2.

Now, on the 3B2, run C-Kermit, and type:

C-Kermit> RECEIVE

followed by the control sequence to bring you back to the host Kermit interface:

<Control>-\ c

(that’s the Control key plus backslash (\), followed by the “c” key)

You should now be back in the host Kermit session. Type:

C-Kermit> SEND <filename>

Your file should transfer to the 3B2 at about 1200 bytes per
second. Not blazingly fast, but tolerable.

Copying Data from the 3B2 to the Host Computer

This is really just the reverse procedure. You do exactly the same
things, except on the 3B2 C-Kermit session, you type:

C-Kermit> SEND <filename>

And on the Host Kermit session, you type:

C-Kermit> RECEIVE

Using a CTC Tape Image

TODO: This section is coming soon!

Using a Hard Disk image

This method is really a tremendous hack, but it's probably the fastest
way to transfer very large that are too big to fit onto a CTC tape
image.

The basic idea is to write a CPIO archive to a specific location on a
blank hard disk image under Linux, and then, in SVR3, to read the CPIO
archive out of the raw disk device.

On the Linux Host

Prepare a blank hard disk image with a valid low level format,
partition table, and VTOC. If you need a pre-built image, one is
available below. Download the file hd72_xfer.img.gz and uncompress
it.

Prepare a cpio archive of the files you wish to transfer to the
emulated 3B2. In Linux, you must remember to pass the --format odc
flag to build a compatible cpio archive, e.g.:

$ ls * | cpio -ov --format odc > example.cpio

Use dd to write the archive into the blank hard disk image. By
passing the seek=810 flag, we skip into an unused area of the disk.

$ dd if=example.cpio of=hd72_xfer.img bs=512 seek=810 conv=notrunc

Finally, attach the disk image under SIMH (you must do this when
the 3B2 is powered down!)

sim> set id1 hd72
sim> attach id1 hd72_xfer.img

On the Simulated 3B2

Now we reverse the process on the 3B2 by using dd and cpio to read from
the raw emulated disk.

# dd if=/dev/rSA/disk2 skip=648 bs=512 | cpio -idv

(Note that we skip 648 blocks instead of 810. That is intentional,
because the first cylinder is not mapped to the /dev/rSA/disk2
device.)

Using UNIX SVR3

If your only experience with UNIX-like systems is through modern
Linux, you should be aware of a few things.

First, SVR3 is not loaded with fancy utilities like Linux. The base
3B2 installation doesn’t even come with man pages.

Second, you don't (by default) get a backspace character. That’s not a
problem with the emulator, that’s really how SVR3.2 works. If you want
to delete a character, you have to type the pound / hash symbol
(#). And if you want to delete the whole line and start again, you
have to press the at symbol (@).

Control Character Setup

You can change these default terminal control characters to something
more familiar with the stty utility.

stty intr "^C"
stty erase "^?"
stty kill "^U"

Some terminal emulators send CTRL-H to delete a character. On such a
terminal, you can use:

stty erase "^H"

To check the current values:

stty -a

Terminal Setup

If you want to use the vi editor in visual mode, you will need to
define your TERM environment variable to something that SVR3.2
recognizes. It’s generally safe to set this to vt100.

TERM=vt100
export TERM

You can put this into your .profile file to set it automatically
each time you log in.

Shutting Down

Don't forget to shut down cleanly by typing:

# shutdown -i0 -g0 -y

Installing SVR3.2 From Scratch

Preparing a Hard Disk Image

If you're feeling particularly adventurous, you can create a new blank
hard drive image and low-level format it using the IDTOOLS floppy,
then proceed to install SVR3.2 from scratch.

You can really just skip all the annoying bad block stuff. You'll
have to press Enter a lot.

Finally, select:

Format entire disk - type 1

The disk image will be low-level formatted and verified, and a sanity
track will be written.

Installing the Operating System from Floppy Disk

I will largely leave this as an exercise for the reader. The basic
procedure is to boot unix from the first floppy disk, and then
follow the prompts to install the Essential Utilities floppy disks 1
– 6. After the Essential Utilities are installed, you can reboot off
the hard disk id0 and proceed to install additional products with
the sysadm softwaremgmt command.