Hi,
I tried to create a provide an input session from a libc (in this case an Qt application). If I just run it from the Main struct it will correctly announce the session but since Main never returns, no client will be able to use it. I tried to circumvent this by putting the application into a separate thread but this led to the following error:
Error: void Libc::Kernel::run(Libc::Application_code&) called from non-kernel context
Running this Qt application without wrapping it into with_libc makes it segfault on initialization.
What is the correct way to do this? My current main is at [1].
Regards, Johannes
[1]: https://github.com/jklmnn/componolit/blob/478490f05f23ce4c64b4a386377a1212cb...
Hello Johannes,
On Mon, Oct 16, 2017 at 01:42:04PM +0200, Johannes Kliemann wrote:
I tried to create a provide an input session from a libc (in this case an Qt application). If I just run it from the Main struct it will correctly announce the session but since Main never returns, no client will be able to use it. I tried to circumvent this by putting the application into a separate thread but this led to the following error:
Error: void Libc::Kernel::run(Libc::Application_code&) called from non-kernel context
Running this Qt application without wrapping it into with_libc makes it segfault on initialization.
What is the correct way to do this? My current main is at [1].
Unfortunately, there is no "correct" way of implementing tasks like the described currently. I must admit that with_libc() is the most confusing function in Genode currently and we therefore will remove it from the API soon. In fact, I myself did not expect that with_libc() is needed in your context but there may be dependencies unknown to me.
I'd suggest a careful look into libports/src/app/avplay which provides an input session too. The approach there is to create a second Genode entrypoint for the input service and execute Qt code in the component thread. I strongly encourage you not just to copy the avplay code as it uses the older, low-level Rpc_entrypoint but use Genode::Entrypoint.
Greets