Hi x68000 users !
I've finally decided to release my human68k target toolchain.
A way to develop for X68000 using your Linux or Windows box.
My github page :
https://github.com/LyduxNotes:Actually, newlib lacks of some important low-level functions. I haven't time to maintain it actually. So, any help will be highly appreciated. (Codes/bugs/documentation/...)
Lastest updates:Sources : 11/23/2012
Windows binaries : 11/26/2012
Setup for Unix like OS1 - Environment settings(change as your needs)
# export HUMAN68K_TC=/opt/human68k
# export HUMAN68K_TC_SRC=$HUMAN68K_TC/src
# export PATH=$PATH:$HUMAN68K_TC/bin
# mkdir $HUMAN68K_TC $HUMAN68K_TC_SRC
2 - BinutilsBinutils provide an assembler/disassembler and various tools for executables manipulation.
# cd $HUMAN68K_TC_SRC
# git clone git://github.com/Lydux/binutils-2.22-human68k.git
# mkdir binutils-build
# cd binutils-build
# ../binutils-2.22-human68k/configure --prefix=$HUMAN68K_TC --target=human68k --disable-nls
# make all install
3 - GCCC compiler. Handle some specificities of the X68000.
# cd $HUMAN68K_TC_SRC
# git clone git://github.com/Lydux/gcc-4.6.2-human68k.git
# mkdir gcc-build
# cd gcc-build
# ../gcc-4.6.2-human68k/configure \
--prefix=$HUMAN68K_TC \
--target=human68k \
--disable-nls \
--disable-libssp \
--with-newlib \
--without-headers \
--enable-languages=c
# make all install
4 - NewlibProvides common functions for programming in C and does all startup code for communication with human68k kernel.
Provides also system call functions (IPLROM = iocscall, Human68K = doscall)
# cd $HUMAN68K_TC_SRC
# git clone git://github.com/Lydux/newlib-1.19.0-human68k.git
# mkdir newlib-build
# cd newlib-build
# ../newlib-1.19.0-human68k/configure --prefix=$HUMAN68K_TC --target=human68k
# make all install
5 - GDB (optional)A debugger. It can control the rom monitor embedded inside the IPLROM via a null modem cable.
# cd $HUMAN68K_TC_SRC
# git clone git@github.com:Lydux/gdb-7.4-human68k.git
# mkdir gdb-build
# cd gdb-build
# ../gdb-7.4-human68k/configure --prefix=$HUMAN68K_TC --target=human68k --disable-nls
# make all install
NotesBy default, the toolchain will create an ELF binary file, which is not directly compatible with human68k.
The objcopy tool from binutils provide a way to convert your file easily.
Assuming a simple hello.c source code :
For XFile :
# human68k-gcc hello.c -o hello.elf
# human68k-objcopy -O xfile hello.elf HELLO.X
Or for RFile (can also be used for pc relative SRAM target binary) :
# human68k-gcc -mpcrel hello.c -o hello.elf
# human68k-objcopy -O binary hello.elf HELLO.R
The toolchain also allow you to disassemble an XFile (Usefull for reverse engineering !) :
# human68k-objdump -D ANYFILE.X
Objdump can also show symbols and relocations (relocations does not point to the correct symbol actually)
# human68k-objdump -x ANYFILE.X
Setup for Windows 1 - Download the necessary packagesDownload the lastest Windows binary version of Code::Blocks from official website :
http://www.codeblocks.orgDownload the cross-Human68K toolchain packages for Windows :
Binutils-2.22 :
http://nfggames.com/X68000/Development/toolchain/binutils-2.21-human68k-win32-3.zipGcc-4.6.2 :
http://nfggames.com/X68000/Development/toolchain/gcc-4.6.2-human68k-win32-1.zipNewlib-1.4.0 :
http://nfggames.com/X68000/Development/libraries/newlib-1.19.0-human68k-1.zipMake-3.82 :
http://nfggames.com/X68000/Development/toolchain/make-3.82.zipDownload the Human68K Wizard for Code::Blocks :
http://nfggames.com/X68000/Development/toolchain/codeblocks-wizard-human68k-1.zip2 - Installing the toolchain :Just extract all toolchain packages into a directory of your choice. (Ex : C:\X68000\DEV)
3 - Installing and configuring Code::Blocks :Install Code::Blocks like any other application and start it.
Go to "Settings->Compiler and debugger" menu.
Make a copy of the "GNU GCC Compile" (should be selected by default) by clicking on the "Copy" button. Name this new compiler "Human68K GCC".
Now go into the "Toolchain executables" tab, and change all values by these one :

Note : The debugger is not available yet, I have to figure out how to to use it for remote debugging a real x68000 or an emulator.
Of course, change the "Compiler's installation directory" by the one you have choosen.
Now, extract the "Human68k Wizard for Code::Blocks" archive into the directory "share\CodeBlocks\templates\wizard" of your Code::Blocks installation directory (by default, it should be "C:\Program Files\CodeBlocks")
Stay in this wizard directory and edit the file "config.script" (using windows notepad is ok).
Search for these lines :
RegisterWizard(wizProject, _T("arm"), _T("ARM Project"), _T("Embedded Systems"));
RegisterWizard(wizProject, _T("avr"), _T("AVR Project"), _T("Embedded Systems"));
RegisterWizard(wizProject, _T("tricore"), _T("TriCore Project"), _T("Embedded Systems"));
RegisterWizard(wizProject, _T("ppc"), _T("PowerPC Project"), _T("Embedded Systems"));
and add this one after :
RegisterWizard(wizProject, _T("human68k"), _T("Human68K Project"), _T("Embedded Systems"));
Restart Code::Blocks, this is now a template "Human68K Project" with a familiar icon when you create a new project.

It will create a simple "hello world" application, you can try building it in order to check that your toolchain is correctly working.
You can also create a new library for Human68K by choosing "Static Library" instead of "Human68K Project".
Happy coding !
