Lately I've found a very nasty bugs in IMD 1.16
(at least with a secondary
FDC, tested on two different machines of different speed with different
FDC). Reading disks is mostly fine, but writing to a drive connected to a
secondary FDC doesn't work reliably. The problem is that the drive won't
step properly, i.e. sometimes it misses a step pulse which makes the
written disk unusable. The same problem occurs e.g. with the clean head
routine. I had a look on your source code and I think it's a timing
issue. I've inserted a small delay ('delay(55);') into the seek routine
(between line 998 and line 999 in version 1.16) and this solved all the
problem. I think that the seek routine is called too early after having
sent the previous command to the FDC although it shouldn't matter because
wrfdc officially waits for the FDC to be ready before sending a byte. But
apparently some (many? all?) FDCs appear to be in a ready state although
they are not yet ready to do a seek... really weird.
It's impossible to test every FDC (at least in a free project). This
explaination doesn't make sense because the seek routine has a 55ms settleing
delay at the end (which you can increase with the SD= option), and the clean-
head routine has a 100ms delay between seeks, which makes a total of 150ms
delay. There are no other intervening commands during "clean heads" - since
seek() waits for seek complete, 150ms should be plenty of time for the
controller to be ready for another command. This also does not explain why
reading a disk would work, so I suspect there is some other factor involved
here..
This is the first I've heard of this problem - if you have problems with
ImageDisk, the best way to get it fixed correctly might be to work with
me on it instead of posting "fixes" to public forums. But... thats what
happens when you release source code.
--
dave06a (at) Dave Dunfield
dunfield (dot) Firmware development services & tools:
www.dunfield.com
com Collector of vintage computing equipment:
http://www.classiccmp.org/dunfield/index.html