Dockerfile
for Stefan "Bebbo" Franke's fork of Krystian Bacławski's AmigaOS Cross-Compiler Toolchain.
A ready-to-use image built from this Dockerfile is available on Docker Hub.
hello.c
from Radosław Kujawa:
#include <proto/exec.h>
#include <proto/dos.h>
int main(int argc, void *argv[])
{
struct Library *SysBase;
struct Library *DOSBase;
SysBase = *((struct Library **)4UL);
DOSBase = OpenLibrary("dos.library", 0);
if (DOSBase) {
Write(Output(), "Hello world!\n", 13);
CloseLibrary(DOSBase);
}
return(0);
}
hello.c
from Radosław Kujawa:
#include <stdio.h>
int main()
{
printf("Hello world!\n");
return(0);
}
$ docker run -v $HOME:/host -it sebastianbergmann/m68k-amigaos-bebbo \
m68k-amigaos-gcc /host/hello.c -o /host/hello -noixemul
hello.s
from Grzegorz Kraszewski:
SysBase = 4
OpenLibrary = -552
CloseLibrary = -414
PutStr = -948
LEA DosName,A1
MOVEQ #36,D0
MOVEA.L SysBase,A6
JSR OpenLibrary(A6)
TST.L D0
BEQ.S NoDos
MOVE.L #Hello,D1
MOVEA.L D0,A6
JSR PutStr(A6)
MOVEA.L A6,A1
MOVEA.L SysBase,A6
JSR CloseLibrary(A6)
NoDos CLR.L D0
RTS
DosName DC.B "dos.library",0
Hello DC.B "Hello World!",10,0
$ docker run -v $HOME:/host -it sebastianbergmann/m68k-amigaos-bebbo \
vasm -Fhunkexe -o /host/hello /host/hello.s
The docker-execute-amiga
script used below can be downloaded from here.
$ docker-execute-amiga helloworld
$ docker run -v $HOME:/host sebastianbergmann/amitools:latest \
vamos -C 68020 /host/hello
Hello world!