Ok, I will dig those DVDs out, was it a complete session on codeless kext
and check out the slides and see what's there.
I will try a codeless kext first and see how I get on ?, are there any
examples anywhere ? - or even in the OS system ? To see what all the keys I
need.
http://developer.apple.com/qa/qa2001/qa1076.html
mentions some keys, but I have seen emails on list have more keys
including vendor/product in the IOKitPersonalities. What should be the
IOClass and IOProviderClass values be ?
Calling SetConfiguration() seems pretty straight forward as you say (not
sure on the steps yet, but that's fun of the journey), and I also think I
need to change the MaxPower, as I think there's a problem in the USB device
descriptor again as its not charging via USB compared when in Phone mode,
although not sure yet.
Thanks
Mark.
> We have talked about codeless kexts @ WWDC, tho' I can't recall
> when. Probably not within the last 3 years. You should search the
> archives for this list, as it occasionally pops up.
>
> Yes, a codeless kext is just an Info.plist that uses another bundle's
> binary as its executable. They are used either to just put a
> property in the IORegistry (and hence use the AppleUSBMergeNub kext
> as their binary) or use another binary as their driver. You want the
> latter. Please read up on USB Device Matching. You want a vendor
> specific device driver for your device. Unfortunately, it sounds
> like your device will not change the device descriptor when it
> changes mode (just changes the configuration descriptor). This will
> present a problem because you only want the composite driver to match
> when the mass storage interface is available, but that is not present
> during passive matching....
>
> Sounds like you really need to write a kext that will match to your
> device. In the start() method it will get the configuration
> descriptor and parse it and if it sees the mass storage interface, it
> will call SetConfiguration() and return true from start. Otherwise,
> it will return false, which will allow the CDC driver to run.
>
> Or, you can just write a user space app that you run when you want
> the mass storage interface to appear.
>
> --
> Fernando Urbina
> USB Technology Team
> Apple Computer, Inc.
>
> On Oct 16, 2006, at 10:24 AM, Mark Thomas wrote:
>
>> Hi,
>> Well you are right, Kernel level, drivers and below is not my
>> area of
>> expertise, API and frameworks in User level is more my expertise. I
>> understand the principles of USB and the USB class drivers, and
>> have spend a
>> fair amount of time in IOKit extracting device info.
>>
>> But I've always wanted to have a go writing a USB driver and I
>> guess a
>> code less kext would be a good area to start :-). Can you recommend
>> some any
>> where about these code less kext as searching developer.apple.com
>> doesn't
>> return anything much, and googling doesn't either apart from links
>> to this
>> mail list. (Was there every a WWDC session on this ?, as I have
>> access to
>> those for last couple years ?)
>>
>> I'm guessing a codeless kext is just a normal kext bundle but
>> just has a
>> Info.plist and nothing else ?
>>
>> I have entered rdar://4783190 as well, just in case I fail.
>>
>> Thanks
>> Mark.
>>
>>> Message: 1
>>> Date: Sat, 14 Oct 2006 13:54:22 -0600
>>> From: Fernando Urbina <email@hidden>
>>> Subject: Re: Apple MASS storage driver
>>> To: USB List at Apple <email@hidden>
>>> Message-ID: <email@hidden>
>>> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>>>
>>> Sounds like you're over your head. As I said, you don't want to do
>>> this for all class devices. You want a vendor-specific kext and you
>>> should NOT be modifying a system kext. If the above doesn't make
>>> much sense, I suggest you instead file a bug at http://
>>> bugreporter.apple.com. Please include the device descriptor when the
>>> phone is in both the CDC mode and the mass storage mode.
>>>
>>> BTW, you could also write a user space app that just issues a
>>> SetConfiguration() to your device. Then, when you want it to load
>>> the mass storage interface, you just run that app.
>>>
>>> HTH,
>>>
>>> --
>>> Fernando Urbina
>>> USB Technology Team
>>> Apple Computer, Inc.
>>>
>>> On Oct 13, 2006, at 3:05 PM, Mark Thomas wrote:
>>>
>>>> Ok, I'm up to trying this, so this within IOUSBFamily.kext then
>>>> within
>>>> IOUSBCompositeDriver.kext update the Info.plist within
>>>> IOKitPersonalities ?
>>>>
>>>> bDeviceClass 2
>>>> bDeviceProtocol 0
>>>> bDeviceSubClass 0
>>>> CFBundleIdentifier com.apple.driver.AppleUSBComposite
>>>> IOClass IOUSBCompositeDriver
>>>> IOProviderClass IOUSBDevice
>>>>
>>>> as I gave this a go and nothing changed :-(, or did I miss
>>>> understand you
>>>> ?
>>>>
>>>> Thanks
>>>> Mark.
>>>>
>>>>> Ah, the problem is that the phone is NOT changing the device
>>>>> descriptor:
>>>>>
>>>>> Device Class: 2 (Communication)
>>>>> Device Subclass: 0
>>>>> Device Protocol: 0
>>>>>
>>>>> Our CDC driver will fail to match to that device 'cause it won't
>>>>> find
>>>>> the interfaces. Our composite driver will not load against it,
>>>>> cause
>>>>> it's not a composite device.
>>>>>
>>>>> You can create a code-less kext for that particular device that
>>>>> uses
>>>>> the composite driver as the CFBundleIndentifier. You can look
>>>>> at the
>>>>> IOUSBCompositeDriver.kext Info.plist and see how we do it for a
>>>>> particular class of devices. You would need to do it just for your
>>>>> device, not for the whole CDC devices.
>>>>>
>>>>> As for it not charging, I assume it's a feature of the phone.
>>>>>
>>>>> --
>>>>> Fernando Urbina
>>>>> USB Technology Team
>>>>> Apple Computer, Inc.
>>>>>
>>>>> On Oct 13, 2006, at 2:16 PM, Mark Thomas wrote:
>>>>>
>>>>>> In the IORegistry tab there is
>>>>>>
>>>>>> (IOService Plane option)
>>>>>> usb@1B <class IOPCIDevice>
>>>>>> AppleUSBOHCI <class AppleUSBOHCI>
>>>>>> OHCI Root Hub Simulation@1B <class IOUSBRootHubDevice>
>>>>>> P990i@1b100000 <class IOUSBDevice>
>>>>>> IOUSBUserClientInit <class IOUSBUserClientInit>
>>>>>>
>>>>>> (IOUSB Plane option)
>>>>>>
>>>>>> Root <class IORegistryEntry>
>>>>>> OHCI Root Hub Simulation@1A <class IOUSBRootHubDevice>
>>>>>> IOUSBDevice@1a100000 <class IOUSBDevice>
>>>>>> OHCI Root Hub Simulation@1B <class IOUSBRootHubDevice>
>>>>>> P990i@1b100000 <class IOUSBDevice>
>>>>>>
>>>>>> By not working I mean there is no volume appearing, and also the
>>>>>> phone
>>>>>> doesn't to start charging like it does when in USB modem mode.
>>>>>>
>>>>>> Thanks
>>>>>> Mark.
>>>>>>
>>>>>>> What do you mean by "isn't working"?
>>>>>>>
>>>>>>> Can you see if the IOUSBMassStorageDriver has matched to the
>>>>>>> interface? You can use IORegistryExplorer and follow the
>>>>>>> IOServicePlane for the device, or use ioreg -l and look for the
>>>>>>> interface for that device.
>>>>>>>
>>>>>>> --
>>>>>>> Fernando Urbina
>>>>>>> USB Technology Team
>>>>>>> Apple Computer, Inc.
>>>>>>>
>>>>>>> On Oct 13, 2006, at 2:05 PM, Mark Thomas wrote:
>>>>>>>
>>>>>>>> I have a Sony Ericcson P990i which has an option which
>>>>>>>> reports it
>>>>>>>> can be
>>>>>>>> behave like a USB mass storage device when attached via the USB
>>>>>>>> route.
>>>>>>>> Unfortunately this isn't working, so looking at the USB Prober
>>>>>>>> its is
>>>>>>>> reporting itself as a mass storage device, so wondering what
>>>>>>>> could be
>>>>>>>> happening ?
>>>>>>>
>>>>>>
>>>>>
>>>>
>>
>
_______________________________________________
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