Callback function from kernel module

Bernd Petrovitsch bernd at petrovitsch.priv.at
Wed Nov 7 10:00:34 EST 2012


Hi!

On Sam, 2012-11-03 at 19:14 +0530, Jeshwanth Kumar N K Jeshu wrote:
[...]
> Can I call userspace function from kernel module ? Actually I need to
> process some data in user space for every event occured in kernel module.

The usual way to implement this with a character device. The userspace
application opens the character device. It then read()s the events from
it, handles it and write()s results back (if needed).
The kernel part handles to IRQs, puts that into a buffer where it waits
for the read() from user space.

You can use netlink sockets for this which may save some code though or
implement a character device directly.

Kind regards,
	Bernd
-- 
Bernd Petrovitsch                  Email : bernd at petrovitsch.priv.at
                     LUGA : http://www.luga.at




More information about the Kernelnewbies mailing list