From: Shawn Jefferson (sjefferson_at_sd62.bc.ca)
Date: 2002-09-25 01:13:20
>>> Christian Groessler <cpg_at_aladdin.de> 09/20/02 04:22PM >>>
>So with some linker and segments fiddling, one should be able to make
>RAM2 a separate chunk in the file. The AUTOSTRT chunk should be last
>(unless you know what you do), because I think it's address will be
>called immediately after being loaded, before the remaining chunks get
>loaded.
Ok, I think I succeeded in setting this up with these files:
atari.cfg:
MEMORY {
ZP: start = $82, size = $7E, type = rw;
HEADER: start = $0000, size = $6, file = %O;
RAM1: start = $2000, size = $2000, file = %O;
BANK: start = $4000, size = $3FFF, type = ro; # just to show the memory layout, not used
SECHDR: start = $8000, size = $4, file = %O;
RAM2: start = $8004, size = $3C1F, file = %O;
}
SEGMENTS {
EXEHDR: load = HEADER, type = wprot;
CODE: load = RAM1, type = wprot, define = yes;
BSS: load = RAM1, type = bss, define = yes;
CHKHDR: load = SECHDR, type = wprot;
RODATA: load = RAM2, type = wprot, define = yes;
DATA: load = RAM2, type = rw;
ZEROPAGE: load = ZP, type = zp;
AUTOSTRT: load = RAM2, type = wprot, define = yes;
}
and chunk.s:
.import __RODATA_LOAD__, __AUTOSTRT_LOAD__
; CHUNK HEADER
.segment "CHKHDR"
.word __RODATA_LOAD__
.word __AUTOSTRT_LOAD__ - 1
.code
.reloc
From looking at the source code for crt0.s in the atari library, the main header uses the values for CODE and BSS - 1 to create the header, so you are sort of stuck with putting the code and bss (what does that stand for?) in the first memory segment. Unless there is a way to override this without recompiling the library. The first segment is the smallest segment... but I guess we could split the code segments with some manual stuff in our C files and that should still work properly with the standard library right?
Anyway, this worked quite well and left the $4000-7FFF section alone from what I can tell. Thanks Ulrich and Chris for all the information so far!
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
This archive was generated by hypermail 2.1.3 : 2002-09-25 01:15:43 CEST