2

I am trying to write a kernel module which loads upon detection of USB Mouse. I am new to this stuff, I googled for this issue but couldn't find any appropriate solution.

can anyone please explain flow of this?

3

1 Answer 1

0

Very generic question, so very superficial answer:

The USB events bubble up to the part of the kernel that deals with new USB devices. This talks to the part of the kernel that can load modules on demand. This in turn looks for modules with an alias that fit the USB vendor and product id (or other USB fields). It may also make the decision by USB class.

Many USB mice are HID (human interface device) standard USB devices. In that case, the HID layer kicks in, the kernel will read the HID descriptor for the mouse, and interpret the HID events accordingly.

So if you could include information in your question about what kind of USB mouse it is (via lsusb -v), and why it doesn't work with the available drivers, that would be helpful...

1
  • hello @dirkt , What I am asking is, which driver deals with the new USB devices? and how it pops up the device name under /dev directory? Commented May 11, 2020 at 6:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .