Sunday, June 5, 2022

Introducing the retro-g15 Emulator

In the prior post, I described the origins and architecture of the Bendix G-15, a mid-1950s, binary, vacuum tube, drum memory computer system. In this post I will describe the retro-g15 software emulator I have written for that system. As with my earlier retro-b5500, retro-205, and retro-220 emulators, retro-g15 is written in JavaScript and runs in a standard web browser.

At time I am writing this, the emulator is at version 1.00. We don't yet have much software for the system, but it successfully runs a diagnostic program we do have, and appears to run the ubiquitous PPR (Program Preparation Routine) utility program correctly. The emulator presently implements only a basic G-15 system, supporting just paper tape and typewriter input/output. Support for magnetic tape, punched cards, and alphanumeric devices is feasible, but we don't yet have any software that requires those devices. Until we do, it is not worth trying to implement them.

For those who would like to jump ahead and start using the emulator, the source code and resource files for it are maintained as an open-source project at https://github.com/pkimpel/retro-g15/. You can run the emulator from a hosting site I have set up, or you can clone or download the files from the project's Git repository and set them up on your own web server. See the section Using the Emulator, below, for details on how to do this. Additional set-up and operating instructions can be found in the project wiki.

Choosing to Emulate the G-15

I studied Chemical Engineering at the University of Delaware from 1966 to 1970. During that time the campus Computer Center was located on the third floor of DuPont Hall. Outside the doors to that room and a short distance down the hall from it was a stairwell that went down to the ground floor. DuPont Hall is a three-story building, but for some reason the stairwell went up another half floor, where there was a large landing at the top.

On that landing, for the entire time I was on campus, there sat a Bendix G-15 in its turquoise livery, disconnected, forlorn, and all alone. I suspect that this may have been the University's first digital computer. By 1966, the G-15 was out of production, no longer supported, and seriously obsolete. My guess is that it had been decommissioned and moved up to the landing a couple of years before I arrived, to make room for the University's Scientific Data Systems 9300 computer, and then forgotten about. When I visited campus some years after graduation, I climbed back up to that landing, but the G-15 by that time was gone. I have no idea what happened to it.

