Portable servers?

Alexey Mandrookin alman at mgateinc.com
Thu Sep 19 08:27:51 CEST 2002


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 +
        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

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;

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

Best regards

More information about the l4-hackers mailing list