Can't get sender from l4_ipc_wait()
haohui.mai at gmail.com
Mon Apr 16 06:40:59 CEST 2012
Thanks for you suggestions. I did get sources from l4_ipc_wait() -- but I still cant map it back to the thread originating the IPC.
I created an IPC gate for each task to receive page faults and exceptions, where I set the label of the gate to be my task identifier.
I did get my task identifier back, but it seems there's no way to get my thread identifier since the source code of L4 Fiasco suggests that l4_ipc_wait() will only return the label of the IPC gate as the source.
Setting the same pager for all threads in a single task seems a reasonable thing to do but obviously it lost the information for thread identifier.
In order to recover this information, does it mean that I should create an IPC gate for each thread, setting its label to thread identifier in order to recover this information?
Taking a step back, am I doing the right thing? If the answer is no, what would be the suggested architecture?
Your comments are highly appreciated.
On Apr 10, 2012, at 1:55 AM, Adam Lackorzynski wrote:
> On Sun Apr 08, 2012 at 17:08:10 -0500, Mai, Haohui wrote:
>> Can you elaborate a little bit? Some code skeletons would be quite helpful.
>> I already created a new address space through l4_factory_task_create(), and
>> my own kernel can serve all page faults / exceptions / IPC for that task.
>> This is done by mapping the capability of my own kernel, which is its
>> thread id, into the newly created task. Therefore, I assume that the IPC
>> gate is set up.
> Are the other tasks trusted so that you can give out your own thread
> cap? That's usually no good thing to do.
>> What else should I do in order to have my kernel getting the source of the
>> IPC when calling l4_ipc_wait()?
> It's basically just l4_factory_create_gate, in the same way as
> l4_factory_task_create. Create it with a label of your choice and
> binding to the pager, and map it instead of the thread directly.
> Adam adam at os.inf.tu-dresden.de
> Lackorzynski http://os.inf.tu-dresden.de/~adam/
More information about the l4-hackers