The Gemini 80-Bus Saga - Part 1

From GlassTTY
Revision as of 07:35, 16 May 2019 by John (talk | contribs) (MBasic (Basic-80))
Jump to: navigation, search
PS/2 to Parallel ASCII keyboard adapter.
Close up of the PS/2 to Parallel ASCII keyboard adapter.
Loading MBasic using the RS232 port.
Loading and running MBasic using the Cassette .
Loading and running ZSID using the Cassette .


This article describes the journey undertaken in order to bring a Gemini 80-Bus CP/M system back to life. The system was purchased from eBay in April 2019 and included quite a lot of documentation and circuit diagrams. Should be easy right?

A Potted History

The original Gemini 80-Bus system was a two board system designed to be a replacement for the popular UK computer, the Nascom-2. Nascom had been taken into receivership and there was concern from outside the company that if buyer could not be found, the whole Nascom community would die. The new company Gemini, was headed by John Marshall who had previously headed Nascom and was based in Amersham, Buckinghamshire, England.

The 80-bus system used in Gemini machines was a tidied up version of the bus used on the Nascom and was thought by many to be the UK's answer to the S100 bus. The bus was backward compatible with the Nascom bus and provided a means for Nascom owners to expand and improve their systems. The Gemini boards were 8 inches square and were typically fitted into a 19 inch rack and as the company grew many types of expansion boards were produced. A Gemini system could consist of a singe board or have its functionality spread across multiple boards making the the system very flexible. In addition many other companies supplied 80-bus compatible cards.

The Gemini system was primarily designed to be a CP/M system and, with the right expansion cards, could support 8 and 5.25 inch floppy drives as well as Winchester (hard) disk drives.

My Gemini System

In April 2019 I took delivery of what appears to be a fairly typical Gemini system. The computer consisted of a G811 Z80 CPU card, a MAP80 memory card populated with 64K of Memory, an G812 intelligent video card and a GM829 floppy/hard disk controller card. These were all fitted to a 19 inch rack with a home made Veroboard based backplane. All that was needed was a power supply, a suitable keyboard, disk drives and software. Hmmm!

There were a couple of interesting details regarding the machine, the first is that it includes RP/M version 2.2. This is odd as version 2.2 of RP/M was (supposedly) never released, the version numbers leapt from V2.1 to V2.3 to avoid confusion with version 2.2 of CP/M, this was confirmed in an article written for 80-bus news by RP/Ms creator Richard Beal (80-BUS vol. 3 iss. 6 p. 9).

