If a have a /dev device node and its major/minor numbers how do i know the kernel module name that exported this node?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Short answer :
Each device is generally associated with a driver, and this is all what the “device model” is about. The
sysfsfilesystem contains a representation of this devices and their associated driver. Unfortuantely, it seems not all sysfs have a representation of the device nodes, so this applyd only if your /sys directory contains a /dev directory.Let’s take an example, with
/dev/video0On my board,
ls -al /dev/video0output isSo major number is 81 and minor number is 0.
Let’s dive into sysfs :
The
sys/devdirectory contains entry for the char and block devices of the system :What the hell are this links with strange names ?
Remember the major and minor number, 81 and 0 ?
Let’s follow this link :
Now we can see that this device nod, which is how the device is presented to userspace, is associated with a kernel device. This association is made through a link. If we follow this link, we end up in a directory, with a driver link. The name of the driver is usually the name of the module :
So here the name of the module is vpfe_capture