Ubuntu: Creating/Editing the mouse driver [closed]


I am doing a project in the field of embedded systems and the project that i am working on is about making a new HUMAN INTERFERENCE DEVICE(HID) which will be connected thorough usb port. The working of the device will be same as an optical mouse. As i am trying to make a new device either i have to make a new device driver or edit the current mouse driver in such a way that my device gets recognized and works according to the requirement. I need the assistance either in creating a new driver or editing the present one. NOTE: i am new person and i dont know anything about coding, so please make it simple while explaining.

Thank you in advance! :)


Writing a device driver is not an easy thing that can be accomplished with a few hints. Kernel programming is very different from user space programming and you should be prepared to learn a lot.

So in my opinion you have two ways to proceed:

  1. You should start with a very strong C language knowledge in user space. Without being proficient at C even starting looking at kernel programming is a loss of time. After that, start from kernelnewbies doc page, buy a good book about kernel programming and study it.

  2. Circumvent the thing; study the USB HID device specification and design your device so that it seems a keyboard, or a mouse, or a tablet to the kernel. It will then use the standard HID drivers and you do not need to write a single line of code (this is the way the presentation pointers/remote controls work; Linux thinks they are additional keyboards and you do not need any driver).

Go at http://kernelnewbies.org/ and look around there to start with kernel hacking.

The sources of the HID drivers in kernel are browsable online, to get a taste of what is needed: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/hid

Sylvain-Pineau has posted as a comment a very useful link to the documentation for HID devices in the kernel.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »