Mapping memory into process address space

Björn Döbel doebel at os.inf.tu-dresden.de
Tue Aug 19 15:01:02 CEST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>> 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.alloc<L4::Dataspace>(); long alloc =
>> L4Re::Env::env()->mem_alloc.alloc(size, x); if (!x.is_valid()) { 
>> // handle error }
> 
> Okay, I've gotten the allocation of the dataspace to work correctly
> (at least as far as I can tell), but I'm still not sure how to map
> the resulting dataspace into the newly created process. I'm trying
> something like this:
> 
> L4::Cap<Dataspace> stack =
> L4Re::Util::cap_alloc.alloc<L4::Dataspace>(); <  allocate memory
> > task->map(L4Re::This_task, stack.fpage(), 0);
> 
> but it still freezes. Is the fpage() call still waiting on IPC, or 
> should I be using a different value for snd_base?

The snd_base parameter to the map() call is the address in the target
address space. Nevertheless, I'm wondering while this would hang. Are
you sure this happens in the map() operation?

Bjoern
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iEYEARECAAYFAlPzSo4ACgkQP5ijxgQLUNmVHACfYrqIXq5opXk2e2nzac6fe3AB
a10AnitnVNIpOIBPQOhqV1RGMD7j5Z5K
=xWcr
-----END PGP SIGNATURE-----




More information about the l4-hackers mailing list