Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preventing IOUSBHIDDriver From Claiming a Device



Ooops, I Googled for the last 30 minutes and found this:

http://developer.apple.com/qa/qa2001/qa1118.html

I guess I can't statically link against libusb. 

Thanks.
-Brandon


On 09:07 Thu 24 Feb     , Brandon Philips wrote:
> Thank you.  It works great.  For anyone else watching this thread here
> is my XCode project.
> 
> https://svn.osuosl.org/public/zedbot/trunk/tcpusb/mac/NineButton/
> 
> One other question.  I am getting a strange problem when trying to link
> libusb statically:
> 
> gcc -o tcpusb tcpusb.c -g -lm -I./include/  -lpthread -lm -DDEBUG -framework IOKit -static -lusb
> ...
> warnings, etc.
> ...
> ld: can't locate file for: -lcrt0.o
> 
> It works great w/o the -static do you have any pointers?  I verified
> that I have the following files in my /usr/local/lib
> 
> libusb-0.1.4.4.2.dylib
> libusb-0.1.4.dylib
> libusb.a
> libusb.dylib
> libusb.la
> libusbpp-0.1.4.4.2.dylib
> libusbpp-0.1.4.dylib
> libusbpp.a
> libusbpp.dylib
> libusbpp.la
> 
> Thanks again.
> -brandon
> 
> 
> On 17:56 Wed 23 Feb     , Rich Kubota wrote:
> > Brandon,
> > 
> > The solution is to implement a Codeless Kext. This is a Kernel 
> > Extension which has only a plist - which would be something like 
> > follows here. In the following, I present a codeless kext which keeps 
> > the white apple keyboard from matching to the default HID driver. In 
> > the following, I've set the IOClass of the device to IOService which 
> > is the superclass for all devices which will not try to open the 
> > device. This leaves it available for your user land driver to be able 
> > to access the device.
> > 
> > You will need to ensure that the codeless kext gets installed into 
> > the /System/Library/Extensions folder and that you touch the 
> > Extensions folder so that the kexts will be re-enumerated on restart.
> > 
> > best wishes.
> > rich kubota
> > 
> > <?xml version="1.0" encoding="UTF-8"?>
> > <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" 
> > "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
> > <plist version="1.0">
> > <dict>
> > 	<key>CFBundleDevelopmentRegion</key>
> > 	<string>English</string>
> > 	<key>CFBundleIconFile</key>
> > 	<string></string>
> > 	<key>CFBundleIdentifier</key>
> > 	<string>com.MySoftwareCompany.driver.HIDNoMatchWhtApplKb</string>
> > 	<key>CFBundleInfoDictionaryVersion</key>
> > 	<string>6.0</string>
> > 	<key>CFBundlePackageType</key>
> > 	<string>KEXT</string>
> > 	<key>CFBundleSignature</key>
> > 	<string>????</string>
> > 	<key>CFBundleVersion</key>
> > 	<string>1.0.0d1</string>
> > 	<key>IOKitPersonalities</key>
> > 	<dict>
> > 		<key>White AppleKeyboard</key>
> > 		<dict>
> > 			<key>CFBundleIdentifier</key>
> > 			<string>com.apple.kernel.iokit</string>
> > 			<key>IOClass</key>
> > 			<string>IOservice</string>
> > 			<key>IOProviderClass</key>
> > 			<string>IOUSBInterface</string>
> > 			<key>bConfigurationValue</key>
> > 			<integer>1</integer>
> > 			<key>bInterfaceNumber</key>
> > 			<integer>1</integer>
> > 			<key>bcdDevice</key>
> > 			<integer>290</integer>
> > 			<key>idProduct</key>
> > 			<integer>516</integer>
> > 			<key>idVendor</key>
> > 			<integer>1452</integer>
> > 		</dict>
> > 	</dict>
> > 	<key>OSBundleLibraries</key>
> > 	<dict>
> > 		<key>com.apple.iokit.IOUSBFamily</key>
> > 		<string>1.8</string>
> > 	</dict>
> > </dict>
> > </plist>
> > 
> > 
> > >I am trying to get my Linux application that uses libusb to work under
> > >OSX.  Unfortunatly the USB device it uses is defined as a HID, and
> > >libusb cannot claim it because IOUSBHIDDriver already has.
> > >
> > >But, I found one thread that gives hope that I can get IOUSBHIDDriver to
> > >let go of the device:
> > >http://lists.apple.com/archives/usb/2004/Mar/msg00064.html
> > >
> > >It suggests using a kext with a higher probe score to keep
> > >IOUSBHIDDriver from grabbing the device.  Today is the first time I have
> > >ever used a Mac for development and kernel extensions seem like a huge
> > >topic.  So if someone can point me in the right direction it would be
> > >greatly appreciated.
> > >
> > >Thank You,
> > >Brandon Philips
> > 
> > -- 
> > Sincerely,
> > Rich Kubota
> > email@hidden
> > (408) 974-6212



>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Usb mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/usb/email@hidden
> 
> This email sent to email@hidden

Attachment: signature.asc
Description: Digital signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden

This email sent to email@hidden

References: 
 >Preventing IOUSBHIDDriver From Claiming a Device (From: Brandon Philips <email@hidden>)
 >Re: Preventing IOUSBHIDDriver From Claiming a Device (From: Rich Kubota <email@hidden>)
 >Re: Preventing IOUSBHIDDriver From Claiming a Device (From: Brandon Philips <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.