I use one of my P112 boards to control a measurement instrument. The board collects the data from the instrument and stores it into a FIFO from where it is later transferred to a PC, which is kept busy doing complex processings. The P112 also performs some background analysis on the data accumulated in the FIFO in order to optimize the instrument settings, and generates the signals needed to operate step motors which move the sample.

The requeriments of the task called for the use of a real-time multitasking OS. I tried originally UZI180, but at that time it was not stable at all, and the task scheduler is not quite suitable for real-time applications, often the task would be in sleeping state longer than I wanted. I then turned to MP/M, which did the job extremely well. I have typically 3 processes running: one busy gathering the data from the instrument and sending it to the PC via the second serial line, a lower priority one that does a simple sliding-window FFT on the gathered data and uses the result to tune certain instrument voltages, and a third one that wakes up every 2 seconds to advance the step motors which move the sample. I can even start a fourth monitoring process on the first serial line without having any data loss.

I tried both MP/M 1.1 and MP/M-II, they both performed approximately equal, although MP/M 1.1 seemed to be a bit faster.

In the downloads page you can find my MP/M 1.1 XIOS implementation for the P112 board (does not include the data-collection routines and queues needed by my specific application), as well as bootable floppy images. Included also are Y2K updates for the TOD and SCHED utilities, and an updated DS1202 utility that can set the system time from the CMOS clock chip.

The current version of the XIOS implements the following features:

  • Support for two consoles: the main terminal at 19200 baud, the second at 9600 baud (like in UZI180, the baud rates are fixed in this version).
  • Floppy disks: the same formats as the enhanced CP/M BIOS supports.
  • Task-switching by timer interrupts (50 ticks per second).
  • Banked memory support, up to the maximum 8 segments allowed by MP/M. Common area size is 16K, giving a bank size of 48K.
  • Customized MPMLDR.COM and boot loader.
  • No GIDE or SCSI support yet.

The bootable image was generated with support for 8 memory banks, so a P112 with at least 512K is recommended. The timing parameters are for a CPU running at 16 MHz. Of course, you can use a machine with less memory, but you'll have to run GENSYS again and specify a different number of memory segments.

Compiling the XIOS

I used Microsoft's M80 and Digital Research's LINK to generate the .SPR image:

M80 =XIOS.180

The system was generated as shown below (consult the MP/M manual for more details):


MP/M 1.1 System Generation

Top page of memory = ff
Number of consoles = 2
Breakpoint RST #   = 6
Add system call user stacks (Y/N)? y
Z80 CPU (Y/N)? y
Bank switched memory (Y/N)? y
Banked BDOS file manager (Y/N)? y
Enter memory segment table: (ff terminates list)
 Base,size,attrib,bank = 0,b5,0,0
 Base,size,attrib,bank = 0,c0,0,1
 Base,size,attrib,bank = 0,c0,0,1
 Base,size,attrib,bank = 0,c0,0,3
 Base,size,attrib,bank = 0,c0,0,4
 Base,size,attrib,bank = 0,c0,0,5
 Base,size,attrib,bank = 0,c0,0,6
 Base,size,attrib,bank = 0,c0,0,7
 Entry terminated, 8 segments maximum
Select Resident System Processes: (Y/N)
ABORT    ? n
SCHED    ? n
SPOOL    ? n

CCP+ Ver. 2.2

To load the new system, just run MPMLDR (a version tailored for the P112 is provided). Alternatively, you can just reboot the P112 if MPMLDR has been saved into the boot tracks of the floppy:


D-X Designs P112 Loader Bios (V2.1)

MP/M 1.1 Loader

Number of consoles =  2
Breakpoint RST #   =  6
Banked BDOS file manager
Top of memory      =  FFFFH

Memory Segment Table:
XIOS    SPR  EA00H  1100H
BDOS    SPR  E200H  0800H
XDOS    SPR  C300H  1F00H
Memseg  Usr  0000H  C000H  Bank 07H
Memseg  Usr  0000H  C000H  Bank 06H
Memseg  Usr  0000H  C000H  Bank 05H
Memseg  Usr  0000H  C000H  Bank 04H
Memseg  Usr  0000H  C000H  Bank 03H
Memseg  Usr  0000H  C000H  Bank 01H
Memseg  Usr  0000H  C000H  Bank 01H
Memseg  Usr  0000H  B500H  Bank 00H

D-X Designs P112 MP/M 1.1 Xios (V2.1)

MP/M 1.1
0A>ds1202 /r

Setting system time from CMOS clock: 01/11/04 18:51:50


Note the automatic startup command (ds1202 /r) at the end. If you have another terminal connected to the second serial port, you should see the MP/M prompt appearing there as well:

MP/M 1.1

Loader BIOS

The MP/M Loader BIOS is also an adaptation of Hal Bower's enhanced BIOS for CP/M 2.2. The binary image is generated at address 1700h:

M80 =LDRBIOS.180

then combined with the MPMLDR.COM program using an utility like DDT:

1800 0100
1F00 0100      (note the NEXT address)
-V1F00         (MP/M's DDT makes things easier,
003C             Falconer's DDTZ is even better)

The process is explained in detail in the MP/M User's Manual.

Making a bootable floppy

MPMLDR.COM is a standalone program that runs at address 0100h, so it can be executed from either CP/M or MP/M. It can also be stored in the boot tracks of a disk, provided the boot code loads the program into the right address.

I have included a suitable floppy boot loader with the distribution. The boot code is assembled at address 8000h, which is where the P112 ROM loads it to. The resulting binary can be merged with MPMLDR.COM into an image suitable for use with an utility like PSYSGEN.COM from the CP/M 2.2 distribution.

The MKBOOT.SUB file can be used to automate the image generation (XSUB and DDTZ are also required; MKBOOT must be called from CP/M since XSUB is used). The SUBMIT file looks for the BOOTSEC.BIN boot loader and the MPMLDR.COM program in the current directory, runs a small assembly routine to compute the boot sector checksum, then saves the whole image into a file named BOOTTRK.BIN. This image can be stored into the system tracks of the floppy using PSYSGEN.

Last modified: 4-Feb-2007