tags:

views:

184

answers:

1

Hello everyone,

I have an IOKit-based kernel extension on Mac OS X, a subclass of IOService. When this service loads i need to publish additional specific runtime information from it and i need it to be accessible from user space without making some specific IOUserClient requests. The information in question is basically field\value pairs and it's format is shared between the KEXT and it's user-space wrapper library. The contents will change over time on some specific events inside the service when it is active.

On Linux i would have accomplished this with a file in the /proc file system. Can you advise a similar strategy on OS X? Maybe something related to IORegistry?

Thank you.

+2  A: 

Well this turned out to be pretty easy. Your IOKit service is (eventially) inherited from IOService class, which in turn is inherited from IORegistryEntry, which represents an instance of your service's entry in IORegistry and provides a family of setProperty\getProperty methods to add\change\remove your own fields in IORegistry entry for your service.

The IORegistry in an in-memory database that is of course programmatically accessible from user space where you search it for you service's entry and read information published by it.

Inso Reiges