I kinda hinted at this recently in the discussion about writing
persistent data from the kernel. Basically I need to write some
data to a file when a client of my driver crashes. Since this
isn't currently supported in the kernel (though John Dalgliesh had
some good ideas), I was going to launch a simple userland app to do
this when the client died condition is detected. In theory it was
really simple; just include the helper app inside my kext bundle,
and launch it with KUNCExecute using a full path (I can assume the
kext lives in /S/L/E). But then I ran into the issues mentioned.
My driver can have multiple simultanous clients. I could probably
set it up to have a background app running that handles the case
where one of the clients dies. Thinking about this more, this
seems like the best approach, I'll think about this a bit more...
In the meantime, what other kernel-to-user notification mechanisms
are available? Can a kext signal() to a userland client? If so,
when the kext's user client gets the client died message, is the
userland client already dead (and not able to be signalled)? Is
there a way to do the "reverse" of
IOConnectMethodStructureIStructureO, to call from the kernel back
into the client? Or do I need to use shared memory? Any other ideas?
Thanks,
Jim
At 3:44 PM -0700 4/28/05, Godfrey van der Linden wrote:
In general KUNC execute is barely working and just isn't a good
idea. I'm sure we can come up with a better solution if you can
explain the problem you are trying to solve.
Does you driver talk to a dedicated app? Could you write a quick
a dirty unix tool to launch the app in background or monitor the
state of your driver? All sorts of options are available to us
that don't rely on the KUNC.
Godfrey
On 04/28/2005, at 15:15 , Jim Wintermyre wrote:
I'm trying to use KUNCExecute from my IOKit driver in order to
launch a user-space app to do some stuff that can't happen at
kernel level. I'm running into a few snags:
1) It seems that KUNCExceute will only launch an application that
actually lives in the /Applications folder. I'd like to include
the application directly inside the kext bundle, but KUNCExecute
fails to launch the app from there (with no error) even though
the full path is correct. In fact, it doesn't seem to matter
where I put the app, it never gets launched unless it is inside
the /Applications folder. I'm using the full path to specify the
app. Is this how KUNCExecute is supposed to behave? Is this a
known limitation?
2) It seems that KUNCExecute will not launch CFM apps. Is this
true? Is there any way around this? I don't think that I can
launch the app via LaunchCFMApp because there doesn't seem to be
a way to pass an argument to the app that KUNCExecute launches.
3) For a test MachO app I created, I get this error from
KUNCExecute when I try to launch using kOpenAppAsRoot:
aped[198]: Attach denied: super-user process, for TestApp[1198]
The same call works fine if I test it on TextEdit. The
permissions on the binary are the same in both cases. Any idea
what this means?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-drivers mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden