Hello Johannes,
On Tue, Mar 13, 2018 at 01:36:09PM +0100, Johannes Kliemann wrote:
I'm currently implementing the IRQ session on base-linux. If I understood the Foundations book correctly interrupts are waiting in a separate thread that locks when it is waiting and continues (and calls the handler) once an interrupt is triggered.
The core-internal implementation depends on the base platform. On NOVA and FOC, the Irq_object (which is a thread) is never started, ie., does not execute an entry function. Other platforms (e.g., OKL4) use the Irq_object thread to implement a interrupt-wait-and-signal loop.
According to this I have implemented a kernel module [1] that triggers interrupts via reads on a device file. The interrupt can be registered via ioctl on the file descriptor and the a blocking read is called that returns once the registered interrupts has been triggered.
I have looked into the implementations of base-nova and base-hw but didn't completely understand it. As far as I understood the session component implements the session and only requires the interrupt number and a signal handler. The Irq_object implements the waiting thread but I didn't see where it is waiting for the interrupt. Also as far as I could see it the actual interrupt capability stays inside the session in core and only the signal handler capability is passed to the component.
I suggest you refer to OKL4
base-okl4/src/core/irq_session_component.cc
and implement an Irq_object working similarly with a entry() function that uses Irq_object::_wait_for_irq() (which blocks in read(dev_fd)) and signals IRQ occurence by Genode::Signal_transmitter(_sig_cap).submit(1)
Is my understanding of this correct? And is there any further documentation on this?
Unfortunately, there's only few documentation of the core internals. To get up-to-date information I suggest looking at the code and asking here or even on Freenode
http://webchat.freenode.net/?randomnick=1&channels=%23genode&uio=d4
Regards