views:

47

answers:

1

I am a new comer to Linux Kernel Module programming. From the material that I have read so far, I have found that there are 3 ways for a user program to request services or to communicate with a Linux Kernel Module

  1. a device file in /dev
  2. a file in /proc file system
  3. ioctl() call

Question: What other options do we have for communication between user program and linux kernel module?

+2  A: 

Your option 3) is really a sub-option of option 1) - ioctl() is one way of interacting with a device file (read() and write() being the usual ways).

Two other ways worth considering are:

  • The sysfs filesystem;
  • Netlink sockets.
caf
Netlink sockets look promising but haven't been able to find a working example which uses netlink sockets. Managed to write my own but still lot of questions unanswered.
binW