Hi Sid,
On 2023-06-27 22:39, Sid Agrawal wrote:
I am trying to setup a scenario where the parent starts a child PD in the C code, i.e., there is no <start> node for the child in the config file. It is similar to the rm_nested test example [1].
But in my scenario, I would like to start a server in the child and have the parent make RPC calls to it, and I need some help setting that up. I think the answer should be in some configuration of the ChildPolicy used to start the child, but I am missing something.
we explored this idea in the past [1] but ultimately disregarded it [2].
[1] https://genode.org/documentation/release-notes/12.02#API_support_for_enslavi... [2] https://github.com/genodelabs/genode/issues/3754
You can still find a trace of it left as part of the qt_avplay component in the genode-world repository [3]. There you can find the slave.h header that implements the mechanism for hosting a service as a child.
[3] https://github.com/genodelabs/genode-world/tree/master/src/app/qt_avplay
For hosting and managing child components, I warmly recommend the use of the sandbox library [4], which is far more flexible while easier to use than the raw child.h interfaces. We plan to replace all manual uses of child.h by the use of the sandbox library eventually.
[4] https://genode.org/documentation/release-notes/20.02#New_sandbox_library_bas...
Any help pointing me in the right direction would be very helpful. Thanks as always!
As a general advice, please try to avoid making a parent depend on a child. It is better to either use an session interface that can be provided by the parent and invoked by the child, or to use a second child to interact with a child service. The latter approach is extensively used by the depot_download_manager, which orchestrates the downloading, verification, extraction, and installation of software in Sculpt OS.
Cheers Norman