Re: [hatari-devel] Re: Hatari floppy drive detection with EmuTOS

[ Thread Index | Date Index | More Archives ]

Le 15/01/2014 18:43, Roger Burrows a écrit :
On 15 Jan 2014 at 17:51, Nicolas Pomarède wrote:

Le 15/01/2014 17:08, Roger Burrows a écrit :
On 15 Jan 2014 at 9:43, Nicolas Pomarède wrote:
But on real HW, do you mean that if you set the timeout to 9 sec, then
bit 5 gets to 0 after 3 sec ?

When I say "set the timeout to N seconds", I mean "wait N seconds for bit 5
go to 0".  As far as real hardware is concerned, the drives are correctly
detected as present or absent with the current timeout of 3 seconds.

Sorry for insisting, but too be very precise I have another wording/test :

On real HW, if you set timeout to 9 sec, disconnect drive A and wait for
bit 5 of ffffa01 to go to 0 :

   - does bit 5 go to 0 before those 9 seconds ? And if so after how many
seconds (approximatively) ?

   - does bit 5 always stays to 1, and the timeout expires after 9
seconds, indicating the fdc was not able to complete the restore command ?

I cannot answer your question concerning real hardware with a 9 second timeout,
because I have not tried it (I don't consider it relevant).  On real hardware,
the presence/absence of a drive is detected before the current 3-second timeout
expires.  In other words, bit 5 goes to zero before 3 seconds have elapsed
irrespective of whether a drive is connected.

For a non-connected drive, the restore time should be approximately 255 times
the step rate.  Since the step rate code is 0x03, that should be 6 msec on a
real 1772, so the total time for the restore to 'complete' should be
approximately 1.53 seconds.

I agree with these numbers, it's just that they don't take the spinup time into account (command 0x03 is restore with spinup) ; maybe spin up bit is already set in that case, but I don't see what would set it before..

If you need to know exactly how much time elapses before bit 5 goes to zero
when no drive is connected, let me know and I'll run a test.

Basically, if you set the timeout to 1 minute and disconnected both
drive on real HW, would it take 2x1 minutes for EmuTOS to consider the
drives are not available ?

No.  For each drive, EmuTOS would see that bit 5 went to zero in about 1.5
seconds (see above), would test the TR00 bit and deduce that the drive was not
available.  So the total floppy drive detection time should be about 3 seconds.
EmuTOS does NOT rely on timeouts to detect the absence of a floppy drive!
(Although if a timeout occurs, it will assume the drive isn't present).

approx 1.5 sec per drive to complete would match the time needed to do the spin up associated to the restore command (if the head is already near track 0) ; but what I don't understand yet is that the WD1772 doc says it needs to count 6 revolutions (index hole) from the floppy drive to determine when the spin up is good.

But my understanding about this is that if the drive is disconnected, you will never receive the index pulse, so the revolutions counter will stay at "0", spin up will never complete, and restore will never complete too, because it needs spin up to complete first.

Based on the tests I made on my STF, I had the feeling this was the behaviour I saw, but maybe my test had a bug, I need to check again as something doesn't match your measures.


Mail converted by MHonArc 2.6.19+