| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Kernal save (again)
After calling JSR $FFD8 to save a file the motor keeps spinning and the file isn't really "finalised". Works fine with Jiffy DOS, but not using the regular Kernal.
When SAVE returns I immediately throw out the kernal again and take over the system. Is there a call I need to make to "shut it down" properly or wait for it to complete the operation? Feels like some kind of race condition to me.. |
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
$FFE7/65511 Close All Channels And Files
it shouldnt be necessary though, SAVE alone should work |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote:
$FFE7/65511 Close All Channels And Files
it shouldnt be necessary though, SAVE alone should work
Exactly. I have no open files or channels... I'll try it still.
I will also add a jmp * after the save and see if the drive settles eventually. If it doesn't I guess my staged kernel environment isn't fully operational. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
wiggling dd00 a bit too much perhaps? :) |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: wiggling dd00 a bit too much perhaps? :)
only once every now and then to #$3c. Should be fine I suppose. |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
You're not manipulating $DD00 in an IRQ handler while saving, are you? |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: You're not manipulating $DD00 in an IRQ handler while saving, are you?
No, but immediatly after save returns I take over and relaunch my IRQ handlers |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Prior to save I stop all IRQs (not just SEI but proper disabling all generators) Then swaps in the kernel and reinitialise io and vectors. Then I disable the timers the kernel setsup for cursor and keyscan. Then I call save. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
If I do not immediately take over the kernel and instead just busy waits for a while the drive motor will stop properly and the file properly "finalised" with a correct filesize and type. If I don't wait the file will be 0 blocks big and have prg* as type.
And since all IRQ sources are disabled on the C64-side and my busy wait loop just do nothing the only explanation is that the drive must do some stuff by itself after SAVE returns which I disrupts when I take over the kernel and starts manipulating dd00 again or something along those lines. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Narrowing down. :) Totally reproducible from basic.
10 REM STUPID DRIVE
SAVE "TEST",8:POKE 56576,63
This will keep the drive motor on indefinitely. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
So, follow up question. When is it safe to touch $dd00?! |
... 8 posts hidden. Click here to view all posts.... |
Previous - 1 | 2 - Next |