CP/M 2.2 BIOS

As with the ROM monitor program, there are two versions of the CP/M 2.2 BIOS available for the P112 board: the "first cut" BIOS from Dave Brooks, and Harold Bower's enhanced version. The last adds support for more floppy formats and uses user-cofigured parameters from the Non-Volatile RAM.

I've made some further additions to H. Bower's version, the changes are described below:

  • A RAM-disk is created out of the extra available memory. For that purpose, the BIOS relies on the proper initialization of the RAMLBR and RAMUBR registers of the Z180 CPU (normally done by the ROM monitor), rather than searching for the available memory.
    Note that I've also done a minor modification to the P112 ROM monitor program in order to preserve RAM contents between resets. Without the modifications the RAM disk will be trashed every time you hit the reset button.
  • The FDC is reset on disk errors. There are some cases when the FDC chip needs to be reset and reinitialized after an error occurs. An example: UZI180 comes with a set of utilities for managing UZI filesystems (ucp, mkfs, fsck, etc.). Although they run under CP/M, the utilities access the FDC I/O ports directly, bypassing the CP/M BIOS. They reprogram the FDC chip in non-DMA mode, while the BIOS uses DMA mode. If you try to use the ucp utility, for example, you'll discover that you can use the 'ls' command to list the directory of a UZI floppy, but you cannot copy files from a floppy in the second drive: CP/M aborts with an error message. One solution to the problem would be, of course, to rewrite the UZI disk drivers so they use the DMA mode instead, as the BIOS does. The other solution is to make the BIOS reset the FDC chip every time it detects a interrupt timeout condition.
  • One of the new features of the enhanced version of the ROM monitor is that it defines a new boot sector format. When using the new format, the floopy drive types and timing parameters are passed to the BIOS during boot time, so the last could make use of them during FDC initialization. Unfortunatelly, there is a minor mismatch between the ROM monitor and the BIOS regarding the order of these parameters that causes the BIOS to misinterpret the timing values, causing unexpected results.
  • The DMA count is checked to ensure succesful transfers, except for the "Read ID" FDC command.
  • Verbose disk error reports. The original BIOS is rather silent in that respect. When a disk error occurrs, the error is simply passed back to the CP/M BDOS, which bombs with the rather (in)famous
    BDOS err on A: Bad sector
    message. DOS+ will give you a bit more details, like the name of the file it was trying to access and BDOS function number, but there is no information at all about where the error physically occurred (track, sector) and its cause (was it a disk, controller, or drive failure? or perhaps you forgot to remove the write protect tab?). Occassionally the BIOS would get a bit more expressive: when an error happens while trying to load CCP during warm boot, it just puzzles you with a short, enigmatic FAIL message and then halts.

    I've added verbose error reporting at the expense of some memory. Now, when an error happens, you will get a message similar to this:
    Error on drive A, track 00, sector 01: Write protect
    which is quite a bit more useful, and a real aid if you are setting up a new board or debugging the BIOS.

Both the RAM-disk support and the verbose messages are implemented as options that can be enabled or disabled at compile time. By default both options are enabled, and if you want to disable one or both of them, all you have to do is to edit the BIOS.180 file and comment out the lines defining the VERBOSE and RAMDISK names accordingly.

The modified BIOS, including sources and a bootable floppy image, can be found in the downloads page.

See also

Bug-corrected floppy format utility.

Last updated 27-Feb-2005