Is it possible in linux to register a interrupt ha

2019-08-13 14:28发布

问题:

I am studying about Linux Interrupt handling mechanism, just got doubt whether registering an interrupt handler from user-space is allowed or not?

回答1:

No, interrupts are registered in the kernel and a driver / module must be loaded into kernel space to receive the interrupt. It could pass handling onto a user space daemon that hooks into the kernel module, but the something must be inserted into the kernel.



回答2:

Cannot register user space interrupt handler directly.

Kernel ISR indicates interrupt by writing file / setting register / signalling. User space application polls this and goes on with the appropriate code.

Linux file abstraction is used to connect kernel and user space. This is mostly performed by character devices and ioctl() calls.

https://stackoverflow.com/a/47776006/5349798