PDA

View Full Version : Help With Understanding CP/M Disk Formats



tempest
March 27th, 2018, 09:20 AM
I've never really played around with CP/M, it was all but dead by the time I got my first PC. However I have a few systems that can run CP/M so I'd like to get some games running on them. For my Spectravideo SV-328 I have CP/M 2.2 on disk and I believe it's Single Sided/Double Density. How would one go about trying to run an Infocom CP/M game under this version of CP/M? I'm not sure how exactly the disks are formatted but I did find this document: http://www.samdal.com/svdiskformat.htm

Any help would be appreciated.

Chuck(G)
March 27th, 2018, 09:48 AM
Ever hear of 22Disk? ;)

If you can figure out a variation on how to store files on a disk in CP/M, chances are that someone was used it already.

tempest
March 27th, 2018, 10:10 AM
No, I've never heard of that before. So this is program for moving files from CP/M 2.2 disks to the PC and vice versa? Maybe I can use it to copy some Infocom files over to a formatted CP/M disk and see if it works.

GeoffB17
March 27th, 2018, 10:11 AM
I don't think that 22DISK will help here.

This prog works well for me with all the things I've done with it (and still do) but it still has certain limits.

Firstly, the formats available all assume the same number of sectors per track. I don't think you can set a track to have more, and different size, sectors.

Secondly, the formats are all based on x reserved tracks (for System, etc) followed by the rest of the disk for data. The first part of the data area is then reserved as x sectors (actually Allocation Blocks) for directory. The format described for this machine shows the dir area as being Track 20, with user data before and after the directory area.

Thirdly, the directory structure is not normal CP/M, although I'd guess that if the right space is reserved, what the actual system does with that area may not matter. 22DISK just reserves the space, I don't think it initialises the space.

That aside, if you formatted a disk, it may well be possible to write something onto it such that the disk could be used. With tools OTHER than 22DISK.

Aha - comments above based on Disk Basic format. The CP/M format is BETTER, but problem 1 still applies. Second problem may be OK. Third problem re directory may be a BIT of a problem. jgb

Geoff

durgadas311
March 27th, 2018, 10:13 AM
I've never really played around with CP/M, it was all but dead by the time I got my first PC. However I have a few systems that can run CP/M so I'd like to get some games running on them. For my Spectravideo SV-328 I have CP/M 2.2 on disk and I believe it's Single Sided/Double Density. How would one go about trying to run an Infocom CP/M game under this version of CP/M? I'm not sure how exactly the disks are formatted but I did find this document: http://www.samdal.com/svdiskformat.htm

Any help would be appreciated.

That svdiskformat link shows a very odd disk layout for a CP/M machine. CP/M is normally oriented around a directory at the beginning of the disk, and no allocation tables on disk. I'm not familiar with SpectraVideo, though, so am just guessing. I'm also not familiar with InfoCom, But if the infocom game is text based, at least you probably don't need to worry about hardware dependencies. I'm guessing your biggest hurdle is going to be getting the game onto something you can read on the SpectraVideo. What format disks are the InfoCom games on? Do you have a PC that read/write arbitrary 5" diskettes, or will you need to be able to read the InfoCom disks on the SV-328? If the SV-328 CP/M BIOS makes too many assumptions about disk layout, you may have difficulty reading a foreign diskette.

tempest
March 27th, 2018, 10:30 AM
Infocom games came in a variety of CP/M formats from Osborn to DEC Rainbow to even the Coleco ADAM. I'm not sure what format the SV-328 is closest to though.

I have a DOS/Win 98 machine with a 5.25" drive that I use for these things. I have a program that will write SV disk images to real disks, that's how I made the CP/M disk in the first place. It doesn't do individual files though, just disk images.

tempest
March 27th, 2018, 10:33 AM
Huh, it looks like 22Disk supports SV-328: http://torlus.com/floppy/forum/viewtopic.php?t=899

Spectravideo 318/328 - SSDD 48 tpi 5.25"

Chuck(G)
March 27th, 2018, 10:49 AM
Run an image using ImageDisk and send it to me. I'll tell you what gives.

There is a "non standard" 22Disk that we've sent to specialized customers. It deals with oddball addressing schemes and other niceties; however, the formats, are, of necessity hard-coded.

tempest
March 27th, 2018, 10:59 AM
So you want the SV-328 CP/M disk image?

GeoffB17
March 27th, 2018, 11:19 AM
Right,

Got at my copy of 22DISK, and YES, the definitions file contains a def for Spec SV-328.

Looks fairly normal, and seems OK, but makes no attempt to do anything special with Tr0 - prob assumes that NORMALLY the software will NOT need to access it.

So, should be OK after all. Just the Disk basic format which is wild!!

Yes, if you run 22DISK on your W-98 machine, you can select the Spec format, and copy DOS files from the PC HD to the floppy CP/M format, and vice-versa, and do a dir, and even a format (but this will not do the special Tr0 format). You can write to the data area, NOT to the system area.

Geoff

Chuck(G)
March 27th, 2018, 11:20 AM
I think so, but let's make sure we're on the same page.

I'm assuming that you have some source of Infocom games written for the Z80 and interfacing with CP/M and you'd like to put them on a SV-328 floppy to run on your SV-328.

My experience with Infocom games has been primarily with the IBM PC platform. The only game of that sort that I've run on a CP/M system was a version of Adventure/Colossal Cave, which IIRC, did not come from Infocom.

tempest
March 27th, 2018, 11:33 AM
Right. For example there are some here: http://www.z80.eu/adventures.html

IIRC all games that used the z3 interpreter came in CP/M format (all the regular non-fancy games that worked with 48K or less).

So if I have a CP/M disk in SV-328 format (and I do) I can use 22DISK to move the .COM file and the .DAT file (the two parts of an Infocom game) to the disk and it *should* run?

Chuck(G)
March 27th, 2018, 11:39 AM
Yes, but note that 22Disk does a "rename" on executables, to keep a PC from trying to execute Z80 code. So it swaps .COM to .CPM in file name extensions and vice-versa. So if you want to transfer executable CP/M .COM files to your SV-328, you should rename them to .CPM before the transfer.

The problem arises because MS-DOS can load any file that's named ".COM" and doesn't start with "MZ" into memory and try to execute it. Not a happy situation; hence the renaming.

GeoffB17
March 27th, 2018, 12:22 PM
If needed, I have a number of the Infocom games, for CP/M. *fall, HHGTTG, Leather Godess, all the Zork.

NB - the games may need to be configured for the screen codes for your system. I have SOME info on what needs to be done. My versions are set for Amstrad PCW which is Zenith/H19 I believe.

Geoff

GeoffB17
March 27th, 2018, 12:26 PM
Chuck

The rename you refer to is not obligatory. If you move files from CP/M to a DOS disk, then any .COM are changed to .CPM. If you move vice-versa, and .CPM are changed to .COM - however, there is no problem with any .COM which are moved as .COM no problem. So, if you put CP/M .COM on a DOS disk, there is no need to rename them. I've never bothered to do so.

Geoff

tempest
March 27th, 2018, 12:34 PM
If needed, I have a number of the Infocom games, for CP/M. *fall, HHGTTG, Leather Godess, all the Zork.

NB - the games may need to be configured for the screen codes for your system. I have SOME info on what needs to be done. My versions are set for Amstrad PCW which is Zenith/H19 I believe.

Geoff

Yeah I'm not sure what's going to need to be done to actually play these on the SV-328. I think it does 60 columns or so (not 80 though, that required a special card). I just thought it would be fun to do something with CP/M on the Spectravideo since it's so rare. I also have a weird obsession with putting Infocom games on every computer I own. :)

Chuck(G)
March 27th, 2018, 12:43 PM
Chuck

The rename you refer to is not obligatory. If you move files from CP/M to a DOS disk, then any .COM are changed to .CPM. If you move vice-versa, and .CPM are changed to .COM - however, there is no problem with any .COM which are moved as .COM no problem. So, if you put CP/M .COM on a DOS disk, there is no need to rename them. I've never bothered to do so.

Geoff

Whoa there. I can put ASCII text into a DOS .COM file and DOS will try to execute it if I call it out by name. Or are you trying to say something different?

There is no structure to a DOS .COM file--it's raw binary loaded into memory and entered at 100h. Pretty much the same as CP/M
.COM files.

If you're lucky, the program will simply exit with an illegal or misinterpreted instruction--or it will hang your system. For example, 8086 near return is C3, but in x80 code it's a jump.

durgadas311
March 27th, 2018, 12:57 PM
I think the point is you can put anything in a DOS "COM" file and as long as you don't tell DOS to execute it, you will be fine.

Chuck(G)
March 27th, 2018, 01:20 PM
Exactly--and you don't want to write DOS .COM executables to your CP/M disk and try to execute them. So the name-swapping scheme makes sense.

Originally, the name-swap was intended to be used with the 22Nice emulator--copy your CP/M executables over, create .COM emulator pre-loaders and just execute the things like any other DOS command. I still run some old CP/M utilities on DOS/Windows/Linux that way.

GeoffB17
March 27th, 2018, 01:41 PM
Er, yes...

I have a CP/M .COM file. I know full well that is what it is. I put that file onto a DOS machine for one purpose ONLY. To copy it to a CP/M machine, where the file will be quite OK as a .COM. I see no need at all for me to mess with renaming. Once the file is copied, it will be deleted. It certainly will NOT be executed, as said, who knows what disaster might befall ;)

No panic!

Geoff

GeoffB17
March 27th, 2018, 01:45 PM
I don't think the screen config has settings for columns/rows. I'll have to check that, if need be. The main settings I remember are the code for cursor pos, CLS, home, Rev Video (I think). The files for this are on the PCW (CP/M machine)

Geoff

Chuck(G)
March 27th, 2018, 05:09 PM
Er, yes...

I have a CP/M .COM file. I know full well that is what it is. I put that file onto a DOS machine for one purpose ONLY. To copy it to a CP/M machine, where the file will be quite OK as a .COM. I see no need at all for me to mess with renaming. Once the file is copied, it will be deleted. It certainly will NOT be executed, as said, who knows what disaster might befall ;)

No panic!

Geoff

My point was that if you copy a file with a .COM extension from your DOS machine, 22Disk will change the extension to .CPM. And vice-versa.