50 likes | 170 Vues
This project focuses on the development of a USB card scanner driver that efficiently monitors and scans FSU cards using a USB card reader. The driver generates keystrokes and must be active in the correct textbox at all times. While based on an existing USB keyboard driver, significant modifications were made, especially for implementing the read functionality. The program requires root privileges and depends on outdated usbfs, with challenges regarding USB probe orders and kernel buffer implementations. A special /dev/cardscanner is created for ease of use.
E N D
Patrick Tully Steven Bronson USB Card Scanner Driver
Motivation • Monitors in Majors Lab scan FSU cards using a USB card reader • USB card reader generates keystrokes • Program must have focus at all times, in the correct textbox
Pre-existing Projects • Read from /dev/usb/hiddev • Only works for the USB HID card scanner • Write a userspace program using libusb or PyUSB • Requires root privileges each time • Depends on deprecated (obsolete?) usbfs
Contribution • Used a small part (boilerplate) of the usbkbd driver as a starting point. • Most of the work went into implementing read, which did not exist in usbkbd. • Create /dev/cardscanner that can be opened and read.
Challenges • USB probe order • Determined by module insertion order • Fixed with USB quirks • Kernel circular buffer implementation is not really • Record API makes more sense, but Unix loves byte streams (why pass records when you can design ambiguous grammars?)