Running a task without region manager

Björn Döbel doebel at
Sat Mar 14 17:49:11 CET 2015

Hash: SHA1


> Ned, file, line 408:  '_l.launch(&am, "rom/l4re",
> ldr);': What would happen, if the second argument ("rom/l4re") was
> replaced by a variable holding the actual binary name that should
> be started (e.g. "rom/hello"), which thus would be started without
> l4re?

To recap, what normally happens is:

* Ned (the loader) creates a new task
* Ned creates a new thread, adds it to this new task makes it execute
  the L4Re kernel binary
* The L4Re kernel thread's pager is inherited from Ned, so it is usually
* The newly created L4Re kernel thread then creates a second thread
  inside the new task which runs your application code.
* The L4Re kernel thread becomes the page fault and exception handler
  for every other thread in the application.

If you replaced this line and directly launched your binary, I
*believe* this would work in the first place. Ned would load your
binary and launch a thread executing it inside the new task.

There are a couple of things to remember, though:

* Your program should (obviously) not assume that there is an L4Re
  kernel thread running inside its AS. That is, you cannot use
  features such as having multiple data space providers for different
  parts of your memory as this is a feature provided by L4Re, but not
  by Moe.

* You *might* run into troubles with all kinds of libraries as they
  might behind your back rely on local region management, too.

But as long as your binary only uses L4 syscalls directly and
carefully manages its own resources, this should be ok.

As a test, here's what I did: I modified the line above to say

_l.launch(&am, "rom/hello", ldr);

, rebuilt ned and launched it in Qemu. As expected, hello world was
loaded and executed.

Version: GnuPG v1


More information about the l4-hackers mailing list