Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Again: can't get codeless KEXT to load/math
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Again: can't get codeless KEXT to load/math



Kustaa,

oops, I forgot to cc the mail list.


On Aug 22, 2009, at 11:56 PM, Kustaa Nyholm wrote:

Rich Kubotam wrote:

Can someone please tell me why this does not work?

I'll take a shot at this.
Thanks!

BTW was there a reason this was not CC:ed to the list?
In case you have, I'v not CC:ed the list but you are welcome
if want to.

you want to switch this to
                       <string>WMR100_Shield</string>

Interesting suggestion. I've found slightly conflicting guidance on this.
Some say that this must match the CFBundleIdentifier on the top
level of the Info.plist (as you seem to suggest) otherwise the kext
won't load. Some say that for codeless kext it must match some
Apple io bundle to steal the executable code from there which
approach takes advantage of that apple driver returning true
under these circumstances. Don't recall exactly and can't find
the reference right now.

there are different types of codeless kexts. In on case, like your's you want to prevent a driver from matching to your device/interface. In this case, the CFBundleIdentifier needs to be set to a kext identifier which won't load any code to match against your device/ interace which might exclusively open access to the device/interface. The other type of codeless kext is used to alter the existing behavior of driver matching so that you force a different driver to match to your device, in which case, you specify the CFBundleIndentifier of the driver that you want to match to your device.


there is also a modified version of this latter reason, for using a codeless kext - where you want to force a property to be associated with the device/interface ioregistry entry so that when the driver loads, it detects the presence of the property and works differently with the device, because of the presence of the property.

In your case, you want to prevent the the HID driver from matching to your interface.

At to your current Info.plist which works, but it's not clear why and that it's not working as intended, skip down to my answer at the end


Anyway, I tried this, but it did solve the issue. More below.




                     <key>IOClass</key>
                     <string>IOservice</string>
                     <key>IOProviderClass</key>
                     <string>IOUSBInterface</string>
                     <key>bConfigurationValue</key>
                     <integer>1</integer>
                     <key>bInterfaceNumber</key>
                     <integer>0</integer>
                     <key>bcdDevice</key>
                     <string>770</string>
Where did you get this bcdDevice value? It well could be right.

I found it with the USB Prober / Bus Probe tab. I'm pretty sure it is the right value.

However Fernando spotted that the type is wrong (string/integer).

I changed that and tried it. Did not work. Did what you suggest about
the bundle id above, tried it, did not work. See below.

I copied the codeless kext using sudo. One reason why the codeless kext
might fail can be due to improper
file ownership. For example, I use


user$ sudo cp -R
/AppleKbd523_no_match/build/Debug/AppleKbd523_no_match.kext
/System/Library/Extensions
password
user$ sudo touch /System/Library/Extensions
## the above forces the system to rebuild the kext cache, otherwise the
kext will not be loaded when the
## system is restarted
user$ sudo reboot

Exactly what I always do!



After the reboot, I open USB Prober, use the USB Logger tab, set match
level 6, hit the start button, then I attach the keyboard
Once the output window settles, I hit the stop button. In the "Filter
output" window, I enter "match" without quotes

Very good suggestion, exactly the kind of guidance I wanted, there really
should be a tech note or something about these things.


So here is what I saw after I corrected bcdDevice type from string to integer:

