Front End, Back End, Web, Embedded, and More

SIMH AT&T 3B2/400 Emulator
Emulator Screenshot

Table of Contents

  1. About
  2. Getting the Emulator
  3. Usage
  4. Transferring Data Between the Emulator and a Host
  5. Prebuilt Hard Disk and NVRAM Images
  6. Using UNIX SVR3
  7. Installing SVR3.2 From Scratch
  8. Other Software

About

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:

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.

Changelog

Outstanding Issues

This emulator has no known bugs, but that does not mean it is bug-free software. It is still under development as new features are added.

The following outstanding issues are not yet addressed:

  1. Only the Console and CONTTY serial ports are emulated so far. Support for an 8-line PORTS serial card is coming soon.
  2. No network card is emulated yet.

Getting the Emulator

Binary Distributions

File Size Description
3b2 791,792 bytes GNU/Linux x86_64 executable

MD5SUM: de7b384f1ad9638ac20a56183df64077
SHA1SUM: 39769453ae7030185772d1fba63406abbac0b4c0
3B2.exe 606720 bytes Windows XP/7/10 32-bit executable

MD5SUM: 73f11771ab6280e96617449bcfeed61a
SHA1SUM: 85d113980595d1872d3a70caaed9c0b0ff16216e

Compiling from Source on GNU/Linux

The SIMH source repository is here:

https://github.com/simh/simh

If you would like to build the emulator on GNU/Linux yourself:

  1. Clone the SIMH repository above
  2. cd into the simh directory
  3. Type make 3b2

The binary will be built into the BIN diretory.

Usage

The 3B2 emulator is part of SIMH, the Computer History Simulation Project. Full documentation for the SIMH platform is availble here:

simh_doc.pdf (PDF, 400KB)

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 (or 3B2.exe under Windows) binary 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

> 3B2

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

AT&T 3B2 Model 400 simulator V4.0-0 Beta        git commit id: 2de2b9bd
sim> 

To quit at any time, just type quit

Startup File

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

set cpu 4M
set cpu idle

set id0 HD161

attach nvram nvram.bin
attach tod tod.bin
attach id0 hard_disk.img
attach if floppy_disk.img
attach contty 8888

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

./3b2 boot.ini

And under Windows

3B2 boot.ini

Simulator Options

Let's walk through the boot.ini file to explain what each line means.

Booting The 3B2

To boot the simulator, type:

sim> boot cpu

You may see several messages:

If either of these messages appear, you will be prompted with the following:

The "SYSTEM FAILURE" line is actually an invisible password prompt!

Type the default password mcp and press Enter.

You'll then see the following:

Enter name of program to execute [  ]:

Type unix and press enter.

When prompted for which option and slot to load unix from, type 0 to load from floppy disk, or type 1 to load from hard disk. Now UNIX will boot.

If you're using one of the pre-built hard disk images, you shouldn't even need to do this. It should boot without any user interaction. The root user has no password, so have fun.

Exiting the Emulator

To stop SIMH at any time, type the control sequence Control-E. This will return you to the SIMH prompt (sim>), where you can type quit

Prebuilt Hard Disk and NVRAM Images

To make getting started as painless as possible, I have prepared several hard disk images with AT&T System V Release 3.2 UNIX pre-installed.

All hard-disk images are of type HD161, to give you maximum free space.

There is also a pre-generated NVRAM image that you can use, if you wish. NVRAM is "Non-Volatile RAM", and stores parts of the system configuration between boots.

Image Compressed Size Description
hd161.img.gz 4.9 MB Full install of all 26 floppy disks making up a standard System V Release 3.2 distribution.
hd161_extras.img.gz 7.2 MB Above, 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 installed under /usr/gnu
  • GNU tar 1.09 installed under /usr/gnu
hd161_blank.img.gz 164 KB Blank 161MB disk image useful for transferring data from the host system to the emulated 3B2, or for installing fresh, or as a second hard drive.
nvram.bin 4 KB Non-Volatile RAM image (optional)

