Genode region mapper

Valery V. Sedletski _valerius at ...73...
Fri Jan 19 18:57:16 CET 2018


Hi, I'm now trying to port my L4Env-based program to Genode. It is a 
runtime environment to run OS/2 programs on a L4 family microkernel 
(Inspired by OS/2 Warp, PowerPC edition/IBM Workplace OS). Currently, 
the working version (actually, some proof-of-concept) is running under 
L4Env, but I plan to port it to Genode and L4Re (and maybe, to WinNT 
native/ReactOS in the future).

For porting purposes, I need to have some region-mapper functionality, 
like 1) reserve a virtual memory region in the region map, so that it 
will avoid attaching dataspaces over this region, unless an explicit 
attachment address is specified; 2) lookup an address in the region 
mapper, i.e., determine, is this address free, reserved, or some 
dataspace is attached here, and if so, at which address/offset and which 
size.

For implementing the memory management functions, this is needed to 
reserve a virtual memory block, for subsequent committing 
pages/attaching dataspaces in that region, step by step.

As I looked at the Genode::Region_map interface, I don't see such 
functions in that class. Though, I found some memory-range allocation 
routines in the Genode::Range_allocator class, but I'm not sure if this 
is what I need. Is there some functionality related to reserving 
regions/looking up addresses implemented elsewhere, or I need to 
implement such functionality myself?

Also, a required feature is multiple memory areas support in the region 
mapper. I need at least, two memory areas, a private one, and a shared 
one. A private area start at the beginning of the address space. It is 
private to any user-mode program. A shared area starts at some higher 
address, and it is common for all usermode programs (using my runtime 
environment). So, it is a global shared memory started at the same 
address, and each shared memory region is mapped at the same address in 
all client address spaces. It is used for shared memory IPC,  as well as 
for loading DLL's. DLL's are shared between different usermode programs, 
unlike Windows DLL's or Unix SO's.

So, I need to allocate memory ranges in specific (private or shared) 
areas. This could be implemented via my own memory manager with its own 
accounting. But maybe, there is an already implemented functionality, 
like this? L4Env region mapper has support for multiple memory areas, as 
well as a possibility to lookup an address, or to attach a pointer to a 
user-defined structure, to an address. So, I can attach my own data 
related to that address/region. Is there a functionality like this 
implemented in Genode?

I also know, that there is a support for managed dataspaces, or nested 
region maps, which could be useful here (at least, for implementing a 
shared memory area), but I also know, that nested region maps are not 
supported on all platforms (like Genode/Linux). So, it would be, 
possibly, better to avoid using them, unless really needed.

WBR,

valery






More information about the users mailing list