Close

CP/M 3 up and running on the Z80-MBC2!

A project log for Z80-MBC2: 4ICs homemade Z80 computer

8MHz Z80, 128kB banked RAM, RTC, Disk on SD, Basic and Forth interpreters, CP/M 2.2 and 3, cross Assembler and C (SDCC) toolchains

Just4FunJust4Fun 10/11/2018 at 06:580 Comments

With the latest IOS revision and the corresponding new SD image (see the Files section) there is one more option: the CP/M 3.0!

With CP/M 3.0 it is possible use the 128KB banked RAM to have a wider user area (TPA) for programs and a more "evoluted" OS.


TWO VERSIONS

Just as example of how it is easy with CP/M 3.0 manage multiple configurations, I've done also a "non-banked" 64KB version. The switch from one version to the other can be done simply running a batch from the console itself.

I've prepared two simple batch files to do that. From drive A: the command:

submit sys64

will set the 64KB "non-banked" version and then reboot the system.

To activate again the 128KB "banked" version give the command (from drive A:):

submit sys128

NEW DISKDEFS FILE

To use cpmtools or cpmtoolsGUI with the virtual disks of the CP/M 3.0 environment, you must update the DISKDEFS definition file (from the SD in the folder <SD>/cpmtools/) and use the "z80mbc2-cpm3" entry for all the 16 disks:

Please note that for the CP/M 3.0 environment all the 16 virtual disks have the same structure and for this there is only one entry for all the CP/M 3.0 virtual disks.


AUTOEXEC

The AUTOEXEC switch for CP/M 3.0 works in a different way from the CP/M 2.2 and QP/M 2.71 implementations.

Now there is a custom utility (AUTOEXEC) that checks the IOS flag and sets the exit code accordingly (using the BDOS function 108). This allow to use the CP/M 3.0 batch conditional execution (see the CP/M 3 Programmer Guide par. 1.6.3) to run any wanted command or program based on the status of the IOS AUTOEXEC flag.

I've prepared an example using an other CP/M 3.0 feature, the "PROFILE.SUB" batch that is automatically executed at cold boot (if it exists). To activate it (in the drive A:) rename the file PROFILE.SU as PROFILE.SUB with the command:

ren profile.sub=profile.su

Now you can see how it works setting the AUTOEXEC flag on or off with the IOS "Select boot mode or system parameters" menu.

Discussions