Monday, January 16, 2017

Random Thoughts: OSX Kext Patching USB Generic Gamepad

I've been digging up Mac OSX support for my old Vinyson gamepad which is recognized in Linux as the DragonRise Generic USB Gamepad.  From my readings and testing on Linux, I know that the gamepad is recognized as with the Vendor ID 0x0079 and Product ID 0x0006.  Further readings point out that the drivers for Linux is hid-dr.ko (loaded via sudo modprobe hid_dr).

The controller doesn't load on Android because this driver is missing.  On OSX, the driver doesn't exist and according to this post, the com.apple.iokit.IOUSBHIDDriver should about cover it.  Obviously, the posted resource doesn't work right off the bat, but it did let me start reading about OSX drivers.

Apparently, kernel objects in Linux are referred to as kernel extensions in OSX.  They reside on /System/Library/Extensions and inside are kext folders with hardware information on what the drivers load for which vendor, product combination among other things.  Use the kextload binary to force load specific drivers but I think all I need to do is to find the HID driver for OSX and add the vendor, product IDs of mygamepad.  This article on patching Info.plist is pretty handy.

No comments: