LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   kernel user space communication (https://www.linuxquestions.org/questions/linux-kernel-70/kernel-user-space-communication-592494/)

mbm 10-17-2007 08:12 AM

kernel user space communication
 
Hi
I need to know how to communicate between kernel module and userspace application

I found that it is possible to communicate
* using devices /dev/xxx ( open , read, write, clode , ioctl)

* using /proc filesystem

* using netlink

is there another mean of communication especially to notify userspace about event as signal or inotify ?

sundialsvcs 10-17-2007 08:21 PM

The kernel documentation talks a lot about this in various places, and the best way to consider this sort of issue is to browse through the drivers and so-on to see how they do it. (For example, notice how udev communicates with its helper daemon.)

Also consider what might be most useful for your programs. It's very nice when a program can simply do a blocking-read or blocking-write to a "device," because any ol' program can do that. And it's also very easy, on the kernel side of things, to "write something."

The entire notion of the "/proc" and "/sys" filesystems is brilliant, because it lets "any ol' program" retrieve, and set, all sorts of funky information just by reading and writing to "a file."


All times are GMT -5. The time now is 06:20 AM.