128.531 [5] Finding device driver for Universal Bridge, matching personality using com.parallels.kext.prl_usb_connect, score: 106000, wildCard = 3
128.531 [6] Matched: idVendor (4062) idProduct (51713) bcdDevice (770)
128.531 [6] Didn't Match: nothing
128.532 [5] Finding device driver for Universal Bridge, matching personality using com.apple.iokit.IOUSBUserClient, score: 106999, wildCard = 3
128.532 [6] Matched: idVendor (4062) idProduct (51713) bcdDevice (770)
128.532 [6] Didn't Match: nothing
128.532 [5] Finding device driver for Universal Bridge, matching personality using com.vmware.kext.vmioplug, score: 106005, wildCard = 3
128.532 [6] Matched: idVendor (4062) idProduct (51713) bcdDevice (770)
128.532 [6] Didn't Match: nothing
128.533 [5] Finding device driver for Universal Bridge, matching personality using com.apple.driver.AppleUSBComposite, score: 50000, wildCard = 0
128.533 [6] Matched: bDeviceClass (0) bDeviceSubClass (0)
128.533 [6] Didn't Match: nothing
128.539 [5] Universal Bridge[0x8236600]::SetConfiguration matching to interfaces (0)
128.595 [5] Finding driver for interface #0 of Universal Bridge, matching personality using com.parallels.kext.prl_usb_connect, score: 104000, wildCard = 5
128.595 [6] Matched: idVendor (4062) idProduct (51713) bcdDevice (770) bConfigurationValue (1) bInterfaceNumber (0)
128.595 [6] Didn't Match: nothing
128.595 [5] Finding driver for interface #0 of Universal Bridge, matching personality using com.apple.iokit.IOUSBUserClient, score: 104999, wildCard = 5
128.595 [6] Matched: idVendor (4062) idProduct (51713) bcdDevice (770) bConfigurationValue (1) bInterfaceNumber (0)
128.595 [6] Didn't Match: nothing
128.595 [5] Finding driver for interface #0 of Universal Bridge, matching personality using com.vmware.kext.vmioplug, score: 104005, wildCard = 5
128.595 [6] Matched: idVendor (4062) idProduct (51713) bcdDevice (770) bConfigurationValue (1) bInterfaceNumber (0)
128.595 [6] Didn't Match: nothing
128.607 [5] Finding driver for interface #0 of Universal Bridge, matching personality using com.apple.kernel.iokit, score: 100000, wildCard = 0
128.607 [6] Matched: idVendor (4062) idProduct (51713) bcdDevice (770) bConfigurationValue (1) bInterfaceNumber (0)
128.607 [6] Didn't Match: nothing
128.608 [5] Finding driver for interface #0 of Universal Bridge, matching personality using com.apple.iokit.IOUSBHIDDriver, score: 50000, wildCard = 0
128.608 [6] Matched: bInterfaceClass (3) bInterfaceSubClass (0)
128.608 [6] Didn't Match: nothing


So no sign of my codeless shield.

Can you explain what I should see here?
I asked but no one answered if there is any description of the USB Prober output...
What does: "Didn't Match: Nothing" means?
What does this indicate: "Universal Bridge [0x953f400]::SetConfiguration matching to interfaces (0) "
I suppose who ever wrote the USB Prober thought it was all intuitive, but I guess I'm backwards or something
cause I do not understand all of it, although I can guess most of it, I guess;-)


Here is what see after I change the bundle identifier as you suggested above:

