CPMDISK - found a way to extend to many formats and test

stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

CPMDISK - found a way to extend to many formats and test

Post by stefano »

The Telcon Zorba portable CP/M computer had a lot of disk options, I'm using it to check the formats we've already implemented and possibly find the extra ones which could be nice to have.

Well, I'm already disappointed, I can't understand how the IMD format could keep the 1..20 sector numbering working on the alternate disk sides.
The Interleave option is probably not mandatory, I may be wrong, but it looks like this system was able to read disks with or without interleaved sectors. The read error happens at sector #11:

Code: Select all

static disc_spec zorba_spec = {
    .name = "Zorba",
    .disk_mode = MFM250,
    .sectors_per_track = 10,
    .tracks = 40,
    .sides = 2,
    .sector_size = 512,
    .gap3_length = 0x2a,
    .filler_byte = 0xe5,
    .boottracks = 2,
    .directory_entries = 64,
    .extent_size = 2048,
    .byte_size_extents = 1,
    .first_sector_offset = 1,
    .alternate_sides = 1,
    .has_skew = 1,
    .skew_tab = { 0,5,1,6,2,7,3,8,4,9,10,15,11,16,12,17,13,18,14,19}
	//.skew_tab = { 0,5,1,6,2,7,3,8,4,9 }
};

Code: Select all

TD 1.5 5.25-96 LD MFM D-step, 2 sides ADV 6/04/2001 11:06:35
cpm1 from 360 to 1.2 
80 tracks, 800 sectors converted.
------------------------
IMD TD 1.5 5.25-96 LD MFM D-step, 2 sides ADV 6/04/2001 11:06:35
------------------------
 0/0 250 kbps DD  10x512
      1   6   2   7   3   8   4   9   5   10
      D   D   D   D   D   D   D   D   D   D
 0/1  11  16  12  17  13  18  14  19  15  20
 HD:  0   0   0   0   0   0   0   0   0   0
      D   D   D   D   D   D   D   D   D   D
 1/0  1   6   2   7   3   8   4   9   5   10
      D   D   D   D   D   D   DE5 D   D26 D
 1/1  11  16  12  17  13  18  14  19  15  20
 HD:  0   0   0   0   0   0   0   0   0   0
      D   D   D   D   D   D   D   D   D   D
 2/0  1   6   2   7   3   8   4   9   5   10
      D   D   D   D   D   D   D   D   D   D
 2/1  11  16  12  17  13  18  14  19  15  20
 (...)
As said not being able o generate Zorba native disk images is not a problem, because it will easily read other formats (X820, Kaypro, Osborne..).
I'm just curious on whether appmake is able to deal with it in "dsk", "d88" or "imd" mode.

disk_modes.png
EDIT: the mentioned KayComp II format refers to the KayPro II, there's an interesting story about the mess happening behind the scenes at the product launch :)
You do not have the required permissions to view the files attached to this post.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

In this way I could verify that the disk format for the Televideo TS-803 and TPC1 is the same of the TS-802.
I'm renaming it in appmake and I'm adding a generic "televideo" subtype.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

VT-180 disk mode pulled.
Having a good emulation level helps in creating accurate disk images, with transfer speed and skew settings closer to the real ones, raising the probability to get working suff on the real hardware.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

Osborne 1 formats improved by addind the single density format and the correct disk speed and interleave settings.
Now the disk images work correctly also in IMD mode.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

I finished the options avaliable on the Zorba and discovered the Ampro !
This one included compatibility tools to configure a custom floppy disk format (always mapped to e:), format some of them, etc.
I already pulled in a good number of new formats.

Among the others, the VT180 "Robin", the Actrix and some others were never emulated, but this cross check guarantees that the disk images are correct.
The existing cpmtools configurations, when available, lack key informations required to write physical disks but most of our files are precise enough.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

diskdefs in the cpmtools provides a lot of useful informations but most of those definitions were verified only as "logically valid", in example there's no difference in terms of file block allocation if we work on a double sided disk with 80 tracks per side or on a single sided disk with 160 tracks :)
Moreover, the dump or image conversion tools may decide to sort the sectors removing the original skew.
On the physical perspective, some image formats inckude hw attributes, such as the transfer rate used while dumping the disk and the encoding method (fm250, mfm300, etc).
Those values make a difference on the ability to actually read the virtual disks with mame.
The best way to identify the correct data rate is to copy it from a valid disk image td02imd and imdu can help.
My favourite way to find the "byte size addressing" value is to use an hex editor, spot some directory entry and check the block pointers. They can be single bytes incrementing one by one or words.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

Same technique, used multidsk on Ampro (on MAME) to tune and check the disk image configuration, with the support of z88dk/examples/cpm/dpb.c, and the Dunfield's TD02IMD and IMDU.
Final check on trs80gp running Montezuma CP/M. The graphics library won't work, it surely requires page swapping. Sound works.

montezuma-tic.png
EDIT:
trs80gp emulates the Grafyx Solutions boards (grafyx4 and grafyx4_3) !

