Hi, I'm trying to do bare bones process creation without using the Child or Process helper classes (I'm toying around with serialization ideas). I tried to construct something similar to http://genode.org/documentation/architecture/process but I can't seem to get it to work (error = exception base not specified on nova32).
Does anyone have a small code sample in the vain of http://genode.org/documentation/architecture/process ?
Daniel
Hello,
On 30.03.2016 19:16, Daniel Waddington wrote:
I'm trying to do bare bones process creation without using the Child or Process helper classes (I'm toying around with serialization ideas). I tried to construct something similar to http://genode.org/documentation/architecture/process but I can't seem to get it to work (error = exception base not specified on nova32).
Some base-* platforms implement the startup of threads slightly differently than described, e.g. base-foc [0] and base-nova [1]. If you really want to have portable code, you should stay with the thread implementation of the base library as we provide per base-* platform.
Nevertheless - I presume, that you already try to bring up a second thread (in this case the message can be printed) and that you are missing a call to cpu_session->state() (see Thread_base::start in [1]).
The state() call tells core some nova specific information (start/base of exception portal selector for the new thread) in order to successfully start a new thread. The base exception portal selector (sel_exc_base) must not be zero (because the main thread already occupies [0-31]).
Hope it helps,
Alex.
[0] repos/base-nova/src/base/thread/thread_nova.cc [1] repos/base-foc/src/base/thread/thread_start.cc
Hi Daniel,
Does anyone have a small code sample in the vain of http://genode.org/documentation/architecture/process ?
admittedly, the text on the website is not the most current description. Please better take Section 3.5. "Component creation" of the book as reference. It is more elaborate and more precise.
Have you already had a look at the 'Process' constructor? It contains the steps described in the document in an almost verbatim way:
https://github.com/genodelabs/genode/blob/master/repos/base/src/base/process...
Note that this code is used on all kernels except for Linux. The component creation on Linux is special because we have to bootstrap new components via execve and use the kernel's built-in virtual-memory management instead of the RM service of core. You can find the implementation of the 'Process' class for Linux here:
https://github.com/genodelabs/genode/blob/master/repos/base-linux/src/base/p...
As a heads up warning, we may eventually merge the 'Process' class into the 'Child' class in the near future. Unless you have a pressing need to do the low-level creation steps manually (e.g., if you want to load non-ELF binaries), I recommend you to stay with the 'Child' class.
When it comes to the creation of additional threads within the new component, please follow Alex' advise as this procedure largely depends on the underlying kernel.
Cheers Norman
Thanks Norman. I have some more to chew on now. ;)
On Wed, Mar 30, 2016 at 11:14 PM, Norman Feske <norman.feske@...1...
wrote:
Hi Daniel,
Does anyone have a small code sample in the vain of http://genode.org/documentation/architecture/process ?
admittedly, the text on the website is not the most current description. Please better take Section 3.5. "Component creation" of the book as reference. It is more elaborate and more precise.
Have you already had a look at the 'Process' constructor? It contains the steps described in the document in an almost verbatim way:
https://github.com/genodelabs/genode/blob/master/repos/base/src/base/process...
Note that this code is used on all kernels except for Linux. The component creation on Linux is special because we have to bootstrap new components via execve and use the kernel's built-in virtual-memory management instead of the RM service of core. You can find the implementation of the 'Process' class for Linux here:
https://github.com/genodelabs/genode/blob/master/repos/base-linux/src/base/p...
As a heads up warning, we may eventually merge the 'Process' class into the 'Child' class in the near future. Unless you have a pressing need to do the low-level creation steps manually (e.g., if you want to load non-ELF binaries), I recommend you to stay with the 'Child' class.
When it comes to the creation of additional threads within the new component, please follow Alex' advise as this procedure largely depends on the underlying kernel.
Cheers Norman
-- Dr.-Ing. Norman Feske Genode Labs
http://www.genode-labs.com · http://genode.org
Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140 _______________________________________________ genode-main mailing list genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main