contiguous memory blocks and zero copy

Stark, Josef j.stark at tum.de
Thu Oct 9 19:12:34 CEST 2014


Hello,

>How does  L4Re handle contiguous memory blocks? 
>What are the system calls used to allocate and manage contiguous memory? 
>Is it possible to do zero copy data transfer between drivers and if so 
>how is it done in Fiasco (so in linux world you would say no copy_to_user() and copy_from_user() )

I'm not an expert but I would say that can be done by using a Dataspace. If you look into src/l4/pkg/examples/libs/l4re/c++/shared_ds/ you will find an example where two tasks share a block of memory.
Basically, in order to grant both tasks access to the dataspace, you need an IPC-Gate between the two (just like when you do regular IPC). 
Then the client (which wants to get access to the ds of the server) writes an instance of Small_buf, initialised with an allocated dataspace capability, into an Ipc_iostream (see line 38 of interface.h) and then makes an IPC-call to the server. The server writes its dataspace capability into an Ipc_iostream and answers. The kernel then maps the capability to the client, so now both tasks have access to the dataspace.


Josef


More information about the l4-hackers mailing list