For those of you with experience on actual hardware disk drivers; I've been wrestling with aspects of this problem for the last week. From experience, can you tell me if:
1) I have an annoyingly touchy hard drive,
OR the following two statements are true?
2) On older hard disks (up to 1GB in size), there is a 10% chance that a write of more than (say) 128 sectors will fail randomly in the middle, so
3) It is important to always code your disk driver to be able to restart a failed write from the middle of a transfer, and retry several times?
Note: It's been many years, but as I recall this drive was taken out of a working windoze system.
Note2: I have not yet completely ruled out all possible timing issues in the driver.
ATA Hard Disk (actual hardware) write errors [solved]
ATA Hard Disk (actual hardware) write errors [solved]
Last edited by bewing on Mon May 12, 2008 8:27 pm, edited 1 time in total.
Re: ATA Hard Disk (actual hardware) write errors
1&3 errors are very rare on hard disk unless it is a very old disk with a lod of bad sectors.
with very very old hard disk (<100MB) my drivers also have problems to read the data,even after many retrys.
with very very old hard disk (<100MB) my drivers also have problems to read the data,even after many retrys.
It turns out that the answer (that is not in any spec or example code that I can find) is that, for some drives:
every ATA PIO write command, no matter how long or how short, needs to be followed by an ATA Hardware Cache Flush (0xE7) command. (Unless you can guarantee the disk will be idle for one second.)
If you do not do this, you can have sectors of written data vanish, or you can have "bad sectors" magically appearing on your disk.
I am entering this into the wiki, of course.
every ATA PIO write command, no matter how long or how short, needs to be followed by an ATA Hardware Cache Flush (0xE7) command. (Unless you can guarantee the disk will be idle for one second.)
If you do not do this, you can have sectors of written data vanish, or you can have "bad sectors" magically appearing on your disk.
I am entering this into the wiki, of course.