flashjazzcat Posted August 17, 2014 Share Posted August 17, 2014 (edited) Can somebody run this binary through debugger emulation under SpartaDOS X and help me figure out why the hell this thing is failing to load? Am I right in thinking you've set up a stage 2 VBL at $3063? If so, first thing it does is jump right into the banking window, and this can occur when SDX has swapped the DOS bank in during a CIO or other DOS call: DOS currently has the DOS bank switched in here (the environment table is sitting at $4000). Solution: keep all ISR code outside of the banking window. Edited August 17, 2014 by flashjazzcat 1 Quote Link to comment Share on other sites More sharing options...
tschak909 Posted August 17, 2014 Author Share Posted August 17, 2014 No. I haven't set up any VBI, yet. I've been thinking how best to do it, but haven't implemented anything yet. That's _very_ strange -Thom Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted August 17, 2014 Share Posted August 17, 2014 (edited) Something is calling SETVBV, and it ain't DOS: Edited August 17, 2014 by flashjazzcat Quote Link to comment Share on other sites More sharing options...
tschak909 Posted August 17, 2014 Author Share Posted August 17, 2014 What the fuck? It's not me. Gosh I love it when standard libs do helpful things that aren't....helpful. If it's the serial library, that fucking tears it, and I'll just jettison that damned thing. Well, that gives a start.. I'll see what I can dig up... Thanks.. *scratch-head* -Thom Quote Link to comment Share on other sites More sharing options...
tschak909 Posted August 17, 2014 Author Share Posted August 17, 2014 Ok, pretty damned obvious that I am doing something heinous, and that the code is just going off into the weeds... I'll keep developing on SD3.2 for now, and keep hacking at it until I can get SDX to work too... what the hell... -Thom Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted August 17, 2014 Share Posted August 17, 2014 The offending code is in IRQ.S in the Atari library: .segment "INIT" initirq: lda VVBLKD ldx VVBLKD+1 sta IRQInd+1 stx IRQInd+2 lda #7 ldy #<IRQStub ldx #>IRQStub jmp SETVBV 1 Quote Link to comment Share on other sites More sharing options...
tschak909 Posted August 17, 2014 Author Share Posted August 17, 2014 Yup, I saw that, am trying to dig deeper. Maybe irq stub is being clobbered. -Thom Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted August 17, 2014 Share Posted August 17, 2014 (edited) The problem is that IRQStub JSRs to something that isn't there when SDX banks DOS in. Trying to figure out what the subroutine at $622F actually does... EDIT: It calls "callirq", which allows functions to be registered as interrupt service routines (CALLIRQ.S). I think you can bin it. Edited August 17, 2014 by flashjazzcat Quote Link to comment Share on other sites More sharing options...
tschak909 Posted August 17, 2014 Author Share Posted August 17, 2014 The code itself loads into LOWCODE, which, only definition I can find is in the linker config: FEATURES { STARTADDRESS: default = $2000; } SYMBOLS { __EXEHDR__: type = import; __SYSTEM_CHECK__: type = import; # force inclusion of "system check" load chunk __AUTOSTART__: type = import; # force inclusion of autostart "trailer" __STACKSIZE__: type = weak, value = $0800; # 2k stack __STARTADDRESS__: type = export, value = %S; __RESERVED_MEMORY__: type = weak, value = $0000; } MEMORY { ZP: file = "", define = yes, start = $0082, size = $007E; # file header, just $FFFF HEADER: file = %O, start = $0000, size = $0002; # "system check" load chunk SYSCHKHDR: file = %O, start = $0000, size = $0004; SYSCHKCHNK: file = %O, start = $2E00, size = $0300; SYSCHKTRL: file = %O, start = $0000, size = $0006; # "main program" load chunk MAINHDR: file = %O, start = $0000, size = $0004; RAM: file = %O, define = yes, start = %S, size = $BC20 - __STACKSIZE__ - __RESERVED_MEMORY__ - %S; TRAILER: file = %O, start = $0000, size = $0006; } SEGMENTS { EXEHDR: load = HEADER, type = ro; SYSCHKHDR: load = SYSCHKHDR, type = ro, optional = yes; SYSCHK: load = SYSCHKCHNK, type = rw, define = yes, optional = yes; SYSCHKTRL: load = SYSCHKTRL, type = ro, optional = yes; MAINHDR: load = MAINHDR, type = ro; STARTUP: load = RAM, type = ro, define = yes; LOWCODE: load = RAM, type = ro, define = yes, optional = yes; INIT: load = RAM, type = ro, optional = yes; CODE: load = RAM, type = ro, define = yes; RODATA: load = RAM, type = ro; DATA: load = RAM, type = rw; BSS: load = RAM, type = bss, define = yes; ZEROPAGE: load = ZP, type = zp; EXTZP: load = ZP, type = zp, optional = yes; AUTOSTRT: load = TRAILER, type = ro; } FEATURES { CONDES: type = constructor, label = __CONSTRUCTOR_TABLE__, count = __CONSTRUCTOR_COUNT__, segment = INIT; CONDES: type = destructor, label = __DESTRUCTOR_TABLE__, count = __DESTRUCTOR_COUNT__, segment = RODATA; CONDES: type = interruptor, label = __INTERRUPTOR_TABLE__, count = __INTERRUPTOR_COUNT__, segment = RODATA, import = __CALLIRQ__; } This is from the bog standard atari.cfg. Similar results with the atarixl config which banks certain things under OS RAM. Am trying to figure out how it determines the final address for a given segment... -Thom Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted August 17, 2014 Share Posted August 17, 2014 Seems to me a rather esoteric feature for it to be a mandatory part of the runtime library. I think it needs tearing out of the library for general purpose usage. Interrupt handlers should never be allowed to wander into the banking window. Recipe for disaster when DOS is present. Quote Link to comment Share on other sites More sharing options...
tschak909 Posted August 17, 2014 Author Share Posted August 17, 2014 For now, will _try_ to see what gets loaded into LOWCODE, to see if i can rip out the segment, if I need to, I'll just rip out irq.s from the standard library. I see why it's there, it provides a very convenient way to bolt on IRQ calls to functions..the irony here is that they need to be assembler due to the stack saving needed... grrr -Thom Quote Link to comment Share on other sites More sharing options...
tschak909 Posted August 17, 2014 Author Share Posted August 17, 2014 Well, would you look at that. Removed the LOWCODE and interruptor features from the linker config, and voila! the BBS runs under SDX Fantastic. Thanks for helping, Jon. That was a weird one. -Thom 2 Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted August 17, 2014 Share Posted August 17, 2014 Excellent - well done. I love looking into odd little problems like these... when they're not in my own code. Quote Link to comment Share on other sites More sharing options...
Shawn Jefferson Posted August 17, 2014 Share Posted August 17, 2014 With that lowcode problem, did you output a map file from the linker? You are using the stock Atari linker config? Lowcode should actually be in low memory (below $4000), but perhaps you just have too much in that segment. That will have to be mentioned to the Atari library maintainers if so... The interrupt routines were added to the libray (I believe anyway), to make it "easy" to write interrupt routines, and like anything in cc65 are geared towards the ability to create programs that are cross-platform (which frankly I find a bit annoying when it involves things that are linked by default.) Quote Link to comment Share on other sites More sharing options...
Android8675 Posted August 17, 2014 Share Posted August 17, 2014 heh, running latest build at telnet://shodan.synchro.net:9000 Quote Link to comment Share on other sites More sharing options...
tschak909 Posted August 17, 2014 Author Share Posted August 17, 2014 A pic of the "Atari" running AtariBBS. Now running under SDX. http://i.imgur.com/PohkkfB.jpg <-- Bigger Pic. 2 Quote Link to comment Share on other sites More sharing options...
tschak909 Posted August 17, 2014 Author Share Posted August 17, 2014 heh, running latest build at telnet://shodan.synchro.net:9000 Works great .. it _should_ work with a real 850 and a modem now too... ...should. I think. don't quote me. -Thom Quote Link to comment Share on other sites More sharing options...
tschak909 Posted August 17, 2014 Author Share Posted August 17, 2014 @Shawn: I also ripped out the idiotic SYSTEM CHECK segment. That thing is a waste of space. -Thom Quote Link to comment Share on other sites More sharing options...
tschak909 Posted August 17, 2014 Author Share Posted August 17, 2014 Ok, now that the two major issues that were plaguing me have been subverted, I'm dealing with trying to figure out a module structure. Now to see if I can pass around function pointers in cc65... -Thom Actually, going to make a slight detour, and see if I can get rid of all the messages in the system, and replace them with reading them from disk, wanna cut down on the stupid RAM usage _and_ make it localizable as a side effect. PROMPTED... Quote Link to comment Share on other sites More sharing options...
Android8675 Posted August 19, 2014 Share Posted August 19, 2014 crud, I was running the board on my 800, I did a git pull and rebuild and now it won't load at all. No idea what's going on. Maybe you're pushing some untested changes. I gotta learn to use git to branch working versions or something. Quote Link to comment Share on other sites More sharing options...
tschak909 Posted August 19, 2014 Author Share Posted August 19, 2014 Um. It works..for...me... Are you running under SDX? I haven't tested under SD3.2 since i pulled out the IRQ handler. Is your 800 running an Incognito? What's happening? -Thom Quote Link to comment Share on other sites More sharing options...
tschak909 Posted August 19, 2014 Author Share Posted August 19, 2014 I'm implementing definable input styles for prompts, tonight. I have it about 99% done, and now am adding some last bits... -Thom Quote Link to comment Share on other sites More sharing options...
Android8675 Posted August 19, 2014 Share Posted August 19, 2014 (edited) yeah, tried it with both 3.2g and sdx... however in sdx maybe I forgot to load the rs232... humm.... If I load Altirra with sdx 4.46 I get an error 179 Memory Conflict error when I try to start bbs.ata. Also tried to load with X command, same error. Edit, I'll just wait for whatever changes and try again, too early to try and debug these errors. Edited August 19, 2014 by Android8675 Quote Link to comment Share on other sites More sharing options...
tschak909 Posted August 19, 2014 Author Share Posted August 19, 2014 If you're running in SDX, and have an U1MB/Incognito, I use the following CONFIG.SYS (I am running 4.46 as well), and I have the system configured in 1088K RAMBO mode. USE BANKED DEVICE SPARTA DEVICE SIO DEVICE ULTIME -Thom This may be, because I've lowered memlo quite a bit... Can you modify bbs/src/atari-bbs.cfg, and change STARTADDRESS to $2400 ? If that works, try cranking it down until it stops. Also, yes, on a REAL 800, make sure you have your interface ready, and that RS232 is loaded. Quote Link to comment Share on other sites More sharing options...
Android8675 Posted August 19, 2014 Share Posted August 19, 2014 (edited) If you're running in SDX, and have an U1MB/Incognito, I use the following CONFIG.SYS (I am running 4.46 as well), and I have the system configured in 1088K RAMBO mode. USE BANKED DEVICE SPARTA DEVICE SIO DEVICE ULTIME This may be, because I've lowered memlo quite a bit... Can you modify bbs/src/atari-bbs.cfg, and change STARTADDRESS to $2400 ? If that works, try cranking it down until it stops. Also, yes, on a REAL 800, make sure you have your interface ready, and that RS232 is loaded. Got it running after changing startaddress, but failing to find interface under sdx, I may not be loading the right rs232 interface, gimmie a moment... I loaded the atari850.hnd driver from IceT and it's alive again. APE though, it transmits in bursts, but if you wanna connect to an 800 running incog, go for it. telnet://shodan.synchro.net:9000 (you can throttle Syncterm to 9600 baud and it smooths out again (Press alt-down arrow to change terminal speed) edit: When it's trying to disconnect APE doesn't respond to ATH0, and the docs for APE seem to be offline at the moment. Will tinker around with it. Edited August 19, 2014 by Android8675 3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.