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: Communication with already loaded kext



Anshul,

It is up to the author of a kext to decide if they want their kext to serve as a library or not. They communicate this decision through the presence of the OSBundleCompatibleVersion property in the top level dictionary in their Info.plist file. The absence of this property indicates that the kext is not available for linking - the presence of this property indicates that it is available for linking. The value of this property is a version number that indicates the oldest version with which this kext is binary compatible (you increase this version number when you change the library kext in a way that breaks binary compatibility). This is described at http://developer.apple.com/documentation/Darwin/ Conceptual/KEXTConcept/KEXTConceptDependencies/kext_dependencies.html and http://developer.apple.com/documentation/DeviceDrivers/Conceptual/ IOKitFundamentals/Families/chapter_7_section_3.html

The ATIRadeon8500.kext does not have this property so ATI does not intend to have their kext used as a library. So it is not possible to use this kext as a dependency or create a subclass of any class it provides.

You can write a kext that matches on instances of this class (use the property IOProviderClass). When it loads, it will have an instance of ATIRadeon8500 as it's provider, and you can call any of the entry points that are defined by the generic superclass of this driver, but you can't call methods that are added by their class (since you can't link against their kext can get at their class's vtable). I believe that both ::allocate_Texture() and ::alloc_and_load_texture() are defined by their class and not inherited, so you will probably not be able to get at them.

 - Dean

On May 18, 2005, at 02:56, Anshul Makkar wrote:
Hello,
I am developing a filter graphics kext that will call the original graphics kext's functions.


Is it possible to call a function of already loaded graphics kext( eg call alloc_texture function of ATIRadeon8500.kext ) from my filter kext .
I dont have the source code for ATIRadeon8500 so no header file is availablle with us , only information that is availabe the symbols (eg ATIRadeon8500::allocate_Texture(), ATIRadeon8500::alloc_and_load_texture) .
Now I want to call these functions from my graphics kext .


     What I am trying to do is  :

In Dependencies I have given ATIRadeon8500
I am inheriting my class from ATIRadeon8500 which is failing , and that should be correct as how my application will find the class ATIRadeon8500 . eg class com_Samsung_driver_Magic_Pivot : public ATIRadeon8500 ->error : class ATIRadeon8500 undeclared .
The basic purpose is to inherit my class from ATIRadeon8500 , so as to call the functions of ATIRadeon from my own kext .


In the example source code IOKitWithLibrary , they are preparing their own Library kext and I dont have that priviledge here.

Is there a way to achive it.
Thanking You
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-drivers mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-drivers/dean.reece% 40apple.com


This email sent to email@hidden


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

This email sent to email@hidden
References: 
 >Communication with already loaded kext (From: Anshul Makkar <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.