Dockerized Development Tools

Stefan "Bebbo" Franke has forked Krystian Bacławski's AmigaOS cross compiler toolchain in an effort to update, amongst other components, GCC to version 6.

I have created a Dockerfile for building a software container for use with Docker. This allows me to conveniently build and use the AmigaOS cross compiler toolchain, which requires a 32-bit environment, on my 64-bit Linux system.

Once Docker is installed we can compile hello.c, the famous "Hello world!" example:

Hello world!

$ docker run -v $HOME:/host \
  -it sebastianbergmann/m68k-amigaos-bebbo \
  m68k-amigaos-gcc /host/hello.c -o /host/hello -noixemul

Christian Vogelgsang created amitools, a collection of tools to work with AmigaOS binaries. One of these tools is xdftool which can be used to work with Amiga Disk File (ADF)s. In the example below, I use another Docker container for running xdftool.

Using xdftool, we can create a fresh a floppy image, format it using Fast File System (FFS), copy the binary we compiled in the previous step to it, and create a S:startup-sequence script that executes our binary:

$ echo C:hello > $HOME/startup-sequence

$ docker run -v $HOME:/host \
  -it sebastianbergmann/amitools \
  xdftool \
  /host/hello.adf \
  format HelloWorld ffs + \
  boot install + \
  makedir C + \
  write /host/hello C/hello + \
  makedir S + \
  write /host/startup-sequence S/startup-sequence

$ rm $HOME/startup-sequence

Now that we have a floppy image with our compiled binary we can finally test it using the FS-UAE emulator (provided by yet another Docker container):

$ docker run -it \
  -e DISPLAY=$DISPLAY \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  -v $HOME/.config/fs-uae/:/home/fsuae/config \
  -v $HOME:/host \
  jamesnetherton/fs-uae \
  --amiga_model=A1200 \
  --floppy_drive_0=/host/hello.adf

Hello world!

The above assumes that you have Kickstart ROM files in the $HOME/.config/fs-uae directory on the host.

If you do not have Kickstart ROM files available then you can omit the -v $HOME/.config/fs-uae/:/home/fsuae/config \ line in the command shown above and FS-UAE will fall back to the Open Source AROS kernel:

Hello world!

By the way: the binary created by compiling hello.c is simple enough to be executed through vamos, the Virtual AmigaOS that allows to run AmigaOS m68k binaries directly on Linux:

Hello world!