L4Linux and L4Re communication
Björn Döbel
doebel at os.inf.tu-dresden.de
Fri Apr 25 11:10:39 CEST 2014
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 25.04.2014 10:24, Irvanda Kurniadi wrote:
> On Fri, Apr 25, 2014 at 4:24 PM, Björn Döbel
> <doebel at os.inf.tu-dresden.de <mailto:doebel at os.inf.tu-dresden.de>>
> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>
> Hi,
>
>> In term of running hello world in L4Linux, I can run it by
>> passing -m32 -static in the compilation process. But, now I'm
>> having a problem in running the mpi-based application on L4Linux
>> which this apps needs the mpi library to be able to run. I have
>> ported the mpi library and run the apps over L4Re by using Ned.
>> So, based on the explanation above, I don't understand how to run
>> the mpi-based program on top L4Linux in which the L4Linux
>> definitely doesn't have mpi-library because the mpi-library is
>> existed in L4Re. Is it like this, the l4linux kernel needs the
>> device driver to communicate with external L4 apps (in my case
>> mpi-base apps), then to trigger the communication we should make
>> the kernel module (linux program to talk to the l4linux kernel).
>> Am I right? Can you point one example, which is similar with my
>> case, that can be followed by me?
>
> I see two different scenarios here:
>
>
> 1. Your MPI application is supposed to run as a Linux application
> in L4Linux - -> In this case all you need is an MPI library
> installed in the Linux distribution that you boot L4Linux into.
> E.g., if you are using some custom ramdisk, simply add a (Linux)
> MPI library to this disk and your program will then use it. No L4
> magic necessary at all.
>
>
> 2. Your MPI application is supposed to run directly on L4Re - -> In
> this case you don't need any Linux or L4Linux in the setup. You
> build your L4Re program and link it with your ported MPI library
> and then it should run.
>
> Does that answer your question or am I missing your point?
>
>
> Yes it does. In my case I think I only need to run my application
> on L4linux, but since the beginning I misunderstood that I have to
> port the library on L4. I have wasted so much time in doing
> scenario 2.
Sorry to hear that.
> What is the differences between running application over L4linux
> and running application as a task in L4Re?
Good question. Let me try to explain from bottom up.
1. It all starts with Fiasco.OC, our microkernel. Fiasco runs directly
on the hardware in the CPU's privileged mode. It provides kernel
mechanisms, such as threads, tasks, inter-process communication and
scheduling.
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
+-------------+ Privileged CPU Mode
| Fiasco.OC |
+-------------+
2. On top of Fiasco.OC we have the L4 Runtime Environment. L4Re is
a set of libraries and applications that run in non-privileged
(aka "user") mode and implement basic operating system services,
such as memory management, device drivers etc.
+------------------------+
| L4 Runtime Environment | Non-privileged
+------------------------+ CPU mode
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
+-------------+ Privileged CPU Mode
| Fiasco.OC |
+-------------+
3. On top of L4Re you are free to implement your own software using
L4Re's and Fiasco's primitives. This is where scenario #2 (MPI on
L4Re) comes in.
+-----------------+ +---------------------+
| MPI Application | | Another Application |
+-----------------+ +---------------------+
+------------------------+
| L4 Runtime Environment | Non-privileged
+------------------------+ CPU mode
- - - - - - - - - - - - - - - - - - - - - - - - - - -
+-------------+ Privileged CPU Mode
| Fiasco.OC |
+-------------+
In contrast to Linux this is a completely different operating system.
You mostly don't see that because L4Re provides you with interfaces
that are similar to Linux (e.g., a POSIX C library, a virtual file
system etc.).
With respect to MPI the difference here is that you have to adapt any
kind of load balancing, process distribution etc. to use the
respective Fiasco and L4Re services.
4. Now we have a special usage scenario: We can slightly adapt the
Linux kernel and run it as an application on top of L4Re. This is
called L4Linux and the approach is what we call virtualization.
+----------------+
| L4Linux Kernel |
+----------------+
+------------------------+
| L4 Runtime Environment | Non-privileged
+------------------------+ CPU mode
- - - - - - - - - - - - - - - - - - - - - - - - - - -
+-------------+ Privileged CPU Mode
| Fiasco.OC |
+-------------+
5. A single (L4)Linux kernel does not help you very much, because you
want to run applications on top of Linux. Here the virtualization
magic steps in and as a result you can run standard Linux
applications on top of L4Linux without the need for any modification.
Technically, these applications are L4 applications with the
difference that their system calls are not sent to the Fiasco kernel
but to the L4Linux kernel.
The combination of the L4Linux kernel and all Linux applications
running on top of it is what we call a virtual machine (VM).
Linux VM
..............................
. +-------------------+ .
. | Linux Application | .
. +-------------------+ .
. +----------------+ .
. | L4Linux Kernel | .
. +----------------+ .
..............................
+------------------------+
| L4 Runtime Environment | Non-privileged
+------------------------+ CPU mode
- - - - - - - - - - - - - - - - - - - - - - - - - - -
+-------------+ Privileged CPU Mode
| Fiasco.OC |
+-------------+
This setup is how scenario #1 works. Your Linux MPI application
believes it is running on a real Linux kernel and Fiasco's
virtualization makes sure that everything works as expected.
Kind regards,
Bjoern
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/
iEYEARECAAYFAlNaJo8ACgkQP5ijxgQLUNmSfgCgkQUPRGJ/Vyq0DIQkEi/Dm9+2
gAcAnRdS9hHkIIp9qBYCfHHL1+Uuy2Fi
=zFBP
-----END PGP SIGNATURE-----
More information about the l4-hackers
mailing list