r/osx • u/Saikyun • Aug 09 '17
OSX driver development
Hello!
I am trying to write a driver for a tablet-like hardware, so that it can function as a mouse. I've tried reading about IOkit, but documentation seems sparse. I've googled around but the only useful thing I could find was some sample code which allowed me to notice when the device was plugged in. But I can't find out how to read data from the device. I'd just like to somehow do this: int data = readRawData(packageLength); or something.
Any help would be greatly appreciated.
12
Upvotes
3
u/gewgwegweegw Aug 09 '17
Yeah, you probably should be posting at Stack Exchange. https://apple.stackexchange.com
2
u/hokanst Aug 10 '17
It sounds like your trying to write a .kext (kernel extension) file so you should probably look at the Kernel Programing Guide assuming that you haven't done so already.
1
u/andy-blue Aug 10 '17
https://developer.apple.com/library/content/documentation/DeviceDrivers/Conceptual/USBBook/USBIntro/USBIntro.html
3
u/TotesMessenger Aug 09 '17
I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:
If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)
1
u/jbc22 Aug 22 '17
What kind of device are you trying to read from? Take a look at the book "OS X and iOS Kernel Programming". I think it has the answers you are looking for.