Home| Sanos| RC702| Rita| Documents| Links| Contact| Search|

RC700 CP/M


 

The RC700 was basically designed as a CP/M-80 computer although it could also be used with standalone systems like RC COMAL-80. While CP/M boot disks for RC700 have been preserved, the original source code for building CP/M for the RC700 was not publicly available. Digital Research Inc. was founded in 1974 by Gary Kildall to market and develop the CP/M operating system. Digital Research was acquired by Novell in 1991, which sold the rights to CP/M to Caldera in 1996. In 2001, Caldera released the CP/M source code under an open source license, allowing redistribution and modification, via Tim Olmstead's "The Unofficial CP/M Web site", so today the source code for CP/M is publicly available.

When Regnecentralen developed the RC700 system in 1979, they adapted CP/M for the RC700 by implementing a RC700-specific BIOS to interface CP/M to the RC700 hardware. The source code for this R700 BIOS was proprietary and has never officially been released by Regnecentralen. However, I found a printout of a patched version of the RC700 BIOS in the archives of DDHF, and I have used this to reconstruct the source code for the RC700 BIOS. I also found a disk in the DDHF archives with the source code for the RC700 autoloader, which is stored in the 2K ROM used for booting the RC700. This means that I now have all the source code for building RC700 CP/M from scratch.

 

Booting RC700 CP/M

 

FFFFH
BIOS (9k) DA00H
BDOS (3.5k) INIT D480H
CC00H
CCP (2k) C400H
TPA (51k) 0100H
0000H

The CP/M operating system was designed to run on a variety of different 8080-based micro computers, so an interface between the operating system and the hardware was needed. CP/M was divided into four parts, called the Basic Input/Output System (BIOS), the Basic Disk Operating System (BDOS), the Console Command Processor (CCP), and the Transient Program Area (TPA). The BIOS was a hardware-dependent module that defined the low level interface between CP/M and the RC700 hardware. The BDOS interfaced to the BIOS through a jump table at the beginning of the BIOS. The CCP was used for interpreting and executing commands from the command line, and the TPA was the memory area used for running application programs.

The RC700 autoloader is stored in a 2K boot ROM. When the RC702 is reset, the lower 2K of the memory is mapped to the boot ROM, enabling the system to start the autoloader program. The autoloader is responsible for loading the operating system from disk into memory. It starts by moving itself to address A000H, and after initializing the hardware to a known state, it loads the RC700 BIOS, including the INIT section, from the first track of the first floppy disk (or hard disk) into the lower part of of RAM. The ROM can be disabled using an OUT 0x18,A instruction, making the full 64K RAM available. It then transfers control to the BIOS by jumping to the entry point, which is stored in the first word at address 0000H.

The INIT portion of the BIOS starts out by moving itself and the BIOS to address D480H. It then initializes all the hardware devices, and then performs a warm boot, which loads the CP/M CCP and BDOS from track 1 of the boot disk to address C400H. This will overwrite the INIT section of the BIOS, but it is no longer needed after initialization. After loading the CCP and the BDOS, it starts the Console Command Processor by jumping to C400. The CP/M system is now up and running and will display the "A>" prompt to start accepting user commands. If you enter the name of a program (.COM file), this will be loaded into the TPA at address 0100H, and will be executed.

 

Source Code and Tools

 

In order to make a RC700 CP/M boot disk we need to build the RC700 BIOS and the CP/M CCP+BDOS and write these to track 0 and 1 respectively on the boot disk. Building these from source requires a number of CP/M tools:

MAC.COMCP/M Macro Assembler
LINK.COMCP/M Linker
M80.COMMicrosoft MACRO-80 Assembler
DDT.COMCP/M Debugger
SYSGEN.COMCP/M System Generation Utility (customized RC version)
LOAD.COMCP/M Command File Loader

 

We also need all the source files for the RC700 BIOS as well as the source code for CP/M:

