Re: How can I communicate between user/kernel programs?
Re: How can I communicate between user/kernel programs?
- Subject: Re: How can I communicate between user/kernel programs?
- From: Jorgen Lundman <email@hidden>
- Date: Thu, 13 Apr 2017 08:48:37 +0900
- Dkim-filter: OpenDKIM Filter v2.10.3 mail.lundman.net 0A1F611CFE7
In traditional Unix this was done with ioctl(), where you would make up
your own ioctl number, and struct*/length to pass to kernel, and/or have
kernel fill in the data. Kernel uses copyin()/copyout() to cross the
userland/kernel memory access barrier. (Not on OsX, the XNU kernel does
copyin/copyout for you, on the "main" pointer passed through).
So if you meant the literal string "bus_speed" and getting back an integer,
it is what it was designed for, and very portable. For short queries of
small to moderate size.
If you mean you want to do communication at "bus speeds", then what Quinn
recommends is better, for high speed and large buffers.
Lund
Major Tom wrote:
> Hi, everyone. I'm a newbie to mac kernel.
>
> Recently I decided to develop a kext to support interprocess communication.
>
>
> Let's say a user-space program sending operation string to kext.
> And kext received the message and reply corresponding result to user-space
> program.
>
> Given a real life example is that, a user-space program sending "bus_speed"
> to kext.
> When kext received the message, it sending the bus speed result of current
> machine back to user-space program.
>
> Which it's a full-round communication.
>
>
> Can anyone here figure out what mechanism should I use to do this job?
> What communication mechanism should best suit in such case?
>
> Thanks all you guys.
> :-D
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Darwin-kernel mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
--
Jorgen Lundman | <email@hidden>
Unix Administrator | +81 (0)90-5578-8500
Shibuya-ku, Tokyo | Japan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden