Floppy With Bad Sectors
Floppy With Bad Sectors
Does exist a way, using I/O ports, to force the reading of a bad sector? is it possible to tell the FDC not to check the CRC and to return what has been read? thank you.
Re: Floppy With Bad Sectors
Hi,
In practice, there's 2 problems with this. First, if there is error/s with one or more sectors you won't know which sector/s had the error/s. Second, the "read track" command reads sectors in the order they physically appear on the disk and not in the logical order; which means that if the floppy uses "interleaved sectors" (which some OSs support to improve performance) then you'll get "wrong ID" errors and have no way to determine if the error/s are expected (caused by interleaving) or a real errors (caused by failing to read the ID marks properly), and (if it was caused by interleaving) no easy way to correct the order afterwards.
I'm not sure that it's possible to work around these problems. For disk interleaving, you might be able to use the "read ID" command to determine the correct order of sectors (but this would be extremely sensitive to timing). You might also be able to read individual sectors (using the normal "read" command) and compare the data you received to the data read by the "read track" command to figure out which sectors were read properly; but this would be prone to both false positives and false negatives. For example, there's no guarantee that sectors will be read the same twice in a row (a sector read correctly by "read" may have been read incorrectly by "read track", or the reverse), and no guarantee that data contained by different sectors (whether read correctly or not) don't match by accident.
Finally; if you actually do manage to work around these problems, there's nothing you can really do to correct the CRC errors. For example, a minor difference in where the data begins on the track (or a minor difference in head alignment) can cause the floppy disk to read 512 bytes of "random" garbage; and you can't assume that the CRC error was caused by a small number of incorrect bits (or assume that most of the data is correct despite the CRC error). The only thing you can do is say "this sector is bad", but you could've done that without reading the bad data at all.
Cheers,
Brendan
In theory, for the old floppy controllers, you should be able to use the "read track" command to read an entire track without stopping due to a bad ID field or bad CRC (in these cases it sets error/status bits but reads the data anyway).bino78 wrote:Does exist a way, using I/O ports, to force the reading of a bad sector? is it possible to tell the FDC not to check the CRC and to return what has been read? thank you.
In practice, there's 2 problems with this. First, if there is error/s with one or more sectors you won't know which sector/s had the error/s. Second, the "read track" command reads sectors in the order they physically appear on the disk and not in the logical order; which means that if the floppy uses "interleaved sectors" (which some OSs support to improve performance) then you'll get "wrong ID" errors and have no way to determine if the error/s are expected (caused by interleaving) or a real errors (caused by failing to read the ID marks properly), and (if it was caused by interleaving) no easy way to correct the order afterwards.
I'm not sure that it's possible to work around these problems. For disk interleaving, you might be able to use the "read ID" command to determine the correct order of sectors (but this would be extremely sensitive to timing). You might also be able to read individual sectors (using the normal "read" command) and compare the data you received to the data read by the "read track" command to figure out which sectors were read properly; but this would be prone to both false positives and false negatives. For example, there's no guarantee that sectors will be read the same twice in a row (a sector read correctly by "read" may have been read incorrectly by "read track", or the reverse), and no guarantee that data contained by different sectors (whether read correctly or not) don't match by accident.
Finally; if you actually do manage to work around these problems, there's nothing you can really do to correct the CRC errors. For example, a minor difference in where the data begins on the track (or a minor difference in head alignment) can cause the floppy disk to read 512 bytes of "random" garbage; and you can't assume that the CRC error was caused by a small number of incorrect bits (or assume that most of the data is correct despite the CRC error). The only thing you can do is say "this sector is bad", but you could've done that without reading the bad data at all.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.