Friday, November 25, 2016

Building a 68000 Single Board Computer - Software

While waiting for the remaining parts, I spent some time getting the software for the board ready.

The Teeside TS2 used a monitor program which is listed in source code form in the book and on the included CD-ROM. The CD-ROM also includes a number of tools including a 68000 cross-assembler and simulator.

The programs are from the late 1980s and were written for MS-DOS (predating Windows). I was able to run the cross-assembler and the simulator under Windows 10 (it needs to be run as Administrator). I was able to run the small version of the monitor called minimon under the simulator. I was also able to run the programs under the Linux program dosbox (an MS-DOS emulator).

I normally use Linux and wanted a native cross-compiler for the 68000 that I could run there. The GNU assembler supports the Motorola 68K family. It is quite easy to build a 68000 cross-assembler under Linux. I followed some instructions I found here. These were the basic steps I followed:

  1. Get GNU binutils, which includes the assembler, by downloading it from
  2. Untar the source archive somewhere.
  3. Configure it using ./configure --target=m68k-elf
  4. Build it using make -j4
  5. Install it using sudo make install

The assembler binary is called m68-elf-as.

You can also build the GNU C compiler if you want to do high-level language programming. Quite a bit of code should fit in the RAM and ROM available. The basic steps I followed to do this are (based on

  1. Get the code
  2. Untar it.
  3. You will need some development tool packages which vary depending on your Linux distribution.
  4. Configure, build, and install it using:

mkdir objdir
cd objdir
../gcc-5.4.0/configure --target=m68k-elf --enable-languages=c --disable-libssp
make -j4
sudo make install

The C compiler binary is m68k-elf-gcc. Many other tools also get built.

I was able to port the TS2 monitor to assemble under the GNU assembler and was able to generate binaries that match the original from the Teesside assembler. The port can be found here on github.

I also wrote some simple code that plan to use when I start to bring up the board - a simple ROM that will do only a little more than freerun mode, like a simple loop or writing to the serial port. This can be found here, but is still a work in progress and untested.

Future projects, if and when the board is up and running, could include trying to get the TUTOR software from Motorola's ECB board running (the TS2 should be compatible with it). It is a little more advanced than the TS2 monitor and includes an assembler than runs on the board, for example.

There are some free implementations of BASIC for the 68000 that could possibly be ported including and

No comments: