Task creation in ned or moe

Tobias Stumpf tstumpf at os.inf.tu-dresden.de
Thu Jul 31 14:53:26 CEST 2014


Hi,

On Thu, 2014-07-31 at 09:09 +0000, Stark, Josef wrote:
> Hello,
> 
> could maybe someone kindly explain to me (roughly), how task creation/startup is done in ned or moe? I assumed that the Factory methods create_task() and create_thread() would be used, but instead it seems that Elf_Loader is used for this. I skimmed through this class but I don't fully understand it. Basically, it seems that moe's call "elf_loader.start(_init_prog, cxx::String(""));" (in file main.cc) leads in the end to this call: "Ldr::Elf_loader<Moe_x_app_model, Dbg>::launch(&am, "rom/l4re", ldr);" (loader_elf.cc). So, to me it seems that just l4re gets started, not the desired binary (ned), but clearly I am missing something (a lot) here (because it actually works the way it should). Could someone enlighten me here?
> And why aren't create_task() and create_thread() used here?

You have two options to start an application. For instance, you can use
the following line in your module.list to start the hello world example
without using ned. 
	roottask moe --init=rom/hello

Without the init parameter moe starts ned and ned sets up the
environment for your applications. 

After compiling your application you get an elf binary. Before you can
start an application you have to do some setup (e.g. create the stack
and push the program arguments). The elf loader extract the data from
your elf binary, makes the necessary setup and starts your application.
If you would like to unterstand application start up in detail look into
the libloader package, which is used from ned and moe.


Best regards,
Tobias





More information about the l4-hackers mailing list