BOOTROB358.MACAUTOLOADER FOR THE RC700 AND RC703 MICROCOMPUTER
BIOSBIOS.MACMAIN SOURCE FILE FOR RC700 CP/M BIOS
BIOSBIOSTYPE.MACBIOS CONFIGUATION PARAMETERS
BIOSINIPARMS.MACHARDWARE INITIALIZATION PARAMETERS
BIOSDANISH.MACDANISH INPUT/OUTPUT CONVERSION TABLES
BIOSINIT.MACHARDWARE INITIALIZATION CODE
BIOSCPMBOOT.MACCP/M BIOS JUMP TABLE AND BIOS EXTENTIONS
BIOSSIO.MACZ-80 SIO DRIVER
BIOSDISPLAY.MACDISPLAY DRIVER
BIOSFLOPPY.MACFLOPPY DISK DRIVER
BIOSHARDDSK.MACWINCHESTER DISK DRIVER
BIOSDISKTAB.MACDISK DEFINITION TABLES
BIOSINTTAB.MACINTERRUPT TABLE
BIOSPIO.MACZ-80 PIO DRIVER
BDOSOS3BDOS.ASMCP/M BASIC DISK OPERATING SYSTEM
CCPOS2CCP.ASMCP/M CONSOLE COMMAND PROCESSOR
ASMAS0COM.ASMCP/M ASSEMBLER, COMMON DATA
ASMAS1IO.ASMCP/M ASSEMBLER, I/O MODULE
ASMAS2SCAN.ASMCP/M ASSEMBLER, SCANNER MODULE
ASMAS3SYM.ASMCP/M ASSEMBLER, SYMBOL TABLE MODULE
ASMAS4SEAR.ASMCP/M ASSEMBLER, TABLE SEARCH MODULE
ASMAS5OPER.ASMCP/M ASSEMBLER, OPERAND SCAN MODULE
ASMAS6MAIN.ASMCP/M ASSEMBLER, MAIN MODULE
DUMPDUMP.ASMCP/M FILE DUMP PROGRAM
FILEXFILEX.ASMRC FILE EXCHANGE PROGRAM

 

I have made a hard disk image for the RC700 emulator with all the source files and tools needed for building a RC700 CP/M boot disk:

~/rc700$ wget http://www.jbox.dk/rc702/cpmhd.zip
~/rc700$ unzip cpmhd.zip↵
~/rc700$ ./rc700 -hd CPMHD.IMG CPM.IMD↵

 

Building CP/M

 

Build RC700 autoloader:
C>D:↵
D>M80 ROB358.REL,ROB358.LST=ROB358.MAC↵

No Fatal error(s)

