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? (In this text I am referring to moe, but in ned I couldn't find these two methods either.) Thanks in advance!
Josef
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
l4-hackers@os.inf.tu-dresden.de