darwin-drivers Mailing List http://lists.apple.com/archives/darwin-drivers/2009/Nov/index.html darwin-drivers Mailing List Sat, 07 Nov 2009 13:00:01 +0000 Re: IOExternalMethodArguments.structure{In,Out}putDescriptor http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00018.html Reply to list
On Nov 6, 2009, at 11:00 AM, Daniel Mack wrote:   I'm trying to get my head around how the structureOutputDescriptor and structureInputDescriptor parameters in struct IOExternalMethodArguments are supposed to work. In my IOUserClient::externalMethod() method callback, they're always NULL, and calling the superclass doesn't help either. I also tried the indirection via IOExternalMethodAction, but the MemoryDescriptors won't get initialized.  > quoted text
     How are you calling the userspace methods?     If your structure is "large" where "large" is not clearly defined, the kernel may decide that you probably don't want the whole thing copied, so it will give you an IOMemoryDescriptor that wraps your structure instead.  If you need arbitrary access you can map it, or if you want to cherry-pick fields out of it, use readBytes/WriteBytes.     HTH.      = Mike     
     --  True terror is to wake up one morning and discover that your high school class is running the country. -- Kurt Vonnegut             


      
]]>
IOExternalMethodArguments.structure{In,Out}putDescriptor http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00017.html Reply to list

Hi,

I'm trying to get my head around how the structureOutputDescriptor and
structureInputDescriptor parameters in struct IOExternalMethodArguments
are supposed to work. In my IOUserClient::externalMethod() method
callback, they're always NULL, and calling the superclass doesn't help
either. [...]
]]>
RE: IOStorage filters in 10.6 http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00016.html Reply to list

Thanks.  That explains everything I need to know. 
  
  
Tony   

CC: email@hidden From: email@hidden Subject: Re: IOStorage filters in 10.6 Date: Thu, 5 Nov 2009 18:36:48 -0800 To: email@hidden  Hey Tony,

 10.5 supports both the old interfaces and the new interfaces. [...]
]]>
Re: IOStorage filters in 10.6 http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00015.html Reply to list
Hey Tony,    10.5 supports both the old interfaces and the new interfaces.  You need only subclass one set.  We are able to route any invocation of the old interfaces over to your new implementation transparently.     You have to save a copy of the IOStorageAttributes and IOStorageCompletion if you wish to keep the I/O.  This was true of IOStorageCompletion in the old interfaces as well, but it was a bit more obvious without reading the documentation given that IOStorageCompletion was passed to you by value.     We do not have sample code to illustrate the new interfaces yet.  The new interfaces are documented in HeaderDoc nonetheless.     Dan     Le 2009-11-05 à 11:18, Tony Wong a écrit :   
I just want to make sure I understand this. 
  
Are you saying that 10.5 supports 2 read/write interface? 
  
The legacy one  
read(IOService *, Uint64, IOMemoryDescriptor *, IOSTorageCompletion) 
  
and the new one read(...., IOStorageAttributes *,  IOStorageCompletion *) 
  
And the kernel will use the interface that is defined in the driver? 
  
Now back to one of my original questions: 
  
If the customer has already installed the driver using the legacy interface 
and then he upgrades to 10.6, will the driver fails to load because the 
required interface is not defined or it will cause panic? 
  
I also have a question on the last 2 pointer parameters.  It seems that 
I have to make a copy of them if my driver does not dispatch the 
request to the lower level module in the some context.  Is that correct? 
I just used the pointer initially and I got panic as soon as there is IO. 
  
I did look around for sample code that uses IOStorage class but they 
are too old!  Where can I find sample code for snow leopard or there is none yet? 
  
I think I understand the 32 bit v.s. 64 bit. issue.  I am more confused about 
the new interface and the backward compatibility. 
  
Thanks very much.  
  
  
Tony 

CC: email@hidden From: email@hidden Subject: Re: IOStorage filters in 10.6 Date: Thu, 5 Nov 2009 09:51:06 -0800 To: email@hidden  Hey Tony,

 You can switch to the new interfaces safely.  We support it on both 10.5 and 10.6.  You need not special case 32-bit from 64-bit. 

 Dan 


 Le 2009-11-05 à 01:59, Tony Wong a écrit :  

 No.  Our product does not support 10.6 yet but we are in the process of porting the driver to 64 bit 10.6.   We actually thought it would work in 32 bit snow leopard but it does not seem possible.   Our driver does not use any 64 bit data types and we thought a simple recompilation would suffice but NO, thanks to the new interface.   We have not tried the upgrade from 10.5 to 10.6 with the old 10.5 drivers because our primary interest is 64 bit 10.6 and we know the 32 bit driver will not work.  I would like to get quick answer from you folks so we can save some time.    Thanks.   Tony Wong    

Subject: Re: IOStorage filters in 10.6 From: email@hidden Date: Thu, 5 Nov 2009 01:16:56 -0800 CC: email@hidden To: email@hidden  Tony, 

 Have you tried it yet? 

  = Mike 


 On Nov 5, 2009, at 12:46 AM, Tony Wong wrote:

[...]
]]>
RE: IOStorage filters in 10.6 http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00014.html Reply to list

No finger pointing here.  I just want to understand what is going on. 
  
Your first question : use 10.5 interface in 10.6 environment. 
  
