Custom implementation of core services

David Werner wernerd at ...389...
Tue Mar 8 22:15:46 CET 2016


Hi Genode-mailing-list,


i have a little problem with my ram and rm custom implementations.


When i try to create a child component which uses my custom 
sessions/services by running the following code:



int main(void)
{
     PDBG("--- start proxy_server ---\n");

     PDBG("--- announcing proxy services --- ");

     Cap_connection cap;

     static Sliced_heap sliced_heap(env()->ram_session(),
                                     env()->rm_session());

     enum { STACK_SIZE = 8*1024 };
     static Rpc_entrypoint ep(&cap, STACK_SIZE, "proxy_ep");

     static Proxy::Prm_root prm_root(&ep, &ep, &sliced_heap);
     PDBG("PRM_root created and back in server-main!");

     static Proxy::Pram_root pram_root(&ep, &ep, &sliced_heap);
     PDBG("PRAM_root created and back in server-main!");

  env()->parent()->announce(ep.manage(&prm_root));
     PDBG("PRM service announced!");

  env()->parent()->announce(ep.manage(&pram_root));
     PDBG("PRAM service announced!");

     PDBG("--- starting test child ---");

     /* Creating session for child environment */

     static Rom_connection rom("proxy_test_client");
     static Pd_connection pd;
     static Proxy::Pram_connection pram; <---------------- custom 
service, execution fails here.
     static Cpu_connection cpu;
     static Proxy::Prm_connection prm;  <---------------- custom service
     static Cap_connection child_cap;

     /* declaring ref account for child's ram session and transferring 
quota */

     enum { CHILD_QUOTA = 1*1024*1024 };
     pram.ref_account(env()->ram_session_cap());
  env()->ram_session()->transfer_quota(pram.ram_cap(), CHILD_QUOTA);

     /* creating test child */

     Test_child proxy_test_child(rom.dataspace(), pd.cap(), pram.cap(), 
cpu.cap(), prm.cap(), &child_cap);

     PDBG("--- proxy_server is going to sleep ---");
     sleep_forever();
     PDBG("Server still awake - This output should not be reached!");

     return 0;
}



I get this output:


Genode 15.11-71-g2e0e767
int main(): --- create local services ---
int main(): --- start init ---
int main(): transferred 112 MB to init
int main(): --- init created, waiting for exit condition ---
[init] Could not open ROM session for module "ld.lib.so"
[init -> proxy_server] int main(): --- start proxy_server ---
[init -> proxy_server] int main(): --- announcing proxy services ---
[init -> proxy_server] 
Proxy::Prm_root::Prm_root(Genode::Rpc_entrypoint*, 
Genode::Rpc_entrypoint*, Genode::Allocator*): Creating Prm_root_component...
[init -> proxy_server] int main(): PRM_root created and back in server-main!
[init -> proxy_server] 
Proxy::Pram_root::Pram_root(Genode::Rpc_entrypoint*, 
Genode::Rpc_entrypoint*, Genode::Allocator*): Creating 
Pram_root_component...
[init -> proxy_server] int main(): PRAM_root created and back in 
server-main!
[init -> proxy_server] int main(): PRM service announced!
[init -> proxy_server] int main(): PRAM service announced!
[init -> proxy_server] int main(): --- starting test child ---
[init -> proxy_server] virtual Proxy::Pram_session_component* 
Proxy::Pram_root::_create_session(const char*): Creating 
Pram_session_component...

KERNEL: Warning: nothing mapped: (Obj_space) from 
[0xfffffffffccfe5d8/38]: 0000000000000237 size: 0000000000000001 to 
[0xfffffffffccfe5d8/38]


Error: Test execution timed out
make: *** [run/proxy] Fehler 254

I have no idea why this may happen. When running a component which is 
started by init and which is no child of my server component opening a

connection to my custom service works perfectly fine.


I'd be very grateful for a little bit of help here.


Best regards,

David




More information about the users mailing list