Emulating CP/M under Linux

I need to be able to run a very old piece of software -- the HI-TECH z80 C Compiler for CP/M. It has been released as freeware by HI-TECH. Alas, it only runs on CP/M.

After a lot of Googling, I found a page of utilities for UZIX. One of those utilities is a script to abstract away the emulation of a CP/M machine, thus allowing you to use the compiler as you would any other UNIX program. The problem with this script is that it depends on their own CP/M emulator, which unfortunately will not compile on a modern (x64) system.

My question: is there a usable CP/M emulator for Linux that could be used in a similar fashion? Specifically, I need to be able to somehow have it access files from the host system, a la DOSBox. I'm willing to rewrite a script (I don't have to re-use the UZIX one); I just need an emulator. Thanks for any help!


Solution 1:

I think z80pack would work well for you. I use it under 64-bit Linux and there are tools available to move files easily between the emulated and host file systems. I wrote a couple of articles a while ago that you may find useful:

Setting up z80pack to create an emulated CP/M sytem

Installing the HI-TECH Z80 C Compiler for CP/M

Solution 2:

I know this is an old question, but the one I use is this:

https://github.com/jhallen/cpm

It's big advantage over z80pack is that it can emulate the BDOS as well, with the Unix CWD mapped as CP/M drive A:. So you don't need to fiddle around with disk images. You can also wrap scripts around it, for running stuff like Hitech C from Unix. There's even a built-in debugger (which you break into with ^C, which is a little confusing).