Hi,
I want to launch multiple Genode processes. One obvious way is to take advantage of init process. But it seems like all these init-created processes will share the same RM session (provided by Core) and hence the same pager. To allow each process to have its own region map, shall I write my own launching process or modify init ? Thanks.
Best,
Chen
After looking at some examples and config files, I don't think I have a good understanding on how Genode launches multiple applications, especially the use of function env(), which returns the environment of the creating process. Is that true that all applications launched by init currently have the same RM/RAM session? Even so, each application should have its own region map and pager, right? I launched two applications, but the kernel debugger shows that only one pager exists except core.pager. Please help me understand this.
Thanks,
Chen
From: Chen Tian - SISA [mailto:chen.tian@...58...] Sent: Tuesday, June 14, 2011 10:21 AM To: Genode OS Framework Mailing List Subject: Create multiple processes.
Hi,
I want to launch multiple Genode processes. One obvious way is to take advantage of init process. But it seems like all these init-created processes will share the same RM session (provided by Core) and hence the same pager. To allow each process to have its own region map, shall I write my own launching process or modify init ? Thanks.
Best,
Chen
Hi Chen,
the creating process. Is that true that all applications launched by init currently have the same RM/RAM session? Even so, each application should have its own region map and pager, right? I launched two applications, but the kernel debugger shows that only one pager exists except core.pager. Please help me understand this.
each process has a distinct RAM, CPU, and RM session, created by its parent process. The procedure of process creation is described here:
http://genode.org/documentation/architecture/process
Speaking of the init process, the child's RM, CPU, and RM sessions are created when the 'Child' class is constructed ('see os/include/init/child.h'). In the 'Child' class, you find the '_resources' member, which is a compound object comprised of a 'Ram_connection', a 'Cpu_connection', and a 'Rm_connection'. These connection objects represent an open session each. The session capabilities of these sessions are then passed to the 'Process' constructor, which performs the procedure as described in the document above.
On most base platforms including Fiasco.OC, Genode uses one pager thread (called pager activation) for all user threads. Each time a page fault occurs (regardless of which thread caused the page fault), the pager activation thread within core receives the page fault information from the kernel, looks up a page-fault resolution via the code in 'rm_session_component.cc', and installs a mapping if possible. Please note that the core.pager thread you have just observed in the kernel debugger handles page faults for core only. It does not deal with normal user-level threads.
BTW, using a global pager thread is not an inherent property of Genode. For example on NOVA, each user thread has a distinct pager thread within core. As another example, L4Linux running on Fiasco.OC acts as pager for the Linux user-level programs. OKLinux on OKL4 functions similarly. On an MP system, it would possibly be sensible to have one pager thread per CPU.
Best regards Norman
Thanks for the reply.
I printed "env()", "env->ram_session()" and "env()->rm_session()" of core, init, and another three apps: test-timer, myapp1 and myapp2. I don't understand why I get the same set of values for myapp1 and myapp2? The sets of value for others are different.
Best, Chen
-----Original Message----- From: Norman Feske [mailto:norman.feske@...1...] Sent: Wednesday, June 15, 2011 1:18 AM To: genode-main@lists.sourceforge.net Subject: Re: Create multiple processes.
Hi Chen,
the creating process. Is that true that all applications launched by init currently have the same RM/RAM session? Even so, each application should have its own region map and pager, right? I launched two applications, but the kernel debugger shows that only one pager exists except core.pager. Please help me understand this.
each process has a distinct RAM, CPU, and RM session, created by its parent process. The procedure of process creation is described here:
http://genode.org/documentation/architecture/process
Speaking of the init process, the child's RM, CPU, and RM sessions are created when the 'Child' class is constructed ('see os/include/init/child.h'). In the 'Child' class, you find the '_resources' member, which is a compound object comprised of a 'Ram_connection', a 'Cpu_connection', and a 'Rm_connection'. These connection objects represent an open session each. The session capabilities of these sessions are then passed to the 'Process' constructor, which performs the procedure as described in the document above.
On most base platforms including Fiasco.OC, Genode uses one pager thread (called pager activation) for all user threads. Each time a page fault occurs (regardless of which thread caused the page fault), the pager activation thread within core receives the page fault information from the kernel, looks up a page-fault resolution via the code in 'rm_session_component.cc', and installs a mapping if possible. Please note that the core.pager thread you have just observed in the kernel debugger handles page faults for core only. It does not deal with normal user-level threads.
BTW, using a global pager thread is not an inherent property of Genode. For example on NOVA, each user thread has a distinct pager thread within core. As another example, L4Linux running on Fiasco.OC acts as pager for the Linux user-level programs. OKLinux on OKL4 functions similarly. On an MP system, it would possibly be sensible to have one pager thread per CPU.
Best regards Norman
Hi Chen,
I do not quite understand what you mean with "print". Are you referring to the pointers returned by said functions? If yes, what information do you expect to gain from these local address values? The 'env()' function returns a local object that represents the environment of the process as created by the parent. The object is normally located within the BSS segment of the program. See the implementation of the 'env()' function at ' base/src/base/env/env.cc'. The class implementing the 'Env' interface can be found here: 'base/include/base/platform_env.h'.
When 'env()' is called for the first time, the single 'Platform_env' object is constructed ('_env' is a local static variable of 'env()'). Upon construction, 'Platform_env' requests the process's CPU, RAM, RM, and PD session from the parent interface by specifying the corresponding service names prefixed with "Env::" as argument to the 'parent()->session()' call. At the parent side, these session requests are especially handled. See 'base/include/base/child.h'. This way, the child process retrieves the environment information from its parent. In the 'Child' class, you can see that for these "Env::" sessions, the parent returns capabilities taken from the local 'Child' object context.
Best regards Norman
On 06/16/2011 02:57 AM, Chen Tian - SISA wrote:
Thanks for the reply.
I printed "env()", "env->ram_session()" and "env()->rm_session()" of core, init, and another three apps: test-timer, myapp1 and myapp2. I don't understand why I get the same set of values for myapp1 and myapp2? The sets of value for others are different.
Best, Chen
Hi Norman,
Thanks for the clarification.
Best, Chen
-----Original Message---- From: Norman Feske [mailto:norman.feske@...1...] Sent: Thursday, June 16, 2011 1:43 AM To: genode-main@lists.sourceforge.net Subject: Re: Create multiple processes.
Hi Chen,
I do not quite understand what you mean with "print". Are you referring to the pointers returned by said functions? If yes, what information do you expect to gain from these local address values? The 'env()' function returns a local object that represents the environment of the process as created by the parent. The object is normally located within the BSS segment of the program. See the implementation of the 'env()' function at ' base/src/base/env/env.cc'. The class implementing the 'Env' interface can be found here: 'base/include/base/platform_env.h'.
When 'env()' is called for the first time, the single 'Platform_env' object is constructed ('_env' is a local static variable of 'env()'). Upon construction, 'Platform_env' requests the process's CPU, RAM, RM, and PD session from the parent interface by specifying the corresponding service names prefixed with "Env::" as argument to the 'parent()->session()' call. At the parent side, these session requests are especially handled. See 'base/include/base/child.h'. This way, the child process retrieves the environment information from its parent. In the 'Child' class, you can see that for these "Env::" sessions, the parent returns capabilities taken from the local 'Child' object context.
Best regards Norman
On 06/16/2011 02:57 AM, Chen Tian - SISA wrote:
Thanks for the reply.
I printed "env()", "env->ram_session()" and "env()->rm_session()" of core, init, and another three apps: test-timer, myapp1 and myapp2. I don't understand why I get the same set of values for myapp1 and myapp2? The sets of value for others are different.
Best, Chen