Project

General

Profile

Actions

Bug #74

closed

Mounted disks don't always load

Added by Farb over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
High
Assignee:
-
Start date:
08/20/2018
Due date:
% Done:

0%

Estimated time:

Description

I have been seeing some strange disk loading behavior for the past few builds. Intermittently, when I mount a disk and cold reset the computer, it behaves like no disk is present and goes to the memo pad/self test. I haven't been able to consistently reproduce it but it seems like it might be related to some combination of mounting a disk and switching between XL/XE and 400/800. I have to try changing mounted disks and changing OSs a few times before it starts working again.

Actions #1

Updated by foft over 5 years ago

  • Priority changed from Normal to High

Probably about time I fix this, might be impacting some atx loading too.

Actions #2

Updated by foft over 5 years ago

Setting up the logic analyser to check the cause of the first few fails on the scanalyzer...

Actions #3

Updated by foft over 5 years ago

Hmmm, gets a failed checksum on the first sector read and switches to high speed sio. Then takes a while to resync.

Now need to see why I get a bad checksum (tomorrow).

Actions #4

Updated by foft over 5 years ago

So 3 problems...
i) Sometimes bad checksum, must be a sync issue with pokey clock I guess.
ii) Flip flopping between fast and slow too quickly to make sense.
iii) Seems to be very slow to ready 16 bytes from sd card (atr header), Atari send 3 command packets during this?! Need to work out what is going on here, this makes no sense.

Actions #5

Updated by foft over 5 years ago

The time spent on iii is in pf_open, the fat file system open. I guess this must do some work.

Perhaps if I ack first then the Atari will give me more time to handle this in piece... This will mean with the current approach that code that accesses drives in turn is slow, though is that common in practice? Probably not.

Actions #6

Updated by foft over 5 years ago

I guess a disk revolution at 288rpm is 200ms, so it must be ok timing wise to do the ack first.

Actions #7

Updated by foft over 5 years ago

Added more structure to the command handling (common ack/nak etc) and looking much better. More to do though...

Actions #8

Updated by foft over 5 years ago

Farb, are you still running into this with the latest builds?

Actions #9

Updated by Farb over 5 years ago

It doesn't seem to be happening as much although I did run into some weirdness a couple of times that might be related so I'll keep an eye on it.

Actions #10

Updated by foft over 5 years ago

Ok good. That’s as I hoped. I still need to make switching from slow to fast sio and back more reliable, I just fixed something that made it enter that state too often.

Actions #11

Updated by foft over 5 years ago

I'd added a 2ms delay temporarily to stop some fast/slow flip flopping. That actually breaks USB keyboard when in that state. Decreased it to 100us for now, though really I need to get to the bottom of what is going on.

I have a cartridge (yes, not a disk!) that puts it into this state now, so have something easy to debug...

Actions #12

Updated by foft over 5 years ago

Implemented using sio clock out as the zpu clock input. Should mean it can listen to whatever speed. Though of course there is still the question of what speed to reply at. Of course I do know what the pokey divisor is but it feels like cheating to use it:-)

Actions #13

Updated by foft over 5 years ago

On second thoughts, why guess when I know. Pokey is already outputting the serial input anyway (even in input mode, since its oe/in/out which is then connected to the pin). Then I can remove all the divisor guessing logic and code.

Actions #14

Updated by foft over 5 years ago

Except I need to send start bit from zpu to start that clock. Probably a fairly simple state machine change, but getting too late now!

Actions #15

Updated by foft over 5 years ago

In the end I chose to use the SIO clock for receiving command packets. I also count the rate. Then I reply using the same rate, creating my own clock.

I also fixed the divisor selection, it was not using the valid from the menu!

Will do another day or so of testing, but think this is now good...

Actions #16

Updated by foft over 5 years ago

  • Status changed from New to Closed

Closing as I think this is fixed in v29. Reopen if problems still seen!

Actions

Also available in: Atom PDF