docker-amiga-gcc-vamos/README.md

82 lines
1.9 KiB
Markdown
Raw Permalink Normal View History

# Containerfile for AmigaOS Cross-Compiler Toolchain
2018-03-29 07:57:03 +00:00
`Containerfile` for [Stefan "Bebbo" Franke](https://github.com/bebbo)'s [amiga-gcc](https://github.com/bebbo/amiga-gcc) toolchain for Linux/AmigaOS cross-development.
2018-03-29 07:57:03 +00:00
A ready-to-use image built from this Containerfile is available on [Docker Hub](https://hub.docker.com/r/sebastianbergmann/amiga-gcc/).
2018-03-29 07:57:03 +00:00
2020-11-22 16:39:26 +00:00
More information can be found [here](https://amiga.sebastian-bergmann.de/presentations/2017/evoke/amiga-software-development-in-2017).
2018-03-29 07:57:03 +00:00
## "Hello world!" Example
### AmigaOS C API
`hello.c` from [Radosław Kujawa](https://github.com/Sakura-IT/Amiga-programming-examples/tree/master/C/hello-world-amiga):
```c
#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);
}
```
### Standard C Library
`hello.c` from [Radosław Kujawa](https://github.com/Sakura-IT/Amiga-programming-examples/tree/master/C/hello-world):
```c
#include <stdio.h>
int main()
{
printf("Hello world!\n");
return(0);
}
```
### Compilation
```
$ podman run -v $HOME:/host -it sebastianbergmann/amiga-gcc \
2018-03-29 07:57:03 +00:00
m68k-amigaos-gcc /host/hello.c -o /host/hello -noixemul
```
### Execution
#### Container-ized Emulation using FS-UAE
2018-03-29 07:57:03 +00:00
The `docker-execute-amiga` script used below can be downloaded from [here](https://raw.githubusercontent.com/sebastianbergmann/docker-execute-amiga/master/docker-execute-amiga.sh).
```
$ docker-execute-amiga helloworld
```
![Screenshot](screenshot.png)
#### Container-ized Emulation using Virtual AmigaOS (vamos)
2018-03-29 07:57:03 +00:00
```
$ podman run -v $HOME:/host sebastianbergmann/amitools:latest \
2018-03-29 07:57:03 +00:00
vamos -C 68020 /host/hello
Hello world!
```