An AT&T 3B2 Emulator

img

Introduction

The AT&T 3B2 was a series of small, multi-user UNIX computers developed by AT&T in 1985. They were 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.

The 3B2 emulator is part of the Open SIMH simulation framework.

Emulated Systems

The following standard 3B2 systems are emulated. More information about the 3B2 and 3B2 systems internals is cataloged on my website here.

3B2/400

3B2/700

Changelog

Getting the Emulator

The source code is open source, and is available on GitHub from the official SIMH repository.

Building on GNU/Linux or macOS

Building on GNU/Linux or macOS is fairly straightforward:

The binary will be built into the ./BIN/ directory.

If any additional libraries are required, the build process will alert you to the fact and let you know what you need.

Windows XP / 7 / 8 / 10 / 11

The standard way to build on Windows is with Visual Studio. Visual Studio Express 2008 is required at a minimum, and is used as the baseline for all SIMH projects.

Simply open the following two projects in a new solution:

You should then be able to build the solution.

Getting Software

The 3B2 line ran AT&T UNIX System V as its native operating system. To my knowledge, no other operating system was ever ported to them.

The very earliest 3B2s shipped with AT&T UNIX System V Release 1, but they almost immediately started shipping with AT&T UNIX System V Release 2, and after it became available, Release 3.

The last version of System V officially supported by the 3B2/310 and 3B2/400 was System V Release 3.2. The 3B2/700 ran System V Release 3.2.3 and System V Release 4.

Installing SVR 3 UNIX From Scratch

If you would like to install UNIX from scratch, there are now two guides that will walk you through every step. Note that the process is different between the 3B2/400 and the 3B2/700 emulators.

I encourage you to try these methods, but if you don’t want to go through all that work, keep reading.

Using A Prebuilt Hard Disk Image on the 3B2/400 or 3B2/700

To make getting started as painless as possible, I have prepared several hard disk images with UNIX pre-installed.

3B2/400

For the 3B2/400, all disk images are of the type HD135, to give you maximum free space. They were built on a emulator configured with:

To use any of the images below, simply download it, uncompress it, rename the uncompressed file to hd135.img, use the supplied boot.ini file (editing it to suit your own needs) and 3b2_400.bin ROM image, then start the emulator.

On Mac or Linux, start the emulator with the command:

3b2-400 boot.ini

On Windows, start the emulator with the command:

3B2-400.EXE BOOT.INI

The UNIX installations on these images are pristine and have not been configured. No system passwords have been set. You will have to log in as the setup user to do a system setup.

FileSizeDescription
boot.ini307 bytesEmulator Configuration File
3b2_400.bin128 KB3B2/400 ROM file
base.img.gz1.7 MBBase UNIX [1]
full.img.gz4.2 MBFull Install [2]
devel.img.gz6.3 MBDeveloper Tools [3]
extras_gnu_src.img.gz16 MBExtras, GNU, and Source [4]
  1. The Base UNIX image holds a minimal installation of the first six Essential Utilities disks, along with the Cartridge Tape Utilities and CTC driver, but nothing else.
  2. The Full Install image starts with the Base UNIX image, but also includes all 21 disks of the Utilities packages:
    • System Administration Utilities
    • Directory and File Maintenance Utilities
    • User Environment Utilities
    • Inter-Process Communication Utilities
    • Terminal Filter Utilities
    • Terminal Information Utilities
      • All terminfo files installed
    • Graphics Utilities
    • Basic Networking Utilities (UUCP)
    • Editing Utilities
    • Help Utilities
    • Line Printer Spooling Utilities
    • Performance Analysis Utilities
    • Spell Utilities
  3. The Developer Tools image starts with the Full Install, as above, but also adds:
    • Software Generation Utilities: Issue 4 Version 2
    • Extended Software Generation Utilities: Issue 4 Version 1
    • C Programming Language: Issue 4 Version 2
    • System Header Files (3.2)
    • Advanced C Utilities: Issue 4 Version 1
    • Source Code Control Utilities
  4. Finally, the Extras, GNU, and Source image starts with the Developer Tools, as above, but adds the following extras:
    • Lucent Year 2000 Patch
    • C-Kermit 5A(189) installed as /usr/bin/kermit
    • GNU gcc and g++ 2.3.3 under /usr/local
    • GNU make 3.75 installed under /usr/local
    • GNU tar 1.13 installed under /usr/local
    • GNU gzip 1.2.4 insatlled under /usr/local
    • GNU bison 1.25 installed under /usr/local
    • AT&T UNIX System V Release 3.2 Source Code Provision installed under /usr/src — you could rebuild the entire system from source if you wanted to.

