Hi Nelson, Damien,<br><br>Invariants about OKLinux scheduler, can be fixed, if one modifies the scheduler to be aware of this, Nelson could your tell, where is that one enables the IPC permission?, I think this could be achieved by some means setting the useland linux thread as I0/Bound when waiting for IPC, therefore it wont be scheduled by Linux, for this one will have to set a mechanism, one I can think of surely not the best is, turning the thread into an "iguana operation state" and back, this is:<br>
<br>Before performing L4IPC, and any other L4-iguana operations, userland linux thread must create a waitqueue via DECLARE_WAITQUEUE(), and add itself to such queue via add_wait_queue(), then notify an iguana's server (about this later), once done so, it is able to perform l4 native operations, after done, it should notify server (back to userandlinux request), server wakes up the queue, and userland thread continues with OKlinux userland code.<br>
<br>What the registering iguana server should do is to: flip-flop OKLINUXuserland thread priority to higher or lower priority than Linux's mian and timer threads (which is how the systems guarantees that userland threads are always scheduled by the linux scheduler and not the L4 scheduler). For this one will have to modify the Linux set thread and eas creation routines so it sets the scheduler register to be the server just mentioned. this would be something like:<br>
<br>.<br>.<br>.<br>OKLINUXUserland code<br>.<br>.<br>ENTER_IGUANA_STATE<br>.<br>L4-Iguana Native code<br>.<br>.<br>LEAVE_IGUANA_STATE<br>.<br>.<br>OKLINUXUserland code <br><br><br>I think that would be one simple way of doing this,<br>
<br>Best regards,<br><br>Jorge<br><br><br><br><br><br><div class="gmail_quote">On Thu, Feb 28, 2008 at 2:11 AM, Nelson Tam <<a href="mailto:nelson@ok-labs.com">nelson@ok-labs.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Hi Damien,<br>
<br>
On 26/02/2008, at 01:27, Damien Schulz wrote:<br>
<br>
</div><div class="Ih2E3d">> is it possible to have IPC directly from OKLinux userland processes<br>
> - no matter if it is a good idea or not? So far I've written a<br>
> procfs module that is able to communicate with OKL4, but I'd like to<br>
> directly use the IDL interface in my user processes.<br>
><br>
> If I understand it correctly, every linux process is started as an<br>
> OKL4 process, so it should be possible anyway. Is there a way to<br>
> simply allow IPC or would that require further changes in the<br>
> OKLinux fork() implementation?<br>
<br>
</div>I'm sorry about the confusion earlier. Let me clarify a few things.<br>
<br>
What I said in the previous email about OKLinux threads being able to<br>
use OKL4 services holds true for OKLinux _kernel_ threads only. There<br>
are 2 threads in this category - called "timer_thread" and<br>
"main_thread". You can find them in kernel-2.6.10-v1/arch/l4/kernel -<br>
take a look in sys_iguana.c and main.c. These 2 threads have their<br>
own L4 space.<br>
<br>
On the other hand, OKLinux _user_ threads runs your Linux userland<br>
processes in a different L4 space from the kernel threads. The<br>
important thing here is that, L4 implements IPC security mechanisms on<br>
a per-L4-address-space basis. While the OKLinux kernel space is given<br>
permission to IPC any thread in other spaces, the OKLinux user space<br>
is not allowed to do so. Therefore, your OKLinux user processes won't<br>
be able to communicate with OKL4 services.<br>
<br>
Now you might be asking why can't you just configure the IPC<br>
permissions so that the OKLinux user space can IPC everyone. The<br>
short answer is that, the OKLinux kernel relies on some invariants on<br>
when and how OKLinux user threads get scheduled. Once you allow<br>
OKLinux user threads to IPC freely, these invariants get violated.<br>
<br>
I hope this answers your question.<br>
<font color="#888888"><br>
Nelson.<br>
</font><div><div></div><div class="Wj3C7c"><br>
<br>
_______________________________________________<br>
Developer mailing list<br>
<a href="mailto:Developer@okl4.org">Developer@okl4.org</a><br>
<a href="https://lists.okl4.org/mailman/listinfo/developer" target="_blank">https://lists.okl4.org/mailman/listinfo/developer</a><br>
</div></div></blockquote></div><br>