D>LINK ROB358.ROM=ROB358.REL[LD000↵
LINK 1.31

ABSOLUTE     0000
CODE SIZE    0800 (0000-07FF)
DATA SIZE    0000
COMMON SIZE  0000
USE FACTOR     00
Build RC700 BIOS:
D>M80 BIOS.REL,BIOS.LST=BIOS.MAC↵

No Fatal error(s)

D>LINK BIOS.BIN=BIOS.REL[LD0000↵
LINK 1.31

ABSOLUTE     0000
CODE SIZE    17ED (0000-17EC)
DATA SIZE    0000
COMMON SIZE  0000
USE FACTOR     00
Build CP/M CCP and BDOS:
D>MAC OS2CCP↵
CP/M MACRO ASSEM 2.0
CBF2
00EH USE FACTOR
END OF ASSEMBLY

D>MAC OS3BDOS↵
CP/M MACRO ASSEM 2.0
D9EE
01FH USE FACTOR
END OF ASSEMBLY

 

Installing CP/M

 

We now have the RC700 BIOS in BIOS.BIN, the CP/M BDOS in OS3BDOS.HEX, and the CP/M CCP in OS2CCP.HEX. These need to be written to the boot tracks on the boot disk using the SYSGEN utility. This is a customized version for RC700 that can write both CP/M and the RC700 INIT and BIOS sections. We first use DDT to place these files in a memory section starting at 0900H, with the following layout:

 

Part File Address Length SYSGEN location Disk location
CCP OS2CCP.HEX C400H 2048 0900H-10FFH Track 1
BDOS OS2BDOS.HEX CC00H 3584 1100H-1EFFH Track 1
INIT & BIOS BIOS.BIN D480H 6144 2D00H-34FFH
3D00H-4CFFH
Track 0

 

By just pressing RETURN at the first SYSGEN prompt, SYSGEN will skip reading the system from a disk and instead use the memory image we have set up at 0900H:

D>DDT↵
DDT VERS 2.2
-F0900,4EFF,0↵
-IOS2CCP.HEX↵
-R4500↵
NEXT  PC
10BB C400
-IOS3BDOS.HEX↵
-R4500↵
NEXT  PC
1EB3 0000
-IBIOS.BIN↵
-R3400↵
NEXT  PC
4D00 0000
-M3500,3EFF,2D00↵
-G0↵
D>SYSGEN↵
SYSGEN VER 2.0
SOURCE DRIVE NAME (OR RETURN TO SKIP)
DESTINATION DRIVE NAME (OR RETURN TO REBOOT)A
DESTINATION ON A, THEN TYPE RETURN
FUNCTION COMPLETE
DESTINATION DRIVE NAME (OR RETURN TO REBOOT)

The floppy in drive A now contains a boot sector with the new CP/M version built from the source code, and you can now boot from this floppy:

RC700 56k CP/M vers.2.2 rel.2.3

A>_

Please notice that the reconstructed version of RC700 CP/M is called release 2.3 to distinguish it from the original versions.

 

Building CP/M utilities

 

Building ASM:

D>MAC AS0COM↵
CP/M MACRO ASSEM 2.0
01D8
001H USE FACTOR
END OF ASSEMBLY

D>MAC AS1IO↵
CP/M MACRO ASSEM 2.0
10F8
008H USE FACTOR
END OF ASSEMBLY

D>MAC AS2SCAN↵
CP/M MACRO ASSEM 2.0
132D
005H USE FACTOR
END OF ASSEMBLY

D>MAC AS3SYM↵
CP/M MACRO ASSEM 2.0
159E
004H USE FACTOR
END OF ASSEMBLY

D>MAC AS4SEAR↵
CP/M MACRO ASSEM 2.0
185E
006H USE FACTOR
END OF ASSEMBLY

D>MAC AS5OPER↵
CP/M MACRO ASSEM 2.0
1B8D
008H USE FACTOR
END OF ASSEMBLY

D>MAC AS6MAIN↵
CP/M MACRO ASSEM 2.0
20F0
00AH USE FACTOR
END OF ASSEMBLY

D>DDT↵
DDT VERS 2.2
-F100,2100,0↵
-IAS0COM.HEX↵
-R↵
NEXT  PC
01D6 0000
-IAS1IO.HEX↵
-R↵
NEXT  PC
10F8 0000
-IAS2SCAN.HEX↵
-R↵
NEXT  PC
132D 0000
-IAS3SYM.HEX↵
-R↵
NEXT  PC
1591 0000
-IAS4SEAR.HEX↵
-R↵
NEXT  PC
185E 0000
-IAS5OPER.HEX↵
-R↵
NEXT  PC
1B8D 0000
-IAS6MAIN.HEX↵
-R↵
NEXT  PC
20EB 0000
-G0↵

D>SAVE 32 ASM.COM↵

Building DUMP:

D>MAC DUMP↵
CP/M MACRO ASSEM 2.0
0257
002H USE FACTOR
END OF ASSEMBLY

D>LOAD DUMP↵

FIRST ADDRESS 0100
LAST  ADDRESS 0212
BYTES READ    0113
RECORDS WRITTEN 03

Building FILEX:

D>ASM FILEX↵
CP/M ASSEMBLER - VER 1.4
0932
009H USE FACTOR
END OF ASSEMBLY

D>LOAD FILEX↵

FIRST ADDRESS 0100
LAST  ADDRESS 0931
BYTES READ    06FC
RECORDS WRITTEN 11

 

Installing CP/M utilities

 

D>PIP A:=ASM.COM↵
D>PIP A:=DUMP.COM↵
D>PIP A:=FILEX.COM↵

 

Missing CP/M utilities