Communication between userspace apps and KEXT
Communication between userspace apps and KEXT
- Subject: Communication between userspace apps and KEXT
- From: Jeff Laing <email@hidden>
- Date: Thu, 17 Mar 2005 15:06:34 +1100
(Apologies in advance if this shows that I don't understand the first thing
I'm talking about)
I have a toy project running which involves a KEXT thats monitoring certain
kernel operations.
I have a sysctl interface working fine, which allows me to control the KEXT
to my satisfaction.
However, I don't have a mechanism to collect the output from the KEXT. At
the moment, its just doing printf()s which send results to the console.log,
thus proving its all working, but making the results as good as
inaccessible.
I believe that what I want to do is have my userspace program create a Mach
port, use sysctl() to let the KEXT know about the port and connect to it
(somehow), then have the KEXT stream its output to the port with my
userspace program slurping up the results. Presumably if the program dies,
the KEXT can see that the port goes invalid and can stop talking to it,
without crashing my machine.
Sadly, I can't find any simple samples that show how to do this sort of
stuff. Can anyone give me a pointer? Or am I dreaming and this sort of
thing would never work anyway?
(The alternative that occurred to me was to map a page of shared memory
between userspace app and kext and have them manage a ring-buffer between
themselves, but I don't think I know anywhere near enough about messing with
kernel memory)
Thanks in advance for any help whatsoever,
Jeff Laing <email@hidden>
----------------------------------------------------------------------------
A complex system designed from scratch never works and cannot be patched up
to make it work. You have to start over, beginning with a working simple
system.
-- J Gall. "Systemantics: How systems work and how they fail"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden