Mapping memory into process address space

Noah Zentzis nzentzis at
Thu Aug 14 10:22:31 CEST 2014


I don't want to use libloader because I'm trying to create a new process
with dynamically-generated assembly (and alter it while the process is
running), so I can't really output an ELF binary.

On 08/18/2014 08:50, Björn Döbel wrote:

> The dataspace that prog_attach_ds() is called with is allocated by the
> ELF loader in libloader/include/elf.
> reserve_utcb_area() is supposed to not attach a real dataspace but
> reserve a virtual memory area that will not be used by the new
> application's RM to attach any other memory, because this is where the
> UTCBs will later be mapped to by the kernel iirc.

I'm pretty sure I need to do this myself, since any calls to map() are
causing the program to freeze (could this be because the task doesn't
have its UTCB allocated yet?). I'm also not sure what to use for the
destination offset of the L4::Task::map() call, so that might be the

> At this point your best way to do so is
> to use the L4::Task::map() operation on the capability of your newly
> created task.

How do I specify what point in the target the memory maps to? It looks
like the L4::Dataspace::map() would work, but without being able to map
the capability, I can't really check.


- Noah Zentzis

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the l4-hackers mailing list