Hi Carsten,
- L4Linux kernel module
But as soon as I try to execute a "read"-call, I get:
--Unset id on stack (c)----------------------------------IP: 00401e30 [l4lx.cpu0] (10.05) jdb: g 00000505.00000002 failed CLI: 00000010.00000005
Hard to tell without knowing any details about what you are doing in the L4Linux kernel. You cannot "just use" IDL server stubs in the L4Linux kernel, they have to run in interrupt threads (the ORe driver in drivers/net/l4ore.c might serve as an example). The error message you get might also indicate a stack overrun (maybe the generated DICE code uses too much stack ... ?).
I think it is indeed a stack overrun. I have implemented CORBA_alloc() and CORBA_free() to force DICE to allocate the used buffers during IPC via the Linux kernel vmalloc, but it seems, that DICE is not using these methods at all:
My IDL-File looks like this: long read ( [in, size_is(name_len), max_is(MAX_NAME_LEN)] char *name, [in] unsigned long name_len, [in] unsigned long start, [in] unsigned long bytes_to_read, [out, prealloc_client, max_is(MAX_PAGE_SIZE)] unsigned char read_buffer[] );
long write ( [in, size_is(name_len), max_is(MAX_NAME_LEN)] char *name, [in] unsigned long name_len, [in] unsigned long start, [in] unsigned long bytes_to_write, [in, prealloc_client, max_is(MAX_PAGE_SIZE)] unsigned char write_buffer[] );
My according CORBA_alloc/free implementation looks like this:
#include <linux/vmalloc.h>
void *CORBA_alloc(unsigned long size) { return vmalloc(size); }
void CORBA_free(void *addr) { vfree(addr); }
But the generated code doesn't even include a call for CORBA_free, instead it generates:
[...] struct { l4_fpage_t _dice_rcv_fpage; l4_msgdope_t _dice_size_dope; l4_msgdope_t _dice_send_dope; long _dice_opcode; unsigned long name_len; unsigned long start; unsigned long bytes_to_write; unsigned char write_buffer[4096]; char name[100]; } dummy_write_in; [...]
What am I missing? ;)
Thanks, Marcel