Well my driver is using the interface  
read(...., IOMemoryDescriptor, IOStorageCompletion) because that is what I learned  [...]
]]>
Re: Can I export multiple user client objects on my kext? http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00013.html Reply to list

Hi Mike,     That was going to be my next question, but I see that I can do everything I need with the existing UserClient class.     Thanks,  Jim    On Nov 4, 2009, at 8:36 PM, Michael Smith wrote:      On Nov 3, 2009, at 11:12 AM, Jim O'Connor wrote:  > quoted text [...]
]]>
RE: IOStorage filters in 10.6 http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00012.html Reply to list

I just want to make sure I understand this. 
  
Are you saying that 10.5 supports 2 read/write interface? 
  
The legacy one  
read(IOService *, Uint64, IOMemoryDescriptor *, IOSTorageCompletion) 
  
and the new one read(...., IOStorageAttributes *,  IOStorageCompletion *) 
   [...]
]]>
Re: IOStorage filters in 10.6 http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00011.html Reply to list

Tony,     The IOStorageFamily team does a very meticulous job when it comes to situations like this; whilst I don't want to just automatically point the finger I'd be very surprised if you weren't able to do at least one of the following:      - use the 10.5 method in the 10. [...]
]]>
Re: IOStorage filters in 10.6 http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00010.html Reply to list

Hey Tony,    You can switch to the new interfaces safely.  We support it on both 10.5 and 10.6.  You need not special case 32-bit from 64-bit.     Dan     Le 2009-11-05 à 01:59, Tony Wong a écrit :   
No.  Our product does not support 10.6 yet but we are in the process  [...]
]]>
Re: IOStorage filters in 10.6 http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00009.html Reply to list

Hi Tony,

On Thu, Nov 5, 2009 at 8:59 PM, Tony Wong

[...]

You can build a universal Kext that works on all architectures. You
need to use #ifdef's for the 64 bit stuff. You'll have to use the 10.6
SDK for 64 bit (obviously), and the 10.5 SDK for 32 bit stuff. [...]
]]>
RE: IOStorage filters in 10.6 http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00008.html Reply to list

No.  Our product does not support 10.6 yet but we are in the process 
of porting the driver to 64 bit 10.6.   We actually thought it would work in 
32 bit snow leopard but it does not seem possible. 
  
Our driver does not use any 64 bit data types and we thought a simple  [...]
]]>
Re: IOStorage filters in 10.6 http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00007.html Reply to list

Tony,    Have you tried it yet?      = Mike     On Nov 5, 2009, at 12:46 AM, Tony Wong wrote:  > quoted text

    --  Excellence in any department can be attained only by the labor of a lifetime; it is not to be purchased at a lesser price -- Samuel Johnson              

 [...]
]]>
IOStorage filters in 10.6 http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00006.html Reply to list

I just found out that the read/write interface for the IOStorage class is 
not compatible in 10.6.  There is a new attr argument and the completion 
object is not passed as a pointer. 
  
It is trivial to port it BUT 
  
if the customer upgrades from 10.5 to 10. [...]
]]>
Re: Can I export multiple user client objects on my kext? http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00005.html Reply to list
On Nov 3, 2009, at 11:12 AM, Jim O'Connor wrote:  > quoted text
     Jim,     How would you expect I/O Kit to decide which class to instantiate?     As long as you have some way of differentiating between different client types, it's not hard to use a different method table to dispatch client requests; you don't need multiple client class types for this.      = Mike   
     --  True terror is to wake up one morning and discover that your high school class is running the country. -- Kurt Vonnegut             


      
]]>
Device matched but not loaded in Snow Leopard 64 bit mode http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00004.html Reply to list

Thanks to all the list for replies on my plist errors.     I have redone the personality, and think I have it fixed up from what I inherited. I am now matching with a score of 100000, but my driver still does not be called ( init function ).      Here is the new plist and a snip from USBProber. [...]
]]>
Re: Can I export multiple user client objects on my kext? http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00003.html Reply to list

G'day, Jim.  
As Chris said the default implementation of newUserClient isn't real  
smart.  If you want multiple interfaces automatically you could  
publish multiple nubs which share a single open-exclusive.  But it  
isn't really worth the effort, overriding newUserClient is a better bet. [...]
]]>
Re: Can I export multiple user client objects on my kext? http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00002.html Reply to list

Jim --     > quoted text
     I don't think so. I believe IOKit will only look for one class name to use. However, you can override newUserClient() and use the 'type' parameter to instantiate different classes.     -- Chris       
 ------------------ 
 6 Infinite Loop 
 M/S 306-2MS  [...]
]]>
Can I export multiple user client objects on my kext? http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00001.html Reply to list
If I put an array in my info.plist for IOUserClientClass can I export  
multiple user client objects so that I can have different interfaces  
on my kext to support older or different word size interfaces in this  
way? 

  Thanks,
Jim
]]>
Re: Universal driver for 10.4/10.5/10.6 and 64 bit http://lists.apple.com/archives/darwin-drivers/2009/Nov/msg00000.html Reply to list
Your personality needs to be under a top-level "IOKitPersonalities" property key.

Nik


On Oct 28, 2009, at 12:12 , Richard Smith wrote:

[...]
]]>