The second interesting thing is that there is also an EPROM containing the Gemini Boot ROM for 8 inch Disks. This appears to be written by Roger Brooks, and, based on the included source code listings and manuscript amendments, this would appear be the machine he created it on. So, if Roger is reading this or anyone knows anything about Roger please get in touch via twitter @johnnewcombeuk (

Power Supply Unit

For the PSU I opted to use an ATX PSU with a 24 pin connector. I used a 24 pin extension lead to attach to the Gemini backplane which meant that the PSU could simply be plugged into the Gemini and swapped as required. The Gemini documentation suggests that the usual +12v, +5v, -12v and -5v supplies are required. However the later ATX PSU units do not tend to supply -5v. Checking the circuit diagrams for the cards I am using showed that a -5v supply was not actually required making things simple.

A Two Card System

The CPU board includes, ports for an RS232 serial device, a keyboard and a cassette tape recorder. The card also includes an EPROM based system monitor called RP/M (see below). The card is configured using a series of wire straps placed on DIL headers and was, as you would expect, configured to use the external G812 video card I had.

My initial aim was to see the system running with the minimum of hardware, namely the CPU board and the memory board. By making the connection between pins 6 and 7 on link LKB1 on the CPU board I configured the system to use the serial port for input/output. In the end I added a small jumper that could be used as required to switch between using the serial port and the video controller. By using the serial port for control, all that was required was to create a short lead and connect to a machine running a terminal emulator set to 300 baud (7E1).

Inspection of the CPU board showed a couple of issues, the first was rusty pins on a couple of ICs. In this case they were the two Proms used for addressing. Unfortunately the affected pins broke off flush with the plastic body of the IC as soon as they were disturbed. However, by grinding away a slither of the plastic IC casing with a Dremel, fresh metal was exposed allowing me to attach some pins from a donor IC. The second issue was that the EPROM that contained the system monitor had been inserted incorrectly and seemed to have been splashed with a large blob of paint. This was easily remedied before powering up the two card system.

   57344 bytes - RP/M for Gemini V2.2
   ** RP/M ready **

At this point I was able to use the monitor to inspect and set memory, so I dumped the contents of the RP/M EPROM to the screen of my terminal emulator and pasted this into a text file for safe keeping.

For the knowledgable amongst you, you will notice that the Version of RP/M is 2.2. This is odd as version 2.2 of RP/M was (supposedly) never released, the version numbers leapt from V2.1 to V2.3 to avoid confusion with version 2.2 of CP/M, this was confirmed in an article written for 80-bus news by RP/Ms creator Richard Beal (80-BUS vol. 3 iss. 6 p. 9).

A Three Card System

By removing the connection between pins 6 and 7 on link LKB1 on the CPU card and inserting the video card, the system proudly displayed the ready message on the connected composite monitor.

     IVC Monitor V2 - 1982
   57344 bytes - RP/M for Gemini V2.2
   ** RP/M ready **

However, without a keyboard, not much more could be achieved.

Parallel ASCII Keyboard Converter

The Gemini was designed to use a parallel ASCII keyboard and, whilst I had an old Apple II clone keyboard that probably could have been coaxed into life, I wanted a keyboard with function keys and a full set of cursor keys. I decided that until I could obtain an original Gemini keyboard, the best solution would be to use a PS/2 keyboard and make a simple Arduino based PS/2 to parallel ASCII adapter. I used the small Arduino Micro and created a sketch to do the trick.

The sketch is described here and the wiring diagram to connect the Arduino to the IVC card and the PS/2 connector is shown in #Appendix A - PS/2 to Parallel ASCII Converter Wiring Diagram.

Once I had the keyboard connected and working, I needed to try and run some software.

MBasic (Basic-80)

RP/M is a system monitor written by Richard Beal specifically for the Gemini system and is uses a subset of the CP/M api in that something written 'against' RP/M will also run on CP/M the reverse is not necessarily true as RP/M supports only one sequential file being opened at a time and random access is not supported. RP/M was designed support cassette based storage rather than disks, although it will allow booting to disk. Having said that, it is reported that the CP/M version of MBasic and Digital Research's ZSID Dynamic Debugging Program will run under RP/M, so, given the absence of any form of disk storage this seemed to me to be the logical next step, so I downloaded the binary from one of the many CP/M repositories with the aim of somehow getting it into the machine.

Despite the absence of MBasic on cassette tape, I had a few options to explore. The first was to try and create a .wav file containing MBasic in cassette format (KCS/CUTS). The difficulty here is that whilst is is reasonably easy to create a .wav audio file from an array of bytes, there is more to a Gemini tape archive than just a stream of audio. The Gemini RP/M tape system adds a header to the stream including a filename and, on the basis that an error results in a prompt to rewind the tape before continuing, it is safe to assume that each block of data (128 bytes) includes a frame number and checksum.

The second option is to enter the byte values directly into the monitor, or rather, paste the data into a terminal emulator window. It is an approach that has worked for me before. By ensuring that each CR/NL is followed by a short delay, the system can easily cope with the pasting of a large amount of data. So for this to work is was necessary to switch back to using the RS232 port with a terminal emulator (see #A Two Card System).

The first task was up the speed of the serial port from 300 baud to 9600 baud. This can be done at the RP/M prompt e.g.

   ** RP/M ready **
   * UD 9600

After entering this command, change the speed setting of the terminal emulator to match. Next set the CR delay to 200ms, this value was determined from trial and error. The higher the value, the more reliable and the slower the transfer is, 200ms seems to be optimal. I tend to use Minicom as a terminal emulator which can be configured by selecting the Meta Z (typically Esc+Z) to bring up the main menu, from here the Terminal Settings option can be selected in order to set the delay.

Next, the MBASIC.COM binary file needs to be converted to a HEX file in the following format (see #Appendix B - Creating an RP/M Hex File) and pasted into the terminal window.

   S 100
   c3 8c 5d 7a 29 dc 29 06 44 bf 11 9e 45 ec 14 63 18 86 39 40 19 18 15 95 14 67 14 51 16 e6 43 7d 14 d1 14 ee 14 01 44 9c 
   16 0e 45 89 20 20 43 85 15 73 44 03 20 2b 1e c0 22 5d 44 c9 0c c9 0c fd 1f 94 16 84 20 00 00 24 20 ee 14 7c 44 7d 44 82
   44 c4 44 e3 3c 10 16 d3 15 7c 22 ...
   ... 38 31 0d 0a 00 00 00 00 00 00 00 00

The S 100 RP/M command allows data to be set in memory starting at address 0100h. In this example each row has 40 hex bytes although anything from 1 to 42 is possible the more hex digits in the row, the quicker the transfer will be. The final full stop should return you to the RPM prompt.

After 2-3 minutes, all 24340 bytes should have been entered and time to see the results. Press I to run the code fro 0100h e.g.

   ** RP/M ready **
   * I
   BASIC-80 Rev. 5.21
   [CP/M Version]
   Copyright 1977-1981 (C) by Microsoft
   Created: 28-Jul-81
   31538 Bytes free

The files below contain the RPM txt files for MBasic and ZSID.

Creating a Cassette Tape of MBasic

This turned out to be far easier than expected. I knew that if the method described above was used to enter data using the RS232 port, it would not be possible to switch to the cassette interface to save the program to tape. This is due to the serial hardware being used for both RS232 and cassette. However, it turns out that the G811 CPU board can support both the IVC and RS232 as input with IVC providing the display. Therefore with the configuration set to use the IVC (see #A Three Card System data can still be entered using the RS232 port.

By using the PS/2 keyboard to set the serial baud rate to 9600 e.g.

   ** RP/M ready **
   * UD 9600

The process described in the above section (#Running Some Software) can then be used to load MBasic into memory although I did find it necessary to set the character delay to 50ms and the CR delay to 250ms. Once the data has been loaded all that is required is to tell RP/M the size of the program using the L command before switching to cassette using UC and writing the program to tape e.g.

   * L BE
   * UC

Once the recording is complete it can be tested by using the R command e.g.

   Insert file: MBASIC
   Start Playing Press return
   Remove file: MBASIC
   Press return

The program can then be run with the I command e.g.

   * I
   BASIC-80 Rev. 5.21
   [CP/M Version]
   Copyright 1977-1981 (C) by Microsoft
   Created: 28-Jul-81
   31538 Bytes free

For details of the tape connector see #Appendix C - Tape Connector.

The XBeaver Gemini Emulator

In order to take things further I needed to get up and running with a floppy disk solution to boot CP/M but before that I needed to obtain some disks.

John B Hanson ( has created an emulator that can emulate, amongst others, the Gemini system and after contacting him via the UK Vintage Radio Repair and Restoration forum ( he very kindly sent me some Gemini CP/M images in .DMP format. As his emulator supports DMP format, I thought it would be useful to get it up and running.

The code can be downloaded from and can be compiled for many systems.


To compile this on a recent version (May 2019) of Arch Linux (my distribution of choice), a few changes to the Makefile were made as follows.

A change was made to CC label to include the tirpc include folder, e.g.

   CC =gcc -I/usr/include/tirpc

The linux section of the Makefile was modified to be as follows

          $(CC) $(CFLAGS) $(VIRTUALBEAVER_OBJS) -o xbeaver \
            -ltirpc -lX11 -lXpm -lXt -lncurses -lm -lutil

On my system all of the linked libraries in the above command line were present on the system making things very simple. If these are missing simply install the package as required. The libraries are as follows.

In addition to making sure that the libraries above were installed, the festival speech package was added with an english voice e.g.

   # pacman -S festival
   # pacman -S festival-english

Keyboard Input Issues

I use KDE/SDDM as my windowing environment, however with this combination there was an issue with Xbeaver in that I could not switch focus to the Xbeaver window. The README file that came with the download describes the issue. The work-around for me was to ust TWM as a window manager for times when I was using Xbeaver. If I get time in the future I will try and see what the issue is with KDE/SDDM as it would be great to use it without switching environments. I understand that Gnome does not have the issue although Openbox and LXDE do.


The default configuration gave me an all singing all dancing Gemini system, however, as I was looking to emulate my own physical system I decided to start with a minimalist configuration.

The basic xbeaver.cfg file I used was as follows.

   cpuclock 4
   board 0xfe gm813_mmu
   board 0xb0 gm832 BeaverBoot planes green
   board 0xb8 serial_8250 bvrnet ~/beaver/network
   board 0xe0 gm829_floppy -debug DSZ -geometry DP35.2.10.512 ~/beaver/images/GM512_ORIGINAL.DMP
   binload 0xf000 ~/beaver/roms/RPM_2.3.ROM
   byte 0f0a8 21 00 f0 #Patch top of ram for RPM

Note that I am using version 2.3 of RP/M (see below).

A Note about RP/M Versions

RP/M is one of the monitor programs, supplied in EPROM, that was available for the G811 processor board. Version 0.1 was the initial release, the second enhanced version was 2.0. When the MAP256 memory board was released there was, under certain hardware combinations, a conflict with RP/M when it was trying to detect if a disk was present. This was entirely due to the MAP256 board, however, a small patch was made available for RP/M to deal with the anomaly, this was deemed to be version 2.1. Version 2.2 was never released in order not to be confused with CP/M 2.2 and the final version was 2.3 which had some enhanced disk boot routines.

My system was supplied with version 2.2 which, according to Richard Beal, the authors of RP/M, never existed. It appears that 2.2 I is a patched version of 2.1 to work with a different disk arrangement. Thanks go to John B Hanson for determining this. As a result I have now been able to create version 2.3 for use with Xbeaver and, until I sort out an EPROM programmer, I will use version 2.1 on the real hardware.




A Note From the Author

I am very keen to get the machine to run CP/M as originally intended and, eventually, I would love the machine to operate with a hard disk. Clearly I have a lot of work to do and a lot to learn about the Gemini. If anyone owns or has a connection with the Gemini, please get in touch, I would love to talk things through with others and find out more about the company and its history. I can be contacted via twitter @johnnewcombeuk.

I would also like to take this opportunity to thank to John B. Hanson for helping me locate the Gemini version of CP/M, and others that have added their support via forums and social media.

John Newcombe

Appendix A - PS/2 to Parallel ASCII Converter Wiring Diagram

This is the wiring diagram for the PS/2 to parallel ASCII keyboard converter described in the text. The associated sketch is described here

   IVC Keyboard Connector              Arduino   Usage
            1 ------------------------- VIN
            2 ------------------------- Pin 12    STRB
            3 N/C
            4 N/C
            5 ------------------------- Pin 10    D5
            6 ------------------------- Pin 9     D4
            7 ------------------------- Pin 11    D6
            8 ------------------------- GND
            9 N/C
           10 ------------------------- Pin 7     D2
           11 ------------------------- Pin 8     D3
           12 ------------------------- Pin 5     D0
           13 ------------------------- Pin 6     D1
           14 N/C
           15 N/C
           16 N/C
   PS/2 Keyboard Connector         Arduino Pin   Usage
           5V ------------------------- 5V
          GND ------------------------- GND
          CLK ------------------------- Pin 2     CLK
         DATA ------------------------- Pin 3     DATA

Appendix B - Creating an RP/M Hex File

The following Python script will take the binary file MBASIC.COM and create a HEX file suitable for pasting into a terminal emulator. See #Running Some Software.

   #!/usr/bin/env python3
   LINE_LENGTH = 40 # Number of entries passed to the RP/M monitor per line, should be less than 42
   def write_rpm(filename, rawdata):
       rpm_file = open(filename, "w")
       rpm_file.write("S 0100\r\n")
       count = 0;
       for byt in rawdata:
           rpm_file.write("{0:02x} ".format(byt))
           count +=1
           if count % LINE_LENGTH ==0:
       rpm_file.write("L {0:02x}\r\n".format(int(length / 128)))
   if __name__ == '__main__':
       # Read the binary file
       data = open("MBASIC.COM", "br").read()
       # create abyte array
       rawdata = bytearray(data)
       # create rpm package file
       write_rpm("mbasic_rpm.txt", rawdata)

Appendix C - Tape Connector

Tape DIN Connector as viewd from the front of the G811 CPU card.

           \ |
   Gnd    -
           / |