NOTICE: THIS CODE is not working. I am not sure what changed in recent times. but this project doesn't work.
Implementation of linux USB keyboard driver for Even sem evaluation. Major code has been inspired from linux kernel USB keyboard driver.
Main code is in usb-part/
sudo make
sudo insmod usbkbd.ko
Generally this will not work cause the inbuilt module will always be called first by the usbcore. So to make it work. Install libhid module on your linux PC. By installing libhid, You will also automatically install a programme named
libhid-detach-device
and then its all easy-peasy, type the following commands
sudo libhid-detach-device [VENDOR ID]:[PRODUCT ID]
sudo insmod usbkbd.ko [remove it first if you already inserted the driver first and insert it again]
Done
Type to your heart's content.. :D
- Prevent autoloading of other modules/drivers
- Linux-USB HID configuratiion
- Essential stuff stated in kernel
- How to find the name of your device
- Some functions explained in usbkbd.c
- Map a keyboard
- Use 'sudo modprobe usbmon' and then wireshark to monitor 'usbmon/usbmon0' to capture USB request block for better understanding
- Insert print statemnets in the usbkbd.c code to print the scancode of the key as it is pressed. THIS WILL GREATLY HELP YOU TO MAP THE KEYBOARD.
- Use a USB keyboard if its not obvious by this point, Because if you tamper with your original PC keyboard which is driven by atkbd.c in the kernel you will have to reinstall the whole kernel via SSh (belive me you don't want that headache if you are on a deadline/or use a virtual machine[lol])
If you have any questions hit me up in issues.