I have decided to try out some old CP/M software, but need something to run it on. I could either do this on my Commodore 128 or through emulation. Unfortunately the 1571 disk drive for my Commodore is currently out of action, so that leaves me with emulation. I was going to use vice to emulate a C128, but have always found it a pain to get CP/M files onto .D64/71 disk images. After looking around for the best emulator to run CP/M on, I came up with either YAZE-AG or z80pack. z80pack seems to be better supported, has more documentation and is being actively developed, so that's the one I have chosen for this article.
- First download the source (z80pack-x.y.tgz, currently z80pack-1.17.tgz) for z80 pack from here. The following installation instructions are taken from the z80pack site. More information can be found there, in particular, information on installing z80pack on non Linux/Unix systems.
- Unpack the source archive in your home directory:
- Change the directory it is extracted to, to make this article easier to explain. There is no need for you to do this.
- Compile the emulator:
- Compile the support programs:
This is leaves, on Linux, a few bash scripts in the
mpm, which automatically start the emulator by booting into CP/M 2.2, CP/M 3.0, MP/M, etc.
Creating disk images
We now needed to create some disk images; to do this I recommend Cpmtools which is a part of many Linux distros. If you don’t have this as part of your distro, the source can be downloaded from here. Cpmtools is a great collection of tools used to manipulate CP/M images and file systems in a variety of formats and works well with z80pack.
Create a 4Mb Hard Disk Image
It would be useful to create a 4Mb Hard Disk Image, as this may be needed if we want to use any bigger applications such as a C compiler. To create this we can use Cpmtools, but first we need to make sure that it has the correct disk definition by editing
/etc/cpmtools/diskdefs and adding the following lines:
CP/M has 16 ‘user areas’ which can be used to organize data on a disk. They are effectively like a crude directory system. User area 0 is the default and the only one we will work with in this article.
To create a blank 4Mb Hard Disk image called
Then to copy all the
.COM files from the current directory into the image in user area 0, run:
Create a Floppy Diskette Image
To create a floppy diskette image called,
Then to copy all the
.DOC files from the current directory into the image in user area 0: run:
We now have a 4mb disk image and a floppy disk image. We can connect them to the emulator by creating a script in the
~/z80pack/cpmsim/ directory called
work. First copy
work.dsk.cpm to the
~z80pack/cpmsim/disks/library/ directory. It is also worth copying them to the backups directory as well:
Now create a script in
work to start z80pack with our disk image files attached:
This attaches the two CP/M disks on drive A and B, our
work.dsk.cpm image on drive C, and our
main.hd4.cpm image on I:
./cpmsim -f4 tells the emulator to run at 4Mhz, which makes it a bit more realistic.
Starting the emulator
~/z80pack/cpmsim/ directory, run the script we created:
The CP/M operating system will now boot up and leave you at the
To leave the emulator type: