Linux IO_MEM session

Johannes Kliemann kliemann at ...543...
Tue Jan 16 16:48:43 CET 2018


Hi all,

I'm currently implementing a IO_MEM session for base-linux. The basic
idea is as follows:

 - core opens a file in /dev/ and calls an ioctl on the file to set a
memory range.
 - it passes this file descriptor to the child process that requested
the session
 - the child process mmaps the requested memory range from the file
descriptor

The required device on Linux is already available (if you're interested,
I've written a kernel module to provide it in [1]) so that isn't the
problem.
I tried to implement the IO_MEM session on base-linux but lack the
understanding of how the Linux_dataspace and the Io_mem_dataspace are
different. On base the Io_mem_session_component gets the dataspace
capability from

> _ds_cap = static_cap_cast<Io_mem_dataspace>(_ds_ep->manage(&_ds));

This doesn't work with base-linux since I can't cast the Linux_dataspace
to Io_mem_dataspace. Yet I don't understand what I need to do this.

I also didn't find out what parts of the session are executed in which
context (speaking what runs in core and what in the component itself),
especially where I would put the actual mmap call.

My current implementation of the IO_MEM session is at [2] and [3].

Regards,
Johannes

[1]: https://github.com/jklmnn/hwiodev
[2]:
https://github.com/jklmnn/genode/blob/0cfcec98ad4d4fdfc7bf6cc6e6df3567360b4e9c/repos/base-linux/src/core/include/io_mem_session_component.h
[3]:
https://github.com/jklmnn/genode/blob/0cfcec98ad4d4fdfc7bf6cc6e6df3567360b4e9c/repos/base-linux/src/core/io_mem_session_component.cc




More information about the users mailing list