Wow this was without a doubt one of the more confusing things I’ve ever done.
So here is the problem. Â I want to delete some files from an IMD disk image, and then copy some new ones in. Â Easy right? .. maybe.
Ok first up the easiest tool I’ve found to manipulate CP/M disk images is cpmtools. Â Even better their pre-compiled binary is for Win32, so I’ll run it with Wine on OS X. Â which works fine. Â Although there is one slight problem, cpmtools doesn’t read the IMD disk format. Â So you will have to download imd118.zip from a backup of the late author’s computer.
Now using IMD you need to convert the OS disk into a ‘raw’ or ‘binary’ file. Â Naturally IMD is a MS-DOS program so firing up DOSBox, I ran:
IMDU CPM68K12.IMD CPM.RAW /B
And a few seconds later I had my raw file. Â Now the next thing was to manipulate the image in cpmtools. Â cpmtools has a database of disk drive types, and naturally there is no definition for the SAGE2. Â However thanks to a friend of mine (hi Lorenzo!) I took at look at 22disk, and found their demo version did in-fact have a definition for the SAGE:
BEGIN SAG2 Sage IV – DSDD 96 tpi 5.25″
SIDE1 0 1,2,3,4,5,6,7,8
SIDE2 1 1,2,3,4,5,6,7,8
BSH 4 BLM 15 EXM 0 DSM 315 DRM 63 AL0 080H AL1 0 OFS 2
Which is great, however it took a bit of experimenting to work out how to format this information for cpmtools. Â I compared a bunch of known formats, and then managed to work this out:
And now I can look at the image file!
$ wine cpmls -f sage2 CPM68K12.RAW
So I tidy up the image, and copy it back to the IMD program for compressing. Â And this was, without a doubt the most difficult to figure out, until after a bunch of searching, and Lorenzo once more again pointed me in the direction of bin2imd
BIN2IMD X.RAW X.IMD DM=2 N=80 SS=512 SM=1-8 /2
Unfortunately the interpreterÂ doesn’t work right. Â It could be the disk transfers fault, maybe the SIMH SAGE emulator, or even the 8080 emulator. Â But it worked this far.