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: Kext Load on demand and daemon communication



> In the meantime, there are some less-than-ideal workarounds:
> 
> o As Shaun mentioned, there's KUNC.
> 
> o Another option is for your launchd property list to specify some
> on-demand criteria that your KEXT satisfies.  For example, your
> launchd property list could register a UNIX domain socket with a well
> known path.  When your KEXT comes up, it connects to that socket,
> thereby triggering the launch of your daemon.

That's good information for the list.

In my case, I have a daemon that is always up for other reasons.  It just
needs to know when my kext is loaded.

I looked at IOServiceAddMatchingNotification(). That seems pretty
straight-forward.  What I'm not clear on is what stage my driver will be in
when I get a notice in my callback.

What I want my daemon to do is to configure my kext, then listen for
messages from it that it must respond to.

I expect at the time my daemon is launched there may be driver instances
already published before my daemon came up.  The kext will be using default
behaviors at this point, because it can't read any settings from disk
itself.  The daemon will configure the kext to handle future events, then
start listening to the it for messages.  That's as much as I can do for
existing instances.

In the case of notices I receive in my callback...

So long as there is any published driver I want to listen for messages from
my kext.  I can track that by counting publications vs. terminations.

If I receive a first published notice for my driver at a time when there are
no other published services, my daemon need to configure the kext via is
user client and start listening for messages from it.

In this case, however, I don't want my driver's validateNewMedia() method to
execute before I have sent configuration info to the kext's user client and
I am listening for messages.

Is there a way I can count on doing this in terms of the order of
operations?  I mean, if I set this all up when I receive the publish notice
in the daemon, before exiting the callback, am I ok?  Is there something
else I should do?

I'm just trying to figure out how to make this work.


Thanks,


Eric


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

This email sent to email@hidden

References: 
 >Re: Kext Load on demand and daemon communication (From: Eric Long <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.