[Coco] Challenge: identifying file type by sector of data
Darren A
mechacoco at gmail.com
Wed Jan 14 18:21:20 EST 2015
On Wed, Jan 14, 2015 at 3:33 PM, Robert Gault <robert.gault at att.net> wrote:
>
> If you read the Western Digital "Storage Management Products Handbook
> 1986" looking for the controllers for our Coco drives, such as the
> WD279X-02, you will find Command Summary tables.
> The Read Sector/Write Sector commands are a type II for which there is a
> bit-flag for Data Address Mark. ON deletes the mark. OFF adds/restores the
> mark.
>
> You just need a program which will read a sector and ignore any errors
> thrown by the controller. Once read, the sector can be written back to the
> disk, restoring the DAM.
>
> I just ran a test with my Colorzap program where I put some text in a
> sector and then deleted the DAM. I could not read the sector normally but
> even though no sector data was displayed, writing the sector back to the
> disk restored the DMA and the text in the sector became readable again.
Technically speaking, you are not deleting the Data Address Mark. There
are two KINDS of address marks used for a data field, 'Normal' and
'Deleted'. The deleted kind is still a DAM, it just has a different value.
It's intended purpose was probably for identifying bad sectors or sectors
that are not allocated to any file. In reaility, few (if any) operating
systems ever utilized them.
When you issue a 'Write Sector' command to the floppy controller, one of
the bits in the command code is used to select which type of DAM you want
to write. Disk Basic always writes the 'normal' kind.
When a sector is read, the Western Digital controllers don't really care
about the kind of DAM it has. It will try to read the data either way. Bit
5 of the Status register will be updated to reflect the kind of DAM that
was found (0=normal, 1=deleted). Disk Basic considers non-zero bits in the
Status register to be an error condition even though the data was read
successfully.
- Darren
More information about the Coco
mailing list