Hi,
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.
~Haohui
On Apr 10, 2012, at 1:55 AM, Adam Lackorzynski wrote:
Hi,
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 adam@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/
Hi,
On Sun Apr 15, 2012 at 23:40:59 -0500, Haohui Mai wrote:
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.
Yes, that's this way.
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?
If you want to know which thread it is exactly, yes, you would need to create a gate for each thread, otherwise there is no id anyway for the thread in the pager's task.
Taking a step back, am I doing the right thing? If the answer is no, what would be the suggested architecture?
Interesting to know would be why you need to know the thread exactly? For mapping at least, only the task itself is relevant.
Adam
l4-hackers@os.inf.tu-dresden.de