[okl4-developer] new Wombat syscall and others
Carl van Schaik
carl at ok-labs.com
Tue Jun 12 18:57:19 EST 2007
Hi Jorge,
Jorge Torres wrote:
> Hi okl4.org <http://okl4.org>,
>
> I have a few questions, of which probably many of you know the
> answers, but I'm starting to feel a little lost (RTFM answers are
> welcomed too :)
>
> *Wombat magic relies on the great work of adding arch/l4 and asm-l4
> right?, so what are all the (asm-* and arch/*)!=l4 used for?
They are mostly not used. However a number of them are included by the
base architecture. eg ARM on L4 includes a few files from asm-arm. This
is mostly to avoid duplication of files.
> *If one wants to add a new wombat syscall, where is it to be
> registered? since there is no arch/l4/kernel/entry.S, which is quite
> obvious if architecture independent code is wanted, I believe there is
> this syscalls.c instead, but I cant understand completely how it
> works, and how can it match with include/asm/unistd.h? perhaps it
> doesn't really have to. And how does this { sys_MYINTERRUPT, {{
> .args = ?(QUITE OBVIOUS), .flags = ?, .ret_type = ??? }} }, works?
There are a number of options: We can support a number of different ABIs
from one architecture. Eg on MIPS, we used to support O32, N32 etc which
are different syscall ABIs. So you could add a new ABI for your own
syscalls.
Alternatively, you can add extra syscalls to the base ABI. The base ABI
depends on the architecture, eg ARM L4 uses ARM compatible syscalls.
how syscalls work: The ABI call is converted to an L4 syscall number in:
linux/kernel/arch/l4/kernel/main.c :
long sys_num = l4_arch_lookup_syscall(&curinfo->regs, &abi);
then the syscall is called via:
result = l4_arch_abi_call(&curinfo->regs, sys_num, abi);
For ARM: The lookup syscall uses the: l4_arm_abi_syscalls[] table to
convert ARM syscall numbers to L4-Linux generic syscall numbers.
This then indexes the l4_syscall_table[] table which has function
pointers and details on number of arguments, return type etc
The flags = L4_SYS_FLAGS_NEED_REGS, means the function expects a pointer
to the saved register context - always the last argument in a Linux
syscall function.
>
> *What do I have to do If I want to use iguana's libraries on wombat
> kernel code, I've seen this #include <asm/macros.h>
> #include INC_SYSTEM2(something), but I'm not sure; there is also
> INC_SYSTEM() so, what are they for?
Iguana libraries should just be included like:
#include <iguana/thread.h>
> *Are wombat's user threads L4 threads too, meaning they have UTCB
> entries on Wombat's address space?
They are L4 threads, and have different address spaces to the Wombat
address space. So they have UTCBs yes.
> *If I add an iguana server, how can I communicate with it from a
> Wombat user application, naming,IPC?
You need to provide a driver in Wombat that acts as a proxy for the
user-application. We don't support direct communication between
user-applications and iguana applications.
>
> *Iguana naming service is restricted to threads among their specific
> protection domain, or is it a global service, meaning that threads
> on different protection domains and AS can communicate via naming
> service?
Its a global service, threads in different protection domains can use
it. The name server provided is a very simple example that does not try
to do security.
>
> Well thank you very much,
>
> Jorge
>
regards,
Carl
More information about the Developer
mailing list