Transferring Data Between the Emulator and a Host

There are two ways to copy data in and out of the emulator. The first is using the KERMIT protocol. The second and much hackier way is to write data to an unused portion of a secondary hard disk image.

When in doubt, use Kermit. It's cleaner and involves less risk of data loss.

Transferring via C-Kermit

KERMIT is a protocol developed for transferring data over a serial line.

Using Kermit to transfer files is fairly easy. The biggest downside is that the transfer is fairly slow, since the CONTTY serial terminal emulates a baud rate of 115,200 bps.

To use Kermit, you will need two pieces of software:

  1. Kermit for your host operating system
  2. C-Kermit for the 3B2 (below)

Kermit 95 for Windows is available here: http://www.kermitproject.org/k95.html

C-Kermit for Linux is available through most distribution's package managers.

C-Kermit for the 3B2 is available here, on a diskette image:

Image Size Description
ck189.img 720 KB C-Kermit 5A(189) compiled for SVR3.2 on the 3B2/400

Installing Kermit on the Emulator

Attach the floppy image to the simulator with the following command:

sim> ATTACH IF ck189.img

Then, in UNIX, mount the floppy:

# mount /dev/diskette /install
# cp /install/kermit /usr/bin/kermit

Copying Data from a Host Computer to the 3B2

  1. Enable the CONTTY device on the 3B2. For example, to listen for connections on port 8888, you would add this to your startup file:

    ATTACH CONTTY 8888
  2. Start Kermit on your host system.
  3. 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.
  4. 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.
  5. Now, on the 3B2, run C-Kermit, and type:

    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)
  6. You should now be back in the host Kermit session. Type:

    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 a Host Computer

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

SEND <filename>

And on the Host Kermit session, you type:

RECEIVE

Transferring via a Hard Disk image

On The Linux Host

  1. 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 hd161_blank.img.gz
  2. 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
  3. 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=hd161_blank.img bs=512 seek=810 conv=notrunc
  4. Finally, attach the disk image under SIMH (you must do this when the 3B2 is powered down!)

    sim> set id1 hd161
    sim> attach id1 hd161_blank.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, e.g.:

# 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. Type:

# shutdown -i0 -g0 -y

Installing SVR3.2 From Scratch

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.

The IDTOOLS floppy image is here:

Image Size Description
idtools.img 720 KB IDTOOLS (Integrated Disk Utils) and DGMON (Diagnostic Monitor)

Instead of attaching the hard drive image above, just attach a new file. A blank hard drive image will be created by SIMH.

Then, boot off of the idtools.img floppy.

sim> attach id0 new_blank_hd.img
sim> attach if0 idtools.img
sim> attach nvram nvram.bin
sim> boot cpu

At the "SYSTEM FAILURE" prompt, enter the password mcp and press enter.

Then at the Enter name of program to execute [ ]: prompt, enter idtools, then select the floppy drive.

Once idtools is running, you'll see the following menu:

    ---------------------   IDTOOLS   ---------------------

       Floppy diskette formatter - type formflop
             Hard disk formatter - type formhard
                Hard disk verify - type verify
    Disk to disk copy high speed - type ddhs
     Disk to disk copy by sector - type dd
              Disk <--> mem copy - type d-m
            Defect table builder - type defect
              Write sanity track - type fixdisk
            Change boot defaults - type chgboot
                            Quit - type q

    Command?

Type formhard, then select disk 0

You'll need to know the parameters of the hard disk to format it. The following emulated hard disks are supported

SIMH Command Description Drive ID Cylinders Tracks/Cyl Sec/Track Bytes/Sec
set id0 HD30 CDC Wren 94155-36 3 697 5 18 512
set id0 HD72 CDC Wren II 94156-86 5 925 9 18 512
set id0 HD72C Fujitsu M2243AS 8 754 11 18 512
set id0 HD161 Maxtor XT1190 11 1224 15 18 512

Below is an example session with responses for formatting a 161 MB (HD161) disk. Enter the correct responses for whichever type of disk you are formatting.


   Current config table values:
              Drive Id:    2 - ? 11
      Number cylinders:  306 - ? 1224
       Number tracks/cyl:  4 - ? 15
    Number sectors/track: 18 - ? 18
   Number bytes/sector:  512 - ? 512

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 SVR3.2

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 command.

All of the SVR3.2 floppy images can be found here.

Image Size Description
01_Essential_Utilities_1.img 720 KB Essential Utilities (Disk 1)
02_Essential_Utilities_2.img 720 KB Essential Utilities (Disk 2)
03_Essential_Utilities_3.img 720 KB Essential Utilities (Disk 3)
04_Essential_Utilities_4.img 720 KB Essential Utilities (Disk 4)
05_Essential_Utilities_5.img 720 KB Essential Utilities (Disk 5)
06_Essential_Utilities_6.img 720 KB Essential Utilities (Disk 6)
07_Directory_and_File_Management.img 720 KB Directory and File Management Utilities
08_User_Environment.img 720 KB User Environment Utilities
09_System_Administration.img 720 KB System Administration Utilities
10_Terminfo_1.img 720 KB Terminal Info Utilities (Disk 1)
11_Terminfo_2.img 720 KB Terminal Info Utilities (Disk 2)
12_Editing.img 720 KB Editing Utilities
13_Basic_Networking_1.img 720 KB Basic Networking Utilities UUCP (Disk 1)
14_Basic_Networking_2.img 720 KB Basic Networking Utilities UUCP (Disk 2)
15_System_Header_Files.img 720 KB System Header Files
16_Software_Generation_1.img 720 KB Software Generation Utilities (Disk 1)
17_Software_Generation_2.img 720 KB Software Generation Utilities (Disk 2)
18_Software_Generation_3.img 720 KB Software Generation Utilities (Disk 3)
19_Software_Generation_4.img 720 KB Software Generation Utilities (Disk 4)
20_Software_Generation_5.img 720 KB Software Generation Utilities (Disk 5)
21_Software_Generation_6.img 720 KB Software Generation Utilities (Disk 6)
22_Extended_Software_Generation.img 720 KB Extended Software Generation Utilities
23_C_Programming_Language_1.img 720 KB C Programming Language Utilities (Disk 1)
24_C_Programming_Language_2.img 720 KB C Programming Language Utilities (Disk 2)
25_Advanced_C_Utilities.img 720 KB Advanced C Utilities
26_Source_Code_Control.img 720 KB Source Code Control Utilities

Other Software

The files below include everything required to get your AT&T 3B2 online. The Network Service Utilities are required before installing the Wollongong TCP/IP driver stack.

NOTE: These files do NOT work with the emulator (yet!) because the emulator does not emulate an NI ethernet card (yet!). They're here in case they're useful for your real 3B2.

Image Size Description
ni.img 720 KB NI Ethernet Card Driver Version 1.1 Diskette
nsu_11.img 720 KB Network Service Utilities Version 1.1 Diskette (note: for use with SVR 3.0 only)
nsu_32.img 720 KB Network Service Utilities Version 3.2 Diskette (note: for use with SVR 3.2 and 3.2.2 only)
tcp_1.img 720 KB Wollongong Integrated Networking WIN/3B (TCP/IP) Release 3.0.1, Disk 1
tcp_2.img 720 KB Wollongong Integrated Networking WIN/3B (TCP/IP) Release 3.0.1, Disk 2
tcp_3.img 720 KB Wollongong Integrated Networking WIN/3B (TCP/IP) Release 3.0.1, Disk 3
tcp_4.img 720 KB Wollongong Integrated Networking WIN/3B (TCP/IP) Release 3.0.1, Disk 4
tcp_5.img 720 KB Wollongong Integrated Networking WIN/3B (TCP/IP) Release 3.0.1, Disk 5
tcp_6.img 720 KB Wollongong Integrated Networking WIN/3B (TCP/IP) Release 3.0.1, Disk 6