I'm not sure I understand your question, so please forgive me if I end up "in the weeds". The 68000 uses an exception table that must start at address zero. It is $400 in length, and contains vectors to processes that handle system requirements. A large part of that table (vectors 64 - 255) is set aside for user defined vectors. The opcode TRAP #(0-15) invokes the vectors at $80 through $BC. So, is that what you are looking for to implement user syscalls?
Hi Roger.
I got the answer (trap #0 - syscall numbers the same as 80386 Linux, and registers used - took a lot of effort to realize that) elsewhere (an Amiga forum), and have already implemented it here:
sourceforge.net
So I already have a mini-clone operational:
[kerravon@paul-pinebook xxx]$ file pdptest.exe
pdptest.exe: AmigaOS loadseg()ble executable/binary
[kerravon@paul-pinebook xxx]$ file bios.exe
bios.exe: ELF 32-bit MSB executable, Motorola m68k, 68020, version 1 (SYSV), statically linked, stripped
[kerravon@paul-pinebook xxx]$ qemu-m68k ./bios.exe pdptest.exe "abc def"
bios starting
about to execute program with entry point C080202C
welcome to pdptest
main function is at C0802200
allocating 10 bytes
m1 is C0CC7008
allocating 20 bytes
m2 is C0CC8008
stack is around C07FFE50
printing arguments
argc = 3
arg 0 is <UNKNOWN>
arg 1 is <abc>
arg 2 is <def>
return from called program is hex 0
enter command, exit to exit
bios exiting
[kerravon@paul-pinebook xxx]$
[kerravon@paul-pinebook xxx]$ ls -l pdptest.exe bios.exe
-rwxr-xr-x 1 kerravon kerravon 50760 May 30 04:25 bios.exe
-rw-r--r-- 1 kerravon kerravon 24688 May 30 04:22 pdptest.exe
[kerravon@paul-pinebook xxx]$
The big thing I am missing at the moment is public domain (not
copyrighted - those exist) 68000 assembler to do these:
modsi3, mulsi3, udivsi3, umodsi3, divsi3
which is forcing me to use -m68020 in makefile.ami instead of
-m68000 -m68881 (an allowable combination to gccami).
The assembler heart of the mini Amiga clone (it's not really an
emulator - it's a mini-clone), is the 68000 assembler here:
sourceforge.net
(and corresponding C code and infrastructure elsewhere).
Anyway - an Amiga mini-clone in 51k is similar to my mini-WINE in 60k or similar.
And OS/2 mini-clone - and mini Windows clone on OS/2 etc etc.
It's only recently when looking at options to repeat that on the Atari
that I realized I should be able to do it for the mainframe too.
Lightweight mini-clones for anything on anything (anything with
the same CPU and preferably same function calling convention
otherwise a different technique is required).
BFN. Paul.