MP/M 1.1 XIOS
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:
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 LINK XIOS[NR,OS]
The system was generated as shown below (consult the MP/M manual for more details):
A>gensys 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 MPMSTAT ? n SCHED ? n SPOOL ? n CCP+ Ver. 2.2 A>
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:
A>mpmldr D-X Designs P112 Loader Bios (V2.1) MP/M 1.1 Loader =============== Number of consoles = 2 Breakpoint RST # = 6 Z80 CPU Banked BDOS file manager Top of memory = FFFFH Memory Segment Table: SYSTEM DAT FF00H 0100H CONSOLE DAT FD00H 0200H USERSYS STK FB00H 0200H XIOS SPR EA00H 1100H BDOS SPR E200H 0800H XDOS SPR C300H 1F00H BNKBDOS SPR B500H 0E00H ------------------------- 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 0A>
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 1A>
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 LINK LDRBIOS.BIN=LDRBIOS[NR,L1700]
then combined with the MPMLDR.COM program using an utility like DDT:
0A>DDT MPMLDR.COM [MP/M] DDT VERS 1.1 NEXT PC 1800 0100 -ILDRBIOS.BIN -R1600 NEXT PC 1F00 0100 (note the NEXT address) -V1F00 (MP/M's DDT makes things easier, 003C Falconer's DDTZ is even better) -IXMPMLDR.COM -W3C
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