3.2 KiB
Program by Roger Ivie. Exchange is a utility that allows CP/M disk images to be manipulated under Unix. It supports disk images in either the standard 8" SSSD format or the P112 3.5" format. Disk images can be examined and files imported and exported from them. The source is a slightly hacked over copy of CP/M-68K BDOS and CCP which has been worked over to allow compilation using GCC.
/README
Greetings!
This is a utility that allows CP/M disk images to be manipulated under Unix. It supports disk images in either the standard 8" SSSD format or the P112 3.5" format. Disk images can be examined and files imported and exported from them.
The source is a slightly hacked over copy of CP/M-68K which has been worked over to allow compilation using GCC, to wit:
- A handful of typecasts have been dropped in.
- An assumption that an int is 16 bits has been fixed.
- An assumption that chars are signed has been fixed.
- The file diverge.h renames all of the globals to ensure they
don't collide with operating system globals.
- I changed the way the BDOS communicates with the BIOS; see
biosdef.h
- There are probably a couple of other minor changes I made that
I've forgotten (perhaps renaming a routine or two before I
decided to make diverge.h).
- A BIOS that allows the program to be run under Unix.
I've also added a couple of built-in commands:
- EXIT causes CP/M-68K to exit, returning to the host operating
system.
- IMPORT copies a file from the current directory of the host
operating system into the disk image.
- EXPORT copies a file from the disk image into the current
directory of the host operating system.
IMPORT and EXPORT do not accept wildcards. This is just a quickie hack that turned out to be useful, not a snazzy disk image manipulation program.
To build the program, execute make. This results in an executable called exchange. The command-line syntax is:
exchange [-p112] file.img
-p112 This option tells the file to use the P112 3.5" disk format
for the image. By default, the the standard 8" SSSD format is
used.
file.img is the name of the disk image that should be used.
In this example, I copy the file BDOS.LST from an 8" SSSD image containing CP/M 1.4 sources (obtained from http://cpm.z80.de/) to user 1 of the P112 boot disk image (obtained from http://members.iinet.net.au/~daveb/p112/p112.html):
mac> uname -a Linux mac.no.domain 2.4.22-2f #1 Sun Nov 9 16:49:49 EST 2003 ppc ... mac> ls bdosPLM.img bootdisk.img exchange mac> ./exchange bdosPLM.img
A>dir A: BDOSI SRC : BDOS PLM : BDOS OBJ : BDOS LST A>export BDOS.LST export BDOS .LST -> BDOS.LST A>exit mac> ls BDOS.LST bdosPLM.img bootdisk.img exchange mac> ./exchange -p112 bootdisk.img
A>user 1
1A>dir A: RECEIVE PAS : UUENCODE PAS : UUDECODE PAS : USER MAC : ROM UUE A: ROM PAS : ROM COM 1A>import bdos.lst import BDOS.LST -> BDOS .LST 1A>dir A: RECEIVE PAS : UUENCODE PAS : UUDECODE PAS : USER MAC : ROM UUE A: ROM PAS : ROM COM : BDOS LST 1A>exit mac>
Enjoy!
Roger Ivie anachronda@hotmail.com