Alex Rivera | Logout

How to communicate with a Linux kernel module from user space without littering /dev with new nodes?

Asked 2010-05-25T09:51:50.983
12

What are the ways to communicate with a kernel module from user space? By communication i mean sending information and commands between the kernel module and a user space process.

I currently know of two way:

  1. open/close/read/write/ioctl on published device node.
  2. read/write on exported and hooked /proc file.

More specifically, can someone advice the best way to communicate with a kernel module that does not actually drives any hardware and therefore should not be littering /dev with stub nodes that exists solely for ioctl calls? I mostly need to check its various status variables and send it a block of data with a request type tag and see if the request succeeded.

Edit
Report

1 Answer

9

There's also the /sys filesystem (sysfs):

Sysfs exports information about devices and drivers from the kernel device model to userspace, and is also used for configuration.

(from Wikipedia)

answered 2010-05-25T10:12:33.410

Your Answer