The existing 68K support in Newlib is laid out such that all boards using m68k cpu’s have their specific implementations in one directory under ‘libgloss’. The Makefile.in has specific build sections for each board/platform library. The platform specific library etc is linked by using the –T option on ‘ld’ to invoke a linker script. This script defines memory layout, .text, .data etc locations, size of memory and the libraries to link with to get platform specific functions.
Conveniently in this directory also reside all the syscall stubs, named io-xxx.c. These all return –1 when called but you get no link time errors. This means that I can start building an HK68K specific libgloss iteratively.
Links:
- http://wiki.osdev.org/Porting_Newlib A succinct approach
- http://www.embecosm.com/appnotes/ean9/ean9-howto-newlib-1.0.html A full approach
- http://wiki.osdev.org/Linker_Scripts
- http://wiki.osdev.org/OS_Specific_Toolchain Not sure if this approach is applicable to HK68K use
- http://wiki.osdev.org/Bare_Bones For boot and initial kernel experiments