Hi!
How to write portable servers for L4 micro-kernel family?
I found what the l4_threadid_t type is different in various
L4 implementation. Does any wrapper on top of syscalls exist?
==== Fiasco microkernel: ====
typedef struct { unsigned version_low:10; unsigned lthread:7; unsigned task:11; unsigned version_high:4; unsigned site:17; unsigned chief:11; unsigned nest:4; } l4_threadid_struct_t;
typedef union { l4_low_high_t lh; l4_threadid_struct_t id; } l4_threadid_t;
typedef l4_threadid_t l4_taskid_t;
=== L4-KA microkernel: ====
#define L4_X0_VERSION_BITS 10 #define L4_X0_THREADID_BITS 6 #define L4_X0_TASKID_BITS 8
typedef union { struct { unsigned version : L4_X0_VERSION_BITS; unsigned thread : (L4_X0_THREADID_BITS + L4_X0_TASKID_BITS); unsigned chief : L4_X0_TASKID_BITS; } id;
struct { unsigned version : L4_X0_VERSION_BITS; unsigned thread : L4_X0_THREADID_BITS; unsigned task : L4_X0_TASKID_BITS; unsigned chief : L4_X0_TASKID_BITS; } x0id;
dword_t raw; } l4_threadid_t;
==========================
Second question is how to distinguish between IRQ messages and ordinary messages.
That code makes me confused:
irq_th.lh.low = COM_IRQ + 1; irq_th.lh.high = 0;
as I understand, it correspond to
irq_th.id.version_low = COM_IRQ + 1; irq_th.id.lthread = 0; irq_th.id.task=0; irq_th.id.version_high=0; irq_th.id.site=0; irq_th.id.chief=0; irq_th.id.nest=0;
Is lthread = 0 and task = 0 means interrupts?
Third question is how to handle memory mapped IO?
I found phystokv() function. It is just a simple macro, which placed deep inside of OSKIT
Is that right to use that function for MMIO?
What will happen if several servers requests same memory range simultaneously?
Best regards Alexei
On Thu, Sep 19, 2002 at 03:27:51PM +0900, Alexey Mandrookin wrote:
Hi!
How to write portable servers for L4 micro-kernel family?
I found what the l4_threadid_t type is different in various
L4 implementation. Does any wrapper on top of syscalls exist?
The difference is not really big in practice, because you tend to newer use the third dword-register in ipc anyway.
In C, the compiler fixes things, especially if you refrain from using raw thread-id constants, but base everything on template-ids, like
id = l4_myself(); id.id.lthread = XX
and so on. You still need to recompile though.
In asm, just assume that you always have 64-bit ids, by making sure not to scratch %edi.
Its simple when you get used to it.
Best, Jacob
l4-hackers@os.inf.tu-dresden.de