Micro Vibe

My Micro Hobby Projects

  • Increase font size
  • Default font size
  • Decrease font size
Home CPM 80 CPM BIOS BIOS Overview

BIOS Overview



  The BIOS portion of CPM is responsible for the control of the computer system's hardware. The BIOS is written by the CPM system vendor to support any custom hardware the system may have. Once a vendor has created a custom BIOS for there system they use the MOVCPM.COM program to adjust the CPU jump addresses in the CPM CPP/BDOS binary image supplied by Digital Research to reflect the new CPM start address in memory. The BIOS is normally loaded at the highest possible memory address (max 64K). The BDOS is loaded on top of the BIOS, and the CPP loads on top of the BDOS.

cpm-memoryThe start of the BIOS code contains a table of sixteen 8080 jump instructions. Each of the jump instructions will execute one of sixteen possible CMP2.2 BIOS functions. The first jump instruction in the BIOS entry table executes the WBOOT function. Address zero in memory contains an 8080 jump instruction to the table entry for the WBOOT BIOS entry table. As all 8080 jump instructions are three bytes long we can calculate the address of any of the sixteen BIOS functions jump table entries. Memory address zero contains a jump instruction to the WBOOT function BIOS entry table address. The second and third bytes of this jump instruction (memory address one and two) contain the start address of the BIOS jump table. To calculate the start address of any BIOS function multiply the BIOS function index number by three and add the WBOOT function entry table memory address read from bytes one and two in memory. Once the BIOS function's memory address is calculated you execute the function using an 8080 CALL instruction. BIOS function parameters are passed and returned in the 8080 registers. The 8080 registers used depend on the BIOS function called.

The developers of the CPM operating system intended the BIOS functions to be used by the BDOS portion of the CPM code only. The reason for the address of the WBOOT jump table entry at address one is to allow a program to warm boot after it executes by jumping to address zero. Digital Research's CPM2.2 documentation indicated that program developers should only use the BDOS functions and not directly access the BIOS functions. The developers of CPM wanted all programs to use the BDOS functions to the point that even the WBOOT BIOS function can be executed by calling the BDOS service request zero. For many reasons programmers would often use the BIOS functions in there programs. One needs to take care when a program uses the BIOS functions directly and not allow the state of the computer system and the BDOS portion of CPM to get out of sync. While it is generally safe to use the BIOS serial oriented functions a program must be very careful when using the BIOS disk functions directly.

Other then the WBOOT BIOS function the remaining CPM2.2 BIOS functions fall into one of two types; serial functions, and disk functions.

The serial oriented BIOS functions transfer one ASCII character at a time to or from hardware devices and/or provide simple status about the devices. Under CPM2.2 there are four logical serial devices; console (CON), List (LST), Punch (PUN), and Reader (RDR). Each of the four logical serial devices can be mapped to any of four possible hardware devices. Each logical serial device has its own list of four physical devices. For a description of the logical to physical serial oriented device mappings see the information on the STAT Utility page. The BIOS has support for the reading, writing and providing status for the four logical serial devices. The BIOS serial oriented support functions and the WBOOT function are documented on the BIOS Serial Devices page.

The disk oriented BIOS functions are used to control any one of a possible sixteen disk drives. The BIOS disk support functions are used to transfer logical blocks of one hundred and twenty eight (128) bytes to a disk drive device. Only one disk drive can be selected at a time and all subsequent disk functions assume the last selected disk drive device. The BIOS block oriented support functions are documented on the BIOS Disk Devices page.

Last Updated on Saturday, 31 December 2016 10:25