[Coco] Rusty ole FD-501

Darren A mechacoco at gmail.com
Fri Jan 16 04:16:15 EST 2015


On Thu, Jan 15, 2015 at 9:22 PM, Chad H wrote:

>
> I'm beginning to wonder if it has something to do with the "media
> descriptor" information I've been seeing in the assembly codes.  It's the
> information written to every block of data on the disk in addition to the
> 256 bytes of sector data.  The reason I say this is because most of us use
> a modified DECB drive table in our HDBDOS, etc and I have no idea what kind
> of 'extra' information the CoCo DSKINI puts on the disks when formatting
> them.  Perhaps it's not writing the correct descriptors or something when
> writing to that drive number?  This would explain why the PC side
> formatting is restoring the expected descriptors.
>


Each sector on the disk has an ID field. One of the bytes in the ID field
holds a "side number". A normal double-sided disk will have ID fields
containing a side number of '0' on the front side and '1' on the back side.
When you use the trick in DECB to modify the drive selects table so that
drives 2 and 3 access the back sides of the disks in drives 0 and 1,
formatting either side of the disk writes ID fields with a side number of
'0'.

The floppy controller in a PC requires you to specify both the logical side
number and the physical head number when reading or writing a sector. The
logical side number must match the value contained in the ID field
otherwise the operation fails. To access the back side of a disk formatted
by DECB on a PC you must set the controller to read or write using physical
head 1, but having a logical side number of 0.  A double-sided OS-9 disk
will have ID fields where the logical side number is equal to the physical
head number.

Code running on a PC would need to know which type of disk you were working
with so it could set the logical side number accordingly. This isn't a
problem on the CoCo because the Western Digital controllers don't require
you to specify a logical side number for comparison. It is an optional
setting that neither DECB nor the OS-9 driver utilize.

- Darren


More information about the Coco mailing list