vscode-amiga-debug icon indicating copy to clipboard operation
vscode-amiga-debug copied to clipboard

bss section in chip mem

Open mfamfa opened this issue 3 years ago • 4 comments

I fail to put a bss section in chip memory. .section .bss_chip, .bss.MEMF_CHIP, .section .bsschip, attribute((chip)) etc -none is working. Could you point me in the right direction? Thank you.

mfamfa avatar Aug 31 '21 07:08 mfamfa

Have you had a look at the included starter project? https://github.com/BartmanAbyss/vscode-amiga-debug/blob/master/template/main.c#L151 This works for data, maybe it also works for BSS. Haven't tried...

BartmanAbyss avatar Aug 31 '21 09:08 BartmanAbyss

Thank you. Yes, I first tried to modify the existing macros in gcc8_c_support.h without success.

volatile UBYTE testbuffer[51200] attribute((section (".MEMF_CHIP"))); Will allocate testbuffer in chip memory as data (and increase filesize)

volatile UBYTE testbuffer[51200] attribute((section (".bss"))); Will allocate testbuffer in non-chip memory as bss (and not increase filesize)

volatile UBYTE testbuffer[51200] attribute((section (".bss.MEMF_CHIP"))); Will allocate testbuffer in non-chip memory as bss (and not increase filesize)

I feel that I am missing something fundamental here on what is actually allocating these sections and where.

I poked around a bit in Bebbo's gcc and there is a mention of a "chip" attribute keyword, but it seems not to be present in the gcc included here. Also when searching the source I see .bsschip / .bss_chip but none of them works when trying here.

mfamfa avatar Sep 01 '21 08:09 mfamfa

I'm running into the same problem.

Any chance this is something relatively easy to fix?

rjobling avatar Feb 20 '22 14:02 rjobling

I would recommend this "simple" approach (works without linker scripts). Can probably be wrapped into a macro or something for easier reuse:

__asm__(
	".pushsection .BeEsEs.MEMF_CHIP, \"aw\", @nobits\n"
	".global beeses\n" 
    "beeses:\n"
    ".balign 2\n"
	".nop 2048*2\n"
	".popsection\n"
);
extern unsigned short beeses[2048];

you can ofcourse change the section name .BeEsEs (just not .bss).

BartmanAbyss avatar Jul 22 '22 20:07 BartmanAbyss