I did some more testing and confirmed that there is indeed a problem with the HFDC DSR. Deleting a file that is fractured will almost always free one or more incorrect sectors. Subsequent writes to these freed sectors will result in corruption, usually by overwriting sectors allocated to other files.
According to the letter from Geoff Trott to Beery many years ago:
"Item 0545699 94/01/16 19:56
To: BW.MILLER Beery W. Miller
For those that do have HFDCCs and would like a copy of the new EPROM (version 13), if they can get a blank EPROM (27C128 or 27C256) to me at the next meeting or by mail I will be able to program it for them. I will be sending this to Beery Miller for him to distribute for others and the same conditions will hold for people overseas, except I will expe ct something to cover the cost of the postage."
Does anyone have a copy of this H13 EPROM from 1994?
I have identified the problem routine and came up with a fix that requires four additional bytes (two instructions). Alas, there is no space in the EPROM where I can inject a branch, execute the code, and return. I'm thinking Geoff identified a simpler way to fix this?
For the record, the DSR problem shows up when a fractured file is deleted. During the step that frees sectors from the bitmap, the counter that keeps track of the most recent sector (within the cluster) is calculated incorrectly. The value must first be stored in a temporary register then copied for the next iteration. This problem is particularly nasty because every removed cluster compounds the corruption.
Edit: To clarify, this DSR problem only affects floppy drives and the DSK1 emulate file. The Geneve is unaffected as its master DSR uses a different routine.
Edited by InsaneMultitasker, Fri May 18, 2018 4:24 PM.