Hi Norman,
Am 26.05.2010 16:19, schrieb Norman Feske:
Hi Steffen,
during startup of the init task, the init thread tries to get an "Env::rm_session" from core. Core responds by giving it a capability with local_name() == 0, which is invalid in my context. The cap is returned from _process.rm_session_cap(), which is implemented in process.h: Rm_session_capability rm_session_cap() const {return _rm.cap(); } _rm is defined as Rm_connection in class Process. I am unsure however, which Constructor belongs to to Rm_connection, and why it sets the capability to zero. Can you help me by pointing me to the right spots?
The 'Env::rm_session' is the RM session managing the address space of the process. It is created by the parent (in your case, core) at construction time of the 'Child' object. The RM session is created via core's 'env()->parent()->session()', which is directed to the core-local 'Core_parent::session()' function (in 'core/main.cc'). For checking if the constuction of init's RM session succeeded, I recommend you to instrument the '_create_session' function in 'core/include/rm_root.h' and the 'Core_parent::session()' function. Check for the capabilities returned by 'ls->root()->session(args)'.
Thank you. I created the following trace:
int main(): --- start init --- int main(): Ok we have 231 MB transfered to init virtual Genode::Session_capability Genode::Core_parent::session(const char*, const char*): service_name="RM" cap.cap()=9000 cap.local_name=16 virtual Genode::Session_capability Genode::Core_parent::session(const char*, const char*): service_name="PD" cap.cap()=9000 cap.local_name=18
Both capabilities are valid in this context.
Genode::Process::Process(Genode::Dataspace_capability, \ Genode::Ram_session_capability, Genode::Cpu_session_capability,\ Genode::Parent_capability, const char*, char* const*):\ name="init" rm_session_cap().cap()=9000\ rm_session_cap().local_name()=16
So after the Process::Process ran, _process->rm_session_cap() should return the correct capabilities... Lets see:
virtual Genode::Session_capability Genode::Child::session(const char*, const char*): _ram_session_cap.cap()=9000 local_name=7
virtual int Genode::Parent_server::dispatch(int, Genode::Ipc_istream&, Genode::Ipc_ostream&): server name="Env::ram_session" args="" cap()=9000 local_name=7
Ok, worked for the ram_session.
virtual Genode::Session_capability Genode::Child::session(const char*, const char*): _cpu_session_cap.cap()=9000 local_name=10
virtual int Genode::Parent_server::dispatch(int, Genode::Ipc_istream&, Genode::Ipc_ostream&): server name="Env::cpu_session" args="" cap()=9000 local_name=10
Ok, worked for the cpu_session as well.
virtual Genode::Session_capability Genode::Child::session(const char*, const char*): _process.rm_session_cap().cap()=0 local_name=0
virtual int Genode::Parent_server::dispatch(int, Genode::Ipc_istream&, Genode::Ipc_ostream&): server name="Env::rm_session" args="" cap()=0 local_name=0
Did not work for the rm_session. Do you have any ideas?
Many thanks, Steffen