I'm working on a custom single-board computer based around the Motorola 68000. While I wait for the PCB to come in the mail, I've written some basic debugging scripts in M68k Assembler. I'd like to get my environment set up for writing C code now.
The system has 256K of ROM starting at 0x0, and 256K of RAM starting at 0x120000. What I need to produce is an executable that fits in ROM, and starts out with a few kB of assembler code followed by a bunch of C code.
Here is what my linker script looks like right now:
Code: Select all
STARTUP(start.o)
INPUT(main.o)
OUTPUT(os.bin)
OUTPUT_FORMAT("binary")
ENTRY(_start)
MEMORY
{
ROM(rx): ORIGIN = 0, LENGTH = 256k
RAM(rwx): ORIGIN = 0x120000, LENGTH = 256k
}
SECTIONS
{
.text :
{
*(.text)
*(.rodata*)
} > ROM
.data :
{
*(.data*)
} > RAM AT > ROM
.bss :
{
*(.bss*)
} > RAM
}