-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
printf("This message is printed\n"); task->map(L4Re::This_task, env->mem_alloc().fpage(), env->mem_alloc().snd_base()); printf("This message is never printed\n");
env->mem_alloc() only gives you the memory allocator. You will have to call env->mem_alloc().alloc() to actually allocate a dataspace. I'm afraid your call hangs, because L4Re tries to translate the .fpage() call into an IPC to the memory allocator, which does not reply because it is no idea what you want from it.
Also, do not call the allocator twice within the function call, because then you would obtain two different dataspaces and this is not what you want here. Better do
L4:Cap<Dataspace> x = L4Re::Util::cap_alloc.allocL4::Dataspace(); long alloc = L4Re::Env::env()->mem_alloc.alloc(size, x); if (!x.is_valid()) { // handle error }
Do I need to set up the UTCB beforehand or do some other kind of setup before mapping capabilities?
No.
Bjoern