328.031 [2] AppleUSBOHCI[0x6e02800]::UIMEnableAddressEndpoints - found control ED[0x6f0ed98] which matches - enabling
343.261 [5] Finding device driver for Universal Bridge, matching personality using com.parallels.kext.prl_usb_connect, score: 106000, wildCard = 3
343.261 [6] Matched: idVendor (4062) idProduct (51713) bcdDevice (770)
343.261 [6] Didn't Match: nothing
343.261 [5] Finding device driver for Universal Bridge, matching personality using com.apple.iokit.IOUSBUserClient, score: 106999, wildCard = 3
343.261 [6] Matched: idVendor (4062) idProduct (51713) bcdDevice (770)
343.261 [6] Didn't Match: nothing
343.262 [5] Finding device driver for Universal Bridge, matching personality using com.vmware.kext.vmioplug, score: 106005, wildCard = 3
343.262 [6] Matched: idVendor (4062) idProduct (51713) bcdDevice (770)
343.262 [6] Didn't Match: nothing
343.262 [5] Finding device driver for Universal Bridge, matching personality using com.apple.driver.AppleUSBComposite, score: 50000, wildCard = 0
343.262 [6] Matched: bDeviceClass (0) bDeviceSubClass (0)
343.262 [6] Didn't Match: nothing
343.269 [5] Universal Bridge[0x953f400]::SetConfiguration matching to interfaces (0)
343.320 [5] Finding driver for interface #0 of Universal Bridge, matching personality using com.parallels.kext.prl_usb_connect, score: 104000, wildCard = 5
343.320 [6] Matched: idVendor (4062) idProduct (51713) bcdDevice (770) bConfigurationValue (1) bInterfaceNumber (0)
343.320 [6] Didn't Match: nothing
343.320 [5] Finding driver for interface #0 of Universal Bridge, matching personality using com.apple.iokit.IOUSBUserClient, score: 104999, wildCard = 5
343.320 [6] Matched: idVendor (4062) idProduct (51713) bcdDevice (770) bConfigurationValue (1) bInterfaceNumber (0)
343.320 [6] Didn't Match: nothing
343.320 [5] Finding driver for interface #0 of Universal Bridge, matching personality using com.vmware.kext.vmioplug, score: 104005, wildCard = 5
343.320 [6] Matched: idVendor (4062) idProduct (51713) bcdDevice (770) bConfigurationValue (1) bInterfaceNumber (0)
343.320 [6] Didn't Match: nothing
343.332 [5] Finding driver for interface #0 of Universal Bridge, matching personality using WMR100_Shield, score: 100000, wildCard = 0
343.332 [6] Matched: idVendor (4062) idProduct (51713) bcdDevice (770) bConfigurationValue (1) bInterfaceNumber (0)
343.332 [6] Didn't Match: nothing


So now my WMR100_Shield is being considered and apparently it is having some effect as
the USB Prober / Bus Probe tab no longer shows the device and my Java/libusb is not
able even to find the device on the bus!!


Still the following Info.plist and a simple a-few-liner dummy c-code kext it works.
I'm so confused and frustrated, already spent some ten hours over five days on this
thing that should be trivial.


br Kusti


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//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>CFBundleExecutable</key>
<string>VendorSpecificDriver</string>
<key>CFBundleIdentifier</key>
<string>com.sparetimelabs</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.0</string>
<key>IOKitPersonalities</key>
<dict>
<key>DeviceDriver</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.sparetimelabs</string>
<key>IOClass</key>
<string>IOService</string>
<key>IOProviderClass</key>
<string>IOUSBDevice</string>
<key>bcdDevice</key>
<integer>770</integer>
<key>idProduct</key>
<integer>51713</integer>
<key>idVendor</key>
<integer>4062</integer>
</dict>
<key>InterfaceDriver</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.sparetimelabs</string>
<key>IOClass</key>
<string>IOService</string>
<key>IOProviderClass</key>
<string>IOUSBInterface</string>
<key>bConfigurationValue</key>
<integer>1</integer>
<key>bInterfaceNumber</key>
<integer>0</integer>
<key>idProduct</key>
<integer>51713</integer>
<key>idVendor</key>
<integer>4062</integer>
</dict>
</dict>
<key>OSBundleLibraries</key>
<dict>
<key>com.apple.iokit.IOUSBFamily</key>
<string>1.8</string>
<key>com.apple.kernel.libkern</key>
<string>6.0</string>
</dict>
</dict>
</plist>





The upshot of the codeless kext above, is that it will keep the Apple Comosite driver from matching to the device. which means that there will not be any further work with the device. If you want to work with the interface, then you would need to match to the device, open it, configure it, find the interface, and open the interface, pipes, etc. The DeviceDriver personality makes the InterfaceDriver personality useless. I think that what you want is for the Composite driver to match to the device, open it, then have the system access available interface drivers to match at the interface level.
As such
1. remove the DeviceDriver personality.
2. try adding the bcdDevice property since the parallels driver is matching to all hid devices using wild card matching.


<key>bcdDevice</key>
<integer>770</integer>

Also check that the ownership and permissions are correct on the codeless kext - as it's not showing up in the prober log.


hth

rich kubota

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden




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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.