m68k bare bone
Posted: Mon Nov 18, 2019 4:05 pm
Hi
I want to make a binary file (aka a rom) to use as a ROM in a 68000 chipset. I built my compiler toolchain (m68k-amigaos-*) and it produces nice elf files, so it should be Ok on this side (I hope...).
The gitlab project can be reached here : https://gitlab.mimicprod.net/os/miga.
The project contains the asm bootstrap code (src/bootstrap/bootstrap.s) which calls some C code. The goal is to mimic the Amiga ROM logic. So I made some shared libraries (exec.library, dos.library, graphics.library...) in C (src/libraries & src/devices). And now, I want them to be included in the ROM.
The linker file is has follow (src/bootstrap/linker.ld):
The final output is an AmigaOS "loadseg()ble executable/binary" that I convert to a binary file with the following command:
m68k-amigaos-objcopy -O binary -j .text bootstrap rom.bin
The disassembly output is correct, but only the bootstrap glue is present, no other piece of code of the libraries.
My question is how to configure CMake to make a binary file which contains every sections of the code this way :
- bootstrap.s
- exec.library code
- dos.library code
- graphics.library code
- ....
AND relocate all the above code at memory location 0xF00000 ?
Made shorter, how to build a m68k bare bone in CMake
Iliak
I want to make a binary file (aka a rom) to use as a ROM in a 68000 chipset. I built my compiler toolchain (m68k-amigaos-*) and it produces nice elf files, so it should be Ok on this side (I hope...).
The gitlab project can be reached here : https://gitlab.mimicprod.net/os/miga.
The project contains the asm bootstrap code (src/bootstrap/bootstrap.s) which calls some C code. The goal is to mimic the Amiga ROM logic. So I made some shared libraries (exec.library, dos.library, graphics.library...) in C (src/libraries & src/devices). And now, I want them to be included in the ROM.
The linker file is has follow (src/bootstrap/linker.ld):
Code: Select all
MEMORY {
ram (rwx): ORIGIN = 0x0, LENGTH = 15M
rom (rx): ORIGIN = 0xF00000, LENGTH = 1M
};
PROVIDE (_stack = ORIGIN(ram) + LENGTH(ram));
ENTRY (_reset_handler);
SECTIONS
{
.text : {
*(.text*)
*(.data*)
*(.bss*)
. = ALIGN(4);
} >rom
};
m68k-amigaos-objcopy -O binary -j .text bootstrap rom.bin
The disassembly output is correct, but only the bootstrap glue is present, no other piece of code of the libraries.
My question is how to configure CMake to make a binary file which contains every sections of the code this way :
- bootstrap.s
- exec.library code
- dos.library code
- graphics.library code
- ....
AND relocate all the above code at memory location 0xF00000 ?
Made shorter, how to build a m68k bare bone in CMake
Iliak