I was intrigued by that abandoned system and wondered how it worked and how it had been used. That has remained sort of an idle curiosity since. I have a faint memory that someone (I don't remember who, probably one of my instructors) told me a G-15 had been used by Professors Jack Gerster and Robert Pigford to do pioneering work in modeling multi-tray distillation towers, a subject that would have been important to the large chemical industry in the Delaware River valley. If so, it would be interesting to know more about that, even though my days of understanding the chemistry, physics, and math of such a thing are long past.

As I approached retirement and had some success in building software emulators for old computer systems, I realized that this was now an itch that I could scratch. The bitsavers.org web site has a good collection of scanned G-15 manuals, and for the past couple of years I have been looking at those periodically. In late 2021 I started working on the design and development of the emulator in earnest.

Using the Emulator

As mentioned above, the emulator runs in a standard web browser, with Firefox and Chrome being the two I have used the most. You will also need a reasonably powerful workstation. Emulation of the G-15 instructions requires almost nothing, but update of the panels and I/O device windows can be graphics-intensive, and requires a fair amount of horsepower. My eight-year old Dell PC with a 3GHz quad-core Pentium i3 processor handles the emulator without difficulty.

The emulator must be served to your browser from a web server over HTTP. You will not be able to download the emulator files to your workstation and run them directly from your local file system. That is a limitation with the way that browsers work, not with the emulator. Of course, there's no reason you can't run a web server on your workstation and serve the emulator files from there. Regardless, once the emulator is loaded into your workstation, it runs entirely locally, and needs no further access to the web server.

Setting Up the Emulator

The easiest way to get started with the emulator is to run it from the hosting site where I have set up the emulator files. Feel free to use it:

If you would prefer to run the emulator from another web server, download the files from the Git repository on the project site. You can download a zip file of the latest version of the emulator source code and related resources by clicking the Download ZIP button on the repository's home page:

Alternatively, you can clone the project from the repository using the following Git command:

git clone https://github.com/pkimpel/retro-g15 retro-g15

Although the GitHub project site uses a Git source code repository, GitHub also allows you to access the repository using Subversion clients. A read-only checkout of the emulator files can be performed using a Subversion command similar to this:

 svn checkout https://github.com/pkimpel/retro-g15/trunk retro-g15

You will need at least the emulator/, webUI/, and webUI/resources/ directories from the repository. The emulator/ and webUI/ directories must be rooted in the same virtual directory on your web server. You may also wish to download/check out the software/ directory, as it contains some utility scripts, but that directory is not required to run the emulator.

The emulator may open a number of sub-windows when it initializes. Most browsers will consider these windows to be "pop-ups," so if you are using a pop-up blocker, you may need to disable it before starting the emulator. Most pop-up blockers will allow you to disable blocking for specific web sites, however, which will allow you to run the emulator without having to forgo protection from pop-ups for all sites. Modern browsers enable a pop-up blocker by default, and many browser toolbar plug-ins implement additional ones. All of them may need to be disabled for the emulator site.

More information on system requirements, setting up the emulator, and using a local web server is available on the Getting Started wiki page.

The Emulator Home Page

When you first load the emulator, it initializes with a default configuration, which is adequate to get started using it. Once it loads into your browser, it's ready to run. The hosting-site URL above references the emulator's home page, which looks like this:

retro-g15 emulator Home Page
retro-g15 Emulator Home Page

The picture on the page is the late Harry Huskey, the G-15 designer, apparently at the typewriter of his personal G-15 system. To start the emulator, just click the Start the Emulator button on the page. That will open the Control Panel for the emulator, which will overlay the Home Page in the same browser tab.

The Emulator Control Panel

The Control Panel for the emulator is a somewhat simplified version of the G-15 front panel and looks like this:

retro-g15 Control Panel and Typewriter

The top portion of the panel has the controls for the in-built paper tape punch and reader. The middle portion reproduces the lamps from the front the physical G-15 cabinet.The portion below that shows a few buttons and lamps that on a real G-15 were used to power the machine up and down; in the emulator those serve to initialize and terminate the emulator and are discussed in more detail below.

The meters and knobs on a real G-15 front panel are not shown -- they were used for monitoring power levels and maintenance functions, and are not relevant to the implementation or operation of the emulator.

Below the Control Panel is a gray box with a number of radio-button controls. These represent three toggle switches that were located on the base of the system's typewriter.

  • The ENABLE switch controlled the ability to enter certain hardware control commands from the typewriter keyboard.
  • The PAPER TAPE switch in its PUNCH position caused all characters sent to the typewriter to be output as well to the paper tape punch; in its REWIND position, it caused the paper tape reader to rewind its tape.
  • The COMPUTE switch controlled the G-15 processor. In its center (off) position, the processor was halted. Moving the switch to its GO position started the processor executing commands. Moving the switch to its BP (breakpoint) position worked like GO, but in addition, if the processor executed a command word with a particular bit set, the processor would halt. This feature was typically used for debugging.

The white area below the switches represents the "paper" of the typewriter. Its size is responsive to the size of the browser window, and will scroll once the typed output fills up the visible area. Your workstation keyboard functions as the typewriter keyboard and is active whenever the browser window has the input focus. Whether pressing a key on the keyboard has any effect on the system other than echoing that character to the paper depends on the setting of the ENABLE switch and whether a "Type In" command is currently being executed.

To power up a real G-15, you turned on the master A/C switch (labeled START) on the front panel. After the tubes in the power supplies warmed up, you would then press and hold the RESET button until the red DC lamp lit, then release the RESET button. At that point, the G-15 hardware performed an automatic sequence of functions that included:

  1. Read the first block of data from the paper tape reader to line (track) 19 on the drum.
  2. Copy that data from line 19 to a separate line on the drum known as the Number Track. This track provided a set of timing and logic signals to the hardware logic. The hardware logic also wrote to portions of this track during its operation, so that line on the drum had to function as a recirculating delay line like all of the others on the drum. All data was lost from these recirculating delay lines when the system was powered off, which is why the Number Track had to be reloaded each time the system was powered up.
  3. Set the Command Line register to 7, which would cause the processor to execute instructions from the four-word ("fast") line 23.
  4. Set the location of the next word to be executed from that line to zero.
  5. Read the next block of data from the paper tape reader to line 19. This block was typically a loader routine for some program that followed it on the tape. The way that paper tape was read on the G-15 required that line 23 be used as a high-speed buffer, allowing four words at a time to be read from the tape, then precessed (shifted) from line 23 to the beginning of line 19. The words had to be on the tape in reverse order, and the reading worked in such a manner that a copy of the four words stored at the beginning of line 19 were also left in line 23. Thus you actually bootstrapped a program from line 23, which usually transferred control to the actual loader routine located somewhere in line 19.
  6. Terminate the initialization process by turning on the green READY lamp and leaving the system in a halted state.

Initializing the emulator works in a very similar way. Clicking the Start the Emulator button on the Home Page is equivalent to turning on the master A/C switch. Once the Control Panel appears, you click the RESET button (although holding it down is not necessary). After a short delay the DC lamp lights and the system attempts to read two blocks from paper tape and perform the other actions described above.

The emulator does not actually use the data on the Number Track for its operations, but a program can execute a command that will copy the Number Track to line 18 on the drum, from which the program could read and make use of that data. Except for that detail, the emulator will still function properly if there is no tape in the reader when the RESET button is clicked, or if the first block does not actually contain Number Track data.

As a convenience, the emulator preloads the paper tape reader's buffer with a tape image for PPR (the Program Preparation Routine), a very common utility program for the G-15. This image has the Number Track data and the PPR loader as its first two blocks. Thus, by default you can simply start the emulator, click the RESET button, wait for the green READY light to come on, then move the COMPUTE switch to GO to run PPR. If you want to initialize the system with a different tape image, just unload the PPR image from the reader and load the other image before clicking RESET.

As another convenience, the ESC key on the keyboard can substitute for the ENABLE switch. It is a little awkward in the emulator to have to turn on the ENABLE switch, press a typewriter key for one of the hardware control commands, and then turn the switch off. Instead, you can use the ESC key like a shift key. If you press and hold the ESC key, the ENABLE switch will move to its ON position. Once you release the ESC key, the switch will revert to its off position.

For more information on the layout and functioning of the Control Panel, including the paper tape and typewriter devices, see the "Using the Control Panel" wiki page. For information on the hardware control commands, use of the ENABLE switch, and the PPR program, see the G-15 Operating Manual.

The G-15 was not a particularly easy system to use, and a great deal of responsibility fell on the person running the system to know how to perform the necessary functions and to do them properly. Aside from a few conveniences in its interface, the retro-g15 emulator works the same way -- by design. This is a time trip to 1950s computing and you are going to suffer, so plan to do some reading before trying to use the emulator.

The Diagnostic Panel

To aid in debugging the emulator, I implemented a more detailed panel that shows all of the registers, the current command word separated into its several fields, the current drum and command locations, and several significant flip-flops in the system. The panel displays all four of the 4-word (fast) lines and the MZ line that was used as an I/O buffer but was not visible to software. You can select a single 108-word (long) line for display as well.

At the bottom of the panel are three buttons that can be used to start, stop, and single-step the processor.

retro-g15 Diagnostic Panel

To open this panel, double-click the G-15 logo on the Control Panel. You can open and close the Diagnostic Panel at will while the emulator is running. "Powering off" the emulator automatically closes the Diagnostic Panel window if it is open. The panel updates itself at a rate of about 20Hz. The display of the drum lines updates a couple of times a second.

Even if you don't use it for diagnostic purposes, this panel can be interesting to watch while the system is running.

Software

We do not yet have much software for the G-15 in terms of standalone programs. There is more available and I am working to acquire it, but that is probably going to take some time. In the interim, thanks to David Green in Western Australia and Paul Pierce in Portland, Oregon, we have these three interesting items.

PPR (Program Preparation Routine)

PPR, as mentioned earlier, was a utility program that was used by most G-15 sites and developers. It was operated from the system's typewriter and provided features for:

  • Entering object code words as a series of decimal fields and assembling those fields into binary command words.
  • Reading existing object code from paper tapes and editing the code in memory.
  • Merging library routines from other paper tapes into memory.
  • Punching new tape from the edited code.
  • Typing the contents of tape blocks in hexadecimal.
  • Computing and typing out checksums of tape block contents.
  • Disassembling code from tape blocks in a format similar to that used for entering command words.
  • Debugging programs with breakpoints and tracing.
  • Creating the loader routines for a program.
  • Relocating code for library routines so they could be moved to different lines on the memory drum.

A bootable paper tape image of the program can be downloaded from the G15-software code repository. As described above, the retro-g15 emulator preloads this tape image into its paper tape reader during initialization. This tape image was obtained from David Green.

Instructions for running PPR can be found in the G-15 Operating Manual. A listing of the object code for the program, in the form of G-15 coding sheets, is available on bitsavers.org.

BXTST

The standard G-15 diagnostic program that was provided by Bendix.

A bootable paper tape image of the program can be downloaded from the G15-software code repository. Instructions for running the program and discussions of the various error codes can be found in "PART III - APPENDIX" of the G-15 Theory of Operations manual, starting on PDF page 193.

This is a bootable paper tape image and includes the Number Track and test loader as the first two blocks on the tape. This tape image is from Paul Pierce's web site. A slightly different version of the program from David Green, G15TAPE, is also available in that repository.

TQ

This is a short, one-block program that plays a numeric version of the game "Twenty Questions." The idea is that the player chooses a number between zero and 1048575 (220 - 1) and the program will discover that number.

A bootable tape image of the program and instructions for it can be downloaded from the G15-software code repository. This tape image was obtained from Paul Pierce.

In the next post to this blog, I will describe another interesting, but very short, program that I have recently recovered.


No comments:

Post a Comment

A G-15 Four-Word Memory Clear Program

A little over a year ago, while researching the Bendix G-15 computer system, I came across a blog, " The Way It Was: Tales from a life ...