1

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

Ravi Chandra
  • 1,749
  • 4
  • 13
  • 22
  • Ignoring whether it's allowed or not, I think it's a bad idea. Why would/should a userspace program ever need to know details about the kernel? – tangrs Mar 14 '13 at 11:25

2 Answers2

3

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.

Jeff Ferland
  • 17,832
  • 7
  • 46
  • 76
1

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

renonsz
  • 571
  • 1
  • 4
  • 17