| 1 |
Copyright (C) 2025 Mikael Hildenborg |
| 2 |
SPDX-License-Identifier: BSD-2-Clause |
| 3 |
|
| 4 |
Atari 16/32 bit TOS (not MINT) target. |
| 5 |
Target name: m68k-atari-elf. |
| 6 |
|
| 7 |
Stack and heap size: |
| 8 |
The symbol: "_stksize" defines how much memory that is reserved for stack and heap using the following scheme: |
| 9 |
1. If "_stksize" is undefined, then all available memory is reserved. |
| 10 |
2. If `int _stksize = SIZE;` is defined anywhere in the code, then "SIZE" is used in this way: |
| 11 |
* SIZE == 0: then MINKEEP (64KB) memory is reserved. |
| 12 |
* SIZE == 1: then 1/4 of all memory is reserved. |
| 13 |
* SIZE == 2: then 2/4 of all memory is reserved. |
| 14 |
* SIZE == 3: then 3/4 of all memory is reserved. |
| 15 |
* SIZE >= 4: then SIZE memory is reserved. |
| 16 |
* SIZE == -1, then all available memory is reserved (for mintlib compatibillity). |
| 17 |
* SIZE < -1, then -SIZE memory is reserved (for mintlib compatibillity). |
| 18 |
The heap starts at the bottom of the shared memory and the stack starts at the top, and they grow towards eachother. |
| 19 |
A safety check for memory allocations is done to make sure that memory is not allocated and overwriting the stack. |
| 20 |
|
| 21 |
Program base page: |
| 22 |
A pointer to the program base page is stored at: _BasePage |
| 23 |
|
| 24 |
ELF output: |
| 25 |
The executable elf output have four interesting segments: |
| 26 |
".text", ".data", ".bss" and ".prgheader" as described in "atari-tos.ld". |
| 27 |
All relevant code and data have been properly sorted into those segments, and the ".prgheader" |
| 28 |
contains a valid atari prg header pointing to relevant segments. |
| 29 |
Relocation data from the link switch "--emit-relocs" (defaultted by "atari-tos.specs") is |
| 30 |
included in the elf output so additional fixup information can be added to the prg file. |
| 31 |
Addresses in elf and prg files are the same and thus compatible for interchangeable symbol lookup. |
| 32 |
|
| 33 |
More information: |
| 34 |
Can be found at: https://github.com/hildenborg/m68k-atari-dev |
| 35 |
Where build scripts for complete toolchain, executables for converting elf to prg, and a remote debug server with full symbolic debugging are available. |