Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Kernal save (again)
2018-10-08 13:00
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..
2018-10-08 13:03
chatGPZ

Registered: Dec 2001
Posts: 11386
  $FFE7/65511      Close All Channels And Files


it shouldnt be necessary though, SAVE alone should work
2018-10-08 13:11
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.
2018-10-08 13:16
chatGPZ

Registered: Dec 2001
Posts: 11386
wiggling dd00 a bit too much perhaps? :)
2018-10-08 13:18
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.
2018-10-08 13:39
Krill

Registered: Apr 2002
Posts: 2980
You're not manipulating $DD00 in an IRQ handler while saving, are you?
2018-10-08 13:57
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
2018-10-08 13:59
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.
2018-10-08 14:08
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.
2018-10-08 14:50
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.
2018-10-08 14:51
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
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
morphfrog
Didi/Laxity
Guests online: 160
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.066 sec.