0

I have a very simple (I think) problem. I have a very simple kernel module, which handling an interrupt coming from my hardware (its all described in my device tree). I get the interrupt in kernel. Now I want to send a message (just 64 Bit, two uint32_t) to a program in user space. It will also be ok if I can "wake" up my program (there are serveral threads in there, so one thread could sleep until it will woke up by kernel module).

My problem is: What is the easiest and clearest solution? I read about netlink, using the proc filesystem, but

  • either I cannot find some clear examples out there
  • the messageing is only from user to kernel space
  • examples are outdated for the kernel I use (4.4).

Does anybody have a very clear example or a how to do such things?

P.S. I don't want to handle all the things following on the interrupt in kernel space. It's ok if some messages getted lost.

Sun
  • 1,505
  • 17
  • 25
alabamajack
  • 642
  • 8
  • 23
  • For messaging about interrupts to user space, you can use `poll()`. See [this](http://stackoverflow.com/questions/30035776/how-to-add-poll-function-to-the-kernel-module-code) and [this](http://stackoverflow.com/questions/34027366/implementing-poll-in-a-linux-kernel-module) for details on how to implement it. – Sam Protsenko Mar 24 '17 at 09:35
  • `poll()` is step two; the first step is `/dev/MyLittleDevice` that the user-space program can open and try to read from. – CL. Mar 25 '17 at 19:20

0 Answers0