zcc +cpm -create-app -subtype=montezuma -llib3d -lgrafyx4 -Dhires -DDETAILED clock.c
montezuma_grafyx.png
You do not have the required permissions to view the files attached to this post.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

I noticed that, especially in 8" disk formats a track0 with different sectors is not so rare.

I was thinking to extend appmake and force the IMD format to behave differently, extending the current structure in this way:

uint8_t trk0_sectors_per_track;
uint16_t trk0_sector_size;
uint8_t trk0_gap3_length;
uint8_t trk0_filler_byte;
uint8_t trk0_disk_mode
uint8_t trk0_has_skew;
uint16_t trk0_skew_track_start;
uint8_t trk0_skew_tab[32];


..and adding a wonderful "if" with a whole parallel path for track zero in case the "trk0_sectors_per_track" value was configured.
The problem is that this approach messes up the code.
Do you see a better way ?
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

The resulting code is not a wonder but still acceptable.
A couple of examples of those crazy formats:

Often the first sector is in a basic format, to allow boot.

The TRS80 puts the boot code in a single track and requires a lot of sectors to fit !

IMageDisk Utility 1.18 / Mar 07 2012
IMD TD 1.4 8" HD MFM S-step, 1 sides ADV
Assuming 1:1 for Binary output
0/0 500 kbps SD 26x128
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
D D D D D D D D D D D D D D D D D D D D D D D D D D
1/0 500 kbps DD 8x1024
1 2 3 4 5 6 7 8
D D DE5 D D DE5 D D
2/0 D DE5 D DE5 D D DE5 D
3/0 D D D D D D D D
4/0 D D D D D D D D
5/0 D D D D D D D D
(...)


IMageDisk Utility 1.18 / Mar 07 2012
IMD TD 1.5 5.25 LD MFM S-step, 1 sides ADV 7/10/1993 11:32:37
CP/M 3 (unbanked) for TRS Model 4
SSDD 512 byte sector, 1-8, 3:1
Assuming 1:1 for Binary output
0/0 250 kbps DD 18x256
1 7 13 2 8 14 3 9 15 4 10 16 5 11 17 6 12 18
D D D D D D D D D D D D D D D D D D00
1/0 250 kbps DD 8x512
1 7 5 3 2 8 6 4
D D D DE5 D D D DE5
2/0 D D D D D D D D
(...)
40 tracks(40/0), 330 sectors (72 Compressed)
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

Yet another interesting trick to forcefully run a CP/M executable in a TRS80 emulator in CP/M mode.
Most of the emulators allow direct load of CMD files, thus we can use z88dk_appmake twice.
In a first run we build the CP/M command file, then we add the TRS80 CMD header:

zcc +cpm -create-app dpb.c
z88dk-appmake.exe +trs80 --cmd -b A.COM -c "a" --org 256

model_ii_lifeboat.png


EDIT:

ATON CP/M is probably compatible with this disk format.
Take care of dealing properly with single side disks if you are running a double side OS version.

----

A version 1.4 of the Lifeboat CP/M existed for the TRS-80 Model I
By the way it was relocated to run on the standard memory map and can't run standard CP/M programs.
...not in my TODO list, definitely :)

A) Memory Addresses
The CP/M for TRS-80 runs at a higher address than standard CP/M.
This difference is due to the presence of the Level II BASIC ROM in low address memory. The PAGE addresses described in the manuals (ie those falling in the range 0 thru 0FFH) are in the same relative locations starting at 4200H.
You do not have the required permissions to view the files attached to this post.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

I noticed that all the special disk images I could test are perfectly readable also by replacing the special boot track with a regular one.
No format fingerprints or detection tricks seem to depend on it, so it is pointless to add complexity to appmake.
If it will be necessary, it is probably more useful to work on a tool capable of extracting a track from an IMD file and putting it into another one.

The Lifeboat format is ready ;)
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

Omikron CP/M on Model I.

Double checking the skew table, this time I first had to guess it since I wasn't able to kick in DPB.COM.
omikron_dpb.png
You do not have the required permissions to view the files attached to this post.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

+ Pickles & Trout CP/M.
So far we have can create disk images in 2 different CP/M formats for the TRS-80 Model II.
Pickles & Trout supported a Real Time Clock, but our current time library does not interface to it.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

+ FMG CP/M, the third format for the TRS80 Model II.

I couldn't find a way to read the CP/M Plus disks, I'm in trouble with both the Model II and Model 4 formats.
On Model II the error happens so quickly that it could be checking the disk content.

I'm too lazy to do it but we could add a nice extra option to appmake/cpmdisk: a dumb sysgen parameter extracting the boot tracks from a given disk image and copying them on the target one. Supposing to require a boot disk with the same container (e.g. IMD), it should be a feasible add.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

+ Memory Merchant CP/M disk format for the Model III.
I couldn't find the boot disk to run on trs80gp, I checked it on the AMPro emulator with configured with MULTIDSK.COM

In the same way I checked also the Morrow MicroDecision 2 and 3 formats
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

