8

After trying out FS-UAE on my Fedora Linux system, which worked quite nicely, I got to thinking. Even though when the Amiga was originally released in the middle 1980s, it was revolutionary in its graphics and sound capabilities, not all Amiga programs need them. As a specific case, C compilers on the Amiga have no need of the computer's graphics and sound capabilities. (I mean the compilers themselves don't, the programs they produce as compiled output may well do.)

So it seems to me that firing up a fully emulated Amiga just to compile C code on it is overkill. Would it be technically possible to have an emulator that has an emulated Motorola 680x0 CPU and the Amiga operating system ROM running, maps the Amiga's file system to the host computer's like FS-UAE does, but instead of implementing a full Amiga GUI only interacts with the user through standard stdio? That way it could run in a Linux terminal and be faster, more efficient and less error-prone to use. The emulator could just skip all system calls or direct chip instructions that use graphics or sound.

What I am looking for here is some kind of system that would allow me to run this kind of program:

#include <stdio.h>
int main(void) {
  printf("Hello world!\n");
}

in a Linux terminal, but with the actual program being in Motorola 608x0 machine code using the AmigaOS system libraries.

This would allow me to write programs such as:

#include <exec/types.h>
#include <exec/memory.h>
#include <libraries/dos.h>
int main(void) {
  BPTR lock;
  lock = Lock("DF0:Stuff", ACCESS_READ);
  AssignLock("Stuff:", lock);
}

which will (if I remember my AmigaOS correctly) assign "Stuff:" to "DF0:Stuff", all in AmigaOS code, but with the emulator never actually starting up an Amiga GUI, but instead doing the whole thing in a Linux terminal. Note that exec/types.h, exec/memory.h and libraries/dos.h are AmigaOS library headers, not Linux library headers.

Is this kind of thing possible? And if it is, does something like it exist and has anyone else thought about it?

  • 3
    The Amiga graphics chips don't have a text mode. It's all bitmaps, all the time. – Tim Locke Nov 15 '20 at 1:36
  • That's not what I am asking about. AmigaOS has stdin and stdout just like Linux has. What I am after here is an Amiga emulator that maps the AmigaOS stdin and stdout to Linux stdin and stdout, not to the Amiga graphics chips. The entire system would not have to care about the Amiga graphics chips at all. – user53739 Nov 15 '20 at 1:46
  • 1
    Maybe don’t phrase it as ‘text-only’ then. Call it ‘seamless’ (as in the VirtualBox mode), ‘rootless’ (as in X servers) or ‘Wine-like’ (as in, provides the AmigaOS API on the host OS just like Wine provides the Win32 API, instead of virtualising the whole machine). – user3840170 Nov 15 '20 at 6:42
  • 1
    Also, Wine Is Not an Emulator. I was a little confused about what you are asking, but it sounds like a relatively simple compatibility layer should meet your needs. – snips-n-snails Nov 15 '20 at 7:21
  • 2
    While your question is on-topic here, please also be aware of our software recommendations sister site – Mawg says reinstate Monica Nov 15 '20 at 10:08
19

A solution like that already exists: it's called vamos (Virtual AMiga OS) and emulates a 68k CPU and a bunch of libraries - enough to get terminal only programs (like compilers and assemblers) running:

https://github.com/cnvogelg/amitools

Not all that easy to setup though.

  • I got amitools to work simply by installing python-pip and python3-devel, downloading the zip package from GitHub and running "sudo pip install amitools". So far I have only tried vamos on only a few simple text-only programs I wrote in the days when I still had a working real Amiga. The programs worked all OK so far. It seems that the emulated Amiga vamos runs has one megabyte of memory. My last working real Amiga had 48 megabytes, my current Linux system has 16 gigabytes. Is there a configuration option in vamos to set how much memory it can use? – user53739 Nov 16 '20 at 0:51
  • The example config file doesn't mention such an option. But one of the developers working on it mostly uses it to run SAS/C, I can't imagine there's a hard limit at 1 MB. – Venner Nov 16 '20 at 14:12
  • vamos seems to work all OK for stand-alone programs, but trying to open a shell with "vamos -x Shell-Seg" crashes vamos. I don't even know if it's a bug in vamos or an AmigaOS error. Is there any other way of running an Amiga shell in vamos? Or should I resort to writing my own crude minimal shell that just loops with calling fgets() and then system() with whatever it gets as input, until it runs out of input? – user53739 Nov 16 '20 at 21:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.