Emulating CP/M with MYZ80 and DOSBox
Introduction
MYZ80 is widely considered the best Z80 emulator for DOS. It emulates a complete virtual Z80-based system, allowing you to run many flavors of CP/M. Here we will look at how to install DOSBox on a Linux system, and then install and configure MYZ80 in DOSBox.
DOSBox
We'll be installing a fork of DOSBox called DOSBox Staging. DOSBox Staging offers a number of enhancements to the mainline DOSBox, including a built-in robust Hayes modem emulator that eliminates the need for tty0tty / tcpser on the host.
Installation
On Ubuntu 16.04 and greater, DOSBox Staging is available as a snap package:
For all Debian-based distros, or if you prefer not to use snap, DOSBox Staging can be installed via apt-get:
$> sudo apt-get update
$> sudo apt install dosbox-staging
For other distros, such as Gentoo, Arch or Fedora, or to build DOSBox Staging yourself, see here for installation instructions.
Configuration
Once DOSBox Staging is installed, create a directory that will become DOSBox's C:> drive:
Now edit DOSBox's configuration file. If you installed the snap package do this:
Otherwise:
In the [serial] section, change serial1 = nullmodem telnet to serial1 = modem telnet:1 listenport:2323.
Then move to the bottom of the configuration file, and in the [autoexec] section add this line:
Exit your configuration session, and you're good to go.
Usage
That's it. Now, just fire up DOSBox and load up your favorite comm program (QModem Pro or PC Plus will do). Assuming your comm software is configured for COM1 you should see an intialization string and a response from the modem. DOSBox's virtual modem can "dial" internet addresses directly, such as:
ATDTvert.synchro.net:23
If your comm software doesn't support alphanumeric phone numbers, DOSBox Staging supports a phonebook, as follows: in the [serial] section of DOSBox Staging's config file (see above) add phonebookfile = phonebook.txt. Then create the file phonebook.txt and fill it with entries such as the following. Then you can simply dial the number as usual.
1234567 vert.synchro.net:23
DOSBox mainline
If DOSBox Staging is not available for your system, you can install the mainline version of DOSBox in whatever way is appropriate for your distro. E.g., for Debian-based distros:
You will need to install and configure tty0tty / tcpser by following this tutorial.
Edit DOSBox's configuration file, find the [serial] section and change serial1=dummy to serial1=directserial realport:/dev/tnt0. Make other edits as above, and you're all set.
MYZ80
Finally we'll install MYZ80 inside DOSBox. Shut down DOSBox, then do the following:
$> cd ~/dosbox/c/myz80
$> wget classiccmp.org/cpmarchives/cpm/Software/Humongous/Emulatrs/MyZ80/myz80124\ \(Jan\ 7\).zip
$> unzip myz80124\ \(Jan\ 7\).zip
$> rm myz80124\ \(Jan\ 7\).zip
$> cp a.dsk a.bkp
Finalizing
And now to test everything. First launch DOSBox.
You should see a DOSBox window open and in a second or so, land at a Z:\> prompt. To launch MYZ80, change to C:\MYZ80 and run MYZ80:
You will have to progress through several screensful of info, and then you will find yourself at CP/M's A0> prompt.
----------
The MYZ80GO.COM program is a simple program which displays
HELLO.TXT to you. Unless you want to see HELLO.TXT every
time you start up MYZ80 you should erase MYZ80GO.COM (with
the CP/M command "ERA MYZ80GO.COM"). But because the system
will still attempt to run MYZ80GO.COM at every start you can
rename another program to MYZ80GO.COM and have it run
instead. At any time you can use the command "TYPE
HELLO.TXT" to see this document again.
One final thing... there are two online menus called up by
pressing the control+break keys and the control+shift+break
keys. Try them now!
Enjoy MYZ80!
- Simeon -
[Press a key to return to CP/M]
A0>
Congratulations! You're good to go! To exit MYZ80 back to DOS, type exit. There's a brief tutorial on using CP/M here.