3B2/700

For the 3B2/700, all disk images are of the type SD630, a 630MB SCSI disk. It was built on a emulator with the following configuration:

To use the hard disk image below, simply download it, uncompress it, and use the supplied 3b2_700.bin ROM file, the boot.ini configuration file (editing it to suit your own needs), nvram.bin NVRAM file, and tod.bin TOD clock file.

(The tod.bin and nvram.bin files are optional. They record the configured state of the emulator when UNIX was installed. If you don’t want to use them, you can skip them, but your clock will be reset to the year 2000!)

The UNIX installed on this image is pristene and has not been configured. No system passwords have been set. You should log in as the setup user (no password) to do a system setup.

FileSizeDescription
boot.ini307 bytesEmulator Configuration File
3b2_700.bin128 KB3B2/700 ROM file
nvram.bin8 KBNon-Volatile RAM image
tod.bin24 bytesTime-of-Day State
sd630.img.gz9 MBFull System V Release 3.2.3

The sd630 hard drive image includes the following software:

Usage

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

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 emulators. SIMH implements a great number of emulators, 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 with the 3B2/400 Emulator

The 3b2-400 binary (or 3B2-400.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-400

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

C:\some\directory> 3B2-400

In either case, you will 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 Current        git commit id: d11700e0
sim>

To quit at any time, just type quit and press the Enter key.

Example Startup File for the 3B2/400

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, you may create a file named boot.ini, and enter the following commands:

set cpu 4M
set cpu idle

load -r 3b2_400.bin

set mau enable

set idisk0 HD135
attach idisk0 hard_disk.img

attach ifloppy floppy_disk.img

attach nvram nvram.bin
attach tod tod.bin

attach contty 8000

set ctc enable

set ports enable
set ports lines=16
attach ports 9000

When you start the 3B2 emulator, 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 emulator 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

Emulator Options for the 3B2/400

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.

Loading the ROM

load -r 3b2_400.bin

This loads the ROM into read-only memory space in the emulator at adress 0x00000000. The -r flag is necessary to indicate that the file being loaded is a ROM.

MAU (Math Acceleration Unit)

set mau enable

This line enables the math acceleration co-processor, a WE32106. The WE32106 was an optional part that could be installed onto the system board of a 3B2/310 or 3B2/400. It is automatically detected by the operating system if it is present. If it is enabled, UNIX will use hardware floating point routines. If it is not enabled, UNIX will use floating point emulation.

(For context, many 3B2/310s and 3B2/400s shipped without the MAU installed, since it was an extra cost. Later models of the 3B2, including the 3B2/600 and 3B2/1000, had a WE32106 or WE32206 MAU as standard equipment)

Hard Disk Type

set idisk0 HD135

This command tells the emulator what type of hard disk is attached. idisk0 is the first emulated hard disk drive (idisk stands for “Integrated Disk”). A second hard disk may optionally be attached as idisk1.

HD135 tells the emulator that the hard disk is a Maxtor XT-2190 MFM drive formatted for 135MB.

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 idisk0 hard_disk.img

This line attaches the disk idisk0 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 ifloppy floppy_disk.img

This line, similar to the line above, attaches a virtual floppy disk image to the floppy drive. (ifloppy for “Integrated 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 enable
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 enable
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, and installs 4 virtual PORTS cards to support a total of 16 lines, listening for connections on TCP port 9000.

The number following set ports lines= must be a multiple of 4, and less than or equal to 32.

LPT Line Printer

The LPT line printer device is integral to the first installed PORTS card, so at least one PORTS card must be installed to use the line printer.

set ports enable
set ports lines=n
attach ports 9000
set lpt enable
attach lpt output.txt

This will enable the emulated 3B2 to print to the parallel port on the first PORTS card.

Booting The 3B2/400

To boot the emulated 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

FW ERROR 1-01: NVRAM SANITY FAILURE
               DEFAULT VALUES ASSUMED
               IF REPEATED, CHECK THE BATTERY

This is normal. Once the 3B2/400 has booted at least one time, and stored its settings into NVRAM, this message should not be repeated.

Disk Not Formatted Yet

If the hard disk image you’ve attached idisk0 to has not been formatted yet, or if no disk image is attached, you will see the following message.

FW ERROR 1-02: DISK SANITY FAILURE
               EXECUTION HALTED

Once the disk image has been formatted, or if you use a pre-built image from below, you should no longer see this message.

System Failure Prompt

If either of the above messages appear, or if UNIX has not yet been installed, you will see the following message

SYSTEM FAILURE: CONSULT YOUR SYSTEM ADMINISTRATION UTILITIES GUIDE

IMPORTANT: The SYSTEM FAILURE line is actually an invisible password prompt!

Type the default system maintenance password, which is mcp, and press Enter to continue.

Booting UNIX

Once you’ve entered the mcp password, you should see the message

Enter name of program to execute [ ]:

Simply type unix and press Enter.

Finally, you will be asked which device to boot from.

    Possible load devices are:

Option Number    Slot     Name
---------------------------------------
       0          0     FD5
       1          0     HD135-B

Enter Load Device Option Number [1 (HD135-B)]:

Enter 0 to boot from the floppy disk, or 1 to boot from the hard disk.

Automatic Boot

Once UNIX has been installed to the hard disk, the system always boots automatically from the first hard disk.

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.

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.

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:

Installing Kermit on the Emulator

NOTE: You can skip this step if you have used the pre-built hard disk image from above, because it already includes C-Kermit 5A(189) pre-installed.

To install C-Kermit, first attach the floppy image to the emulator with the following command:

sim> ATTACH IFLOPPY ck189.img

Then, in SVR3 UNIX, mount the floppy:

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

Finally, unmount the floppy image

# umount /dev/diskette

Copying Data from the Host Computer to the 3B2

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

    ATTACH CONTTY 8888
    

    or

    ENABLE PORTS
    SET PORTS LINES=8
    ATTACH PORTS 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:

    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)

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

This method is quite easy to use, but unfortunately limited to files no larger than about 22MB in size, since that’s the size of each blank tape.

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

On the Emulated 3B2

  1. Format a blank tape using the sysadm tapemgmt feature of SVR3. Or, if you want a pre-canned blank tape image, you can download one here. (22 kB compressed)

On the Linux host

  1. 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.:

    $ find . -depth -print | cpio -ov --format odc > ../example.cpio
    
  2. Use dd to write the archive into the blank area of the tape. By passing the seek=31 flag, we skip the tape header and seek to the actual data area of the tape image.

    $ dd if=example.cpio of=ctc_xfer.tap bs=512 seek=31 conv=notrunc
    
  3. Finally, attach the CTC tape image under SIMH

    sim> set ctc enable
    sim> attach ctc ctc_xfer.tap
    

On the Emulated 3B2

Now we can restore from tape, just like you would on a real 3B2.

# ctccpio -idumvT /dev/rSA/ctape1

This will restore the contents of the tape archive to the current directory.

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 concept is the same as the one used for CTC tapes, except you’re writing to a blank area of a hard disk instead.

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 hd72_xfer.img.gz and uncompress it.

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

    $ find . -depth -print | 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=hd72_xfer.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 idisk1 hd72
    sim> attach idisk1 hd72_xfer.img
    

On the Emulated 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 erase \^? 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