home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
back2roots/padua
/
padua.7z
/
padua
/
amix
/
AmigaDOS-Emu.zoo
/
small-doc
< prev
next >
Wrap
Internet Message Format
|
1992-01-14
|
5KB
From comp.sys.amiga.emulations Sat Jan 11 23:09:52 1992
Xref: cs.tu-berlin.de comp.unix.amiga:2436 alt.sources.amiga:448 comp.sys.amiga.emulations:2877
Path: cs.tu-berlin.de!fauern!Sirius.dfn.de!chx400!ieee.org!sdd.hp.com!samsung!uunet!blekko!yoda!ford
From: ford@yoda.uucp (Mike "Ford" Ditto)
Newsgroups: comp.unix.amiga,alt.sources.amiga,comp.sys.amiga.emulations
Subject: AmigaDOS emulator for Unix SVR4
Summary: amusing hack, works for some simple programs, could be extended
Keywords: source execute simple AmigaDOS programs
Message-ID: <114@yoda.uucp>
Date: 9 Jan 92 21:38:38 GMT
Reply-To: ford@yoda.uucp (Mike "Ford" Ditto)
Followup-To: comp.unix.amiga
Organization: Omnicron Data Systems
Lines: 4284
Here is an AmigaDOS emulator for Unix. It's written for Amiga Unix
SVR4, but would probably work on any m68k SVR4 system.
To compile it, you need the AmigaDOS include files. I used the
AmigaDOS 1.3 includes that came with a version of the Aztec C
Compiler. Some tweaking may be required for other versions.
Before you get too excited, note that the program emulates a *very*
small subset of the Amiga operating environment. It does not support
graphics at all. It currently emulates enough of exec.library and
dos.library to allow the execution of simple text-only programs, the
same sort of program that can be run entirely in an AmigaDOS CON: CLI
or AUX: CLI.
For example, I have successfully used it to run the Aztec C Compiler
and related utilities under Unix and develop AmigaDOS programs from C
source, entirely under Unix.
Although it is useful for a fairly small set of tasks in its current
form, it is extensible, and could form the basis for a "real" AmigaDOS
emulator. Basically, since I created the basic structure, I've been
implementing a new function whenever I try to execute a program that
fails because it needs that function. In some cases, I implmented
only enough to get the program in question to run.
I haven't worked on it in a while, but I am familiar with the
code and would be willing to help anyone who wants to hack on it.
Usage: arun [-v verbosity] amiga_program args ...
-v1 allows the display of some warnings and other marginally
useful information when invoking the program.
-v2 adds to the above a message for every AmigaDOS library
function called.
The "args ..." are concatenated separated by spaces and
passed to the AmigaDOS program.
If any unimplemented library function is called, the program
is aborted with a cryptic message. The sorts of things that
would cause the Amiga OS to "guru" will cause the process to
dump core.
Here are some examples of using this program to execute AmigaDOS
versions of "date" and "tar" programs, both compiled with Aztec C:
Script started on Thu Jan 9 16:29:44 1992
ford@yoda> file date tar arun.tar
~date: AmigaDOS LoadSeg file
tar: AmigaDOS LoadSeg file
arun.tar: tar file
ford@yoda> arun date
Thu Jan 9 16:30:16 1992
ford@yoda> arun -v2 date
ExecBase = 0x80012af8
DOSBase = 0x80011cbc
&CurrentProcess = 0x80012d8c (&MsgPort=0x80012de8)
&CurrentProcess.pr_CLI = 0x80012e38 (offset 0xac)
Program entry at 0x8001349c
OpenLibrary(dos.library, 0)
AllocMem(0x78, 0x10000)
FindTask(0)
AllocMem(0x6, 0x0)
AllocMem(0x8, 0x0)
Input()
Output()
Open(*, 0x3ed)
OpenLibrary(environment, 0)
Building Manx environment
CloseLibrary(0x80002bb0)
AllocMem(0x14, 0x0)
DateStamp(0xc07ffc50)
OpenLibrary(environment, 0)
CloseLibrary(0x80002bb0)
AllocMem(0x14, 0x0)
OpenLibrary(environment, 0)
CloseLibrary(0x80002bb0)
AllocMem(0x14, 0x0)
AllocMem(0x408, 0x0)
IsInteractive(200043c8)
SetSignal(00000000, 00001000)
Write(0x200043c8, 0x80015dc0, 0x1a)
Thu Jan 9 16:30:24 1992
FreeMem(0x80015db8, 0x408)
Close(0x20004851)
FreeMem(0x80013008, 0x78)
FreeMem(0x800131ac, 0x14)
FreeMem(0x80013194, 0x14)
FreeMem(0x800130b0, 0x14)
FreeMem(0x80012e94, 0x6)
FreeMem(0x80012ea0, 0x8)
Program returned 0x0
ford@yoda> arun tar -tvf arun.tar
rw-r--r-- 42/10 181 Dec 25 20:43 1990 Makefile
rw-r--r-- 42/10 529 Dec 27 15:49 1990 amiga.c
rw-r--r-- 42/10 976 Dec 26 03:25 1990 arun.h
rw-r--r-- 42/10 10498 Jun 20 04:19 1991 dos.c
rw-r--r-- 42/10 4347 Jan 9 20:37 1992 exec.c
rw-r--r-- 42/10 420 Dec 25 20:43 1990 load.h
rw-r--r-- 42/10 4573 Dec 26 02:02 1990 loadseg.c
rw-r--r-- 42/10 653 Dec 25 20:43 1990 mkstubs
rw-r--r-- 42/10 2550 Jan 9 21:01 1992 run.c
rw-r--r-- 42/10 384 Dec 26 03:16 1990 runseg.s
rw-r--r-- 42/10 49013 Dec 25 20:44 1990 stubs.s
rw-r--r-- 42/10 18605 Dec 28 03:57 1990 unsupp.s
ford@yoda> exit
script done on Thu Jan 9 16:31:04 1992
I created this software and hereby submit it into the public domain.
Have Fun!
-=] Ford [=-
"Well, he didn't know what to do, so (In Real Life: Mike Ditto)
he decided to look at the government, ford@yoda.uucp
to see what they did, and scale it uunet!cbmvax!kenobi!ford
down and run his life that way." -- Laurie Anderson