[ros-dev] ARM port: SWI call numbering

Theo Markettos reactos at markettos.org.uk
Thu Jan 28 23:44:57 CET 2010


I wonder if I could get in touch with the folks doing the ARM port...

Executive summary: From a look at the code I think ARM ReactOS uses SWIs
(syscalls) numbered from zero.  There's a de-facto ARM standard that splits
up SWI numbering so different OSs get allocated different numbering ranges. 
It would be handy if ReactOS could pick one that doesn't clash with other
OSs.  I wondered if the ARM port folks might consider changing SWI base at
some point.


For more details, a brief history lesson.  The ARM1 and ARM2 chips were
originally developed at Acorn Computers in 1983-7.  The first ARM machine
was the Archimedes, launched by Acorn in 1987.  The Archimedes was supplied
with Arthur, which in 1988 became RISC OS, a co-operatively multitasking OS.
RISC OS is still around and runs on modern hardware such as the BeagleBoard
- see http://www.riscosopen.org/

SWI instructions on the ARM have a 24 bit 'comment' field.  As originally
envisaged this would hold the syscall number, a bit like INT on x86 and TRAP
on 68k.

Acorn for their OSs (and there were no other ARM OSs at the time) chose a
numbering scheme where bits 20-23 denote the OS.  For the ones I know about:

23--20
 0000 RISC OS
 1000 RISC iX (4.3 BSD ported to ARM2/3)
 1001 Formerly Linux (they've now don't use the comment field)
 1111 ARM's OS independent routines
And NetBSD use another value that I forget.

The advantage of having non-overlapping SWI bases is that it allows
cross-platform execution of binaries (a bit like WINE in effect, though I
don't know the details of how WINE works).  So it means RISC OS code (of
which there is lots) could run on ReactOS, or vice versa, if somebody writes
a syscall implementation for the other platform.

So I wondered if there was any interest in making sure the syscall numbers
didn't clash with other OSs?  From what I see in:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/usercall.c?revision=36880&view=markup
it looks like your SWIs are numbered from zero, which is a clash.

If you were interested in changing, do you have any idea how many SWIs you
might use?  RISC OS uses hundreds of thousands (SWIs are used as the
interface to DLL-like code), but if you were to only need, say, 2^16 that
might save the number space a bit.

Thoughts?  Comments?  Flames?

Thanks
Theo



More information about the Ros-dev mailing list