I'm now on Heath / Zenith disk formats (5" only).
The H17 SSSD one didn't come out easily, I hope to be luckier with Magnolia and Z100

EDIT: Magnolia is ready.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

+Zenith Z-100 and DEC Rainbow 100.
MAME is still buggy and the Rainbow emulation may require retries while loading the program. The system disk must stay in drive A to allow the z80 compatibility subsystem to be found.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

Sorry for keeping aside the TRS80 fixes, I'm close to a short holiday period and I preferred to keep on with the disk formats (this easily fits in my current small time slots).

I could successfully test the Apple II SoftCard SSSD format on the "microm8" emulator and the BBC Micro Z80 CPU (Acorn) SSSD format on BeebEm.
They both work on RAW disk images.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

There's a few of CP/M boxes without dedicated audio or video which now are in the cpmdisk options.
I mentioned already the Ampro, the Zorba and the VT180. We now have in the list also the pmc-101 Micromate, and the Altos 5 (and perhaps one or two systems I'm forgetting).
They are all mostly tested. Some of the machines are not emulated but their disk format is, as a "compatibility" option on other CP/M machines.

This is also the case of the Eagle II, checked on a hacked MESS version of the Ampro emulator (forcing in 96tpi disk drives, as expected originally).
On the Ealgle II we could add display specific code, but in my information it was never emulated.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

Moving one step further.
I found an interesting RSX program which emulates the BIOS 2 DPB structures and allows the DPB.C program to gather the disk informations from within a CPM 3 environment.


A z88dk built DPB.COM program needs to be merged with, bios2rsx.rsx, they both must be transferred on a CP/M 3 dev environment.
"GENCOM DPB BIOS2RSX" will do the magic.

Sadly the emulation is not accurate enough to permit DPB.COM to gather the XLT table (skew factor), but the source code is provided and it is probably feasible.
dpb.png
You do not have the required permissions to view the files attached to this post.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

Time to rest for a short holiday.
In the meantime I succesfully tried the same approach used already in Zorba and Ampro the Montezuma's tools.
The relevant one is the CP/M plus for the model 4, allowing clock.c run at full functionality, including interfacing to the system clock
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

+ LNW-80, checked on Montezuma CP/M using the INTERCHG.COM tool
As in other cases the boot tracks are not valid to load a CP/M system and should be formatted differently.

Code: Select all

IMageDisk Utility 1.18 / Mar 07 2012
IMD TD 1.5 5.25 LD MFM S-step, 1 sides 19/10/2000 3:34:07
LNW C/PM 80 ver 2.2
boot disk with extras
Version 3.0
Assuming 1:1 for Binary output

 0/0 250 kbps SD  10x256
      0   5   1   6   2   7   3   8   4   9
      D   D   D   D   D   D   D   D   D   D
 1/0 250 kbps DD  18x256
      1   12  5   16  9   2   13  6   17  10  3   14  7   18  11  4   15  8
      D   D   D   D   D   D   D   D   D   D   D   D   D   D   D   D   D   D
 2/0  D   D   D   D00 D   D   D   D   DE5 D   D   D   D   DE5 D   D   D   D
 3/0  1   2   3   4   5   6   7   8   9   10  11  12  13  14  15  16  17  18
      D   D00 DE5 D   D   D   D00 DE5 D00 D   D   D00 DE5 D   D   DE5 D00 DE5
 4/0  D   D   D   D   D   D   D   D   D   D   D   D   D   D   D   D   D   D
 5/0  D   DE5 D00 D   D   D   D   D00 D   D   D   D   D   D   DE5 D00 D   D
 6/0  D   D   D   DE5 D   D   D   D   DE5 D   D   D   D   DE5 D   D   D   D
 7/0  D   D   D   DE5 D   D   D   D   D   D   D   D   D   D   D   D   D   D
 8/0  D   D   D   D   D   D   D   D   D   D   D   D   D   D   D   D   D   D
 9/0  D   DE5 D   D   D   D   D   D   D   DE5 D   D   D   D   DE5 D   D   D
10/0  D   D   D   DE5 D   D   D   D   DE5 D   D   DE5 D   DE5 D   D   DE5 D
(...)

Usually the generated disk is still valid as a data disk, but for the sake of accuracy, we have a manual way to arrange it:

https://github.com/z88dk/z88dk/wiki/Pla ... age-tricks
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

+Holmes VID-80 CP/M upgrade for some TRS80 Model

+HP-125 (and HP-120)
http://www.hpmuseum.net/exhibit.php?swc=18
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: CPMDISK - found a way to extend to many formats and test

Post by stefano »

Again basing on the Montezuma CP/M I could understand how the CP/M disks were configured on the NEC PC8001.
I read somewhere that the PC8801 had the same format, but elsewhere that the PC8801 and FM77 CP/M disks were identical.
this probably clarifies:
http://haserin09.la.coocan.jp/Images/cpm_timeline.pdf

There were 2 main CP/M disk formats :)
Post Reply