Hey all! I've been working on something similar, a breadboarded 68K, and may be able to offer some help!
I also have built myself the GCC 68K cross compiler and have a complete toolchain working with CodeBlocks.
Here is a link to the git repo of the project:
https://gitlab.thenybble.com/nybble/m68k-baremetalTo walk through some of the project:
bin - Contains the Debug and Release executable files. The file extension is .EXE but I assure you, it's not a Windows executable. In fact, it's not an ELF executable either. That's just the default extension CodeBlocks throws on binary files on Windows.
include - Header files for the project. ASM.H is used by crt0.S in the src folder to define some of the hardware information. Display.h is for a simple 16x2 character display tied directly to the address bus. Exceptions.h is me wading into using GCC to define interrupts and exception handlers.
link - My custom linker script for the linker. This tells the linker to output in raw binary format instead of ELF. The SYS area is defined as the first 1K of memory (RAM or ROM) and holds the reset vectors and vector table for exception processing. You can customize these as you need them. Redefine them as RAM and ROM, or even break them down into things like SYS_ROM, USER_ROM, RAM, etc.
obj - Intermediate object code. Don't worry about it!
src - The good stuff. crt0.S Setup the environment, setup the stack frame, clear BSS, call main, call _exit and halt the processor, define the reset vectors and the exception table, etc.
sbrk.c - Hey, did I mention this thing supports dynamically allocating RAM? A simple sbrk routine for malloc! Exceptions.c - How to use the __attribute__ tag to tell GCC to setup the function for interrupt handling, like moving use RTE (Return from Exception) instead of RTS (Return from Subroutine) for these interrupt handlers.
Just make sure that your cross compiler has NewLib available, and it should all compile in CodeBlocks!]
I'll be around to answer questions if you have any! Wade through the code - It should be easy to adapt to support a UART module using a volatile pointer if you're doing memory mapped I/O, which I'm pretty sure all the 68K supports
