Cross compile for 68000 in C under Windows
This article contains my notes for setting up a m68k cross-compiler using Cygwin. It’s all free software and gives me a way to create binary images for a 68000 CPU from C code on Windows. Here’s the step-by-step to set it up:
Step 1. Install Cygwin
Go to http://www.cygwin.com/ and download setup.exe. Run it.
During the setup, you will have the opportunity to select what packages to install. Choose the following:
- binutils
- gcc-core
- bzip2
- flex
- make
Step 2. Download the compiler source code
You want binutils and gcc-core from GNU. Go to the GNU download page, choose a mirror and download the following files. Place them in your Cygwin home directory.
- binutils-2.15.tar.bz2
- gcc-core-3.4.2.tar.bz2
Yes there are more up-to-date versions but at the time of writing, the latest gcc versions do not support the 68000 platform. Feel free to try different versions but I know the versions just mentioned will work.
Step 3. Compile and install binutils
Launch Cygwin and type the following commands. Typing this kind of stuff is automatic for me these days. Its a pretty standard GNU setup procedure.
mkdir /usr/local/m68k tar jxvf binutils-2.15.tar.bz2 cd binutils-2.15/ ./configure --prefix=/usr/local/m68k --target=m68k-coff make install
Step 4. Compile and install gcc
Same again for the C compiler.
cd ~ export PATH=$PATH:/usr/local/m68k/bin tar jxvf gcc-core-3.4.2.tar.bz2 cd gcc-core-3.4.2/ ./configure --prefix=/usr/local/m68k --target=m68k-coff --enable-languages=c make install
Step 5. Set up your path
The 68000 compiler will be located in /usr/local/m68k/bin. To make life easier, you might like to add the following to your ~/.bashrc file:
export PATH=$PATH:/usr/local/m68k/bin
Step 6. Enjoy
Here’s the command to compile some C code:
m68k-coff-gcc -o test.out test.c
And the command to create a binary image from the compiled code:
m68k-coff-objcopy -O binary test.out test.bin

This solder paste stuff is pretty toxic. Perhaps I’m going overboard here but I thought some rubber gloves would be a good idea.
To apply the paste, I just squirted it on the board. It kinda went everywhere at first until I got the hang of it. Next time I’ll get a smaller tube and perhaps a smaller nozzle. I fixed it up as best I could using a toothpick and cotton tips. It took quite a lot longer and was much more messy than I anticipated.
Next comes the pick-and-place. I got most of my parts from 
The idea is to use a frying pan or toaster oven to perform solder reflow for SMT circuit boards. I decided to use a skillet thinking that a toaster oven would melt components since it heats both top and bottom.
So I need to do a scientific experiment. Firstly I put some oil in the pan and stuck in a thermometer (the fork is to hold the probe in the oil). Then I turned up the heat slowly making a note of the temperature. Finally I graphed the result. Here are the results in degrees C. That cheap little temperature knob is surprisingly linear.
DOS Emulation
I finally got rid of that unreliable NetGear Wireless card and replaced it with a TP-Link card which uses the Atheros chipset. It was only $27 at
I’ve been writing a lot of DirectX / DirectShow stuff lately and I’ve come across a problem if I pause a video replay and then move the containing window. The playback window becomes separated from the containing window even though I am handling the WM_MOVE event.