kernel and user mode communication
Hi,
I know that signal and fasync can be used between kernel and user mode, but it is not satisfied to be used in communication of kernel and user applications with multi-threading and processes. I would like to use message mechanism for communication between kernel and user mode, but I know IPC can not be used in kernel. Does anyone know any other alternative to user message communication between kernel device driver and user mode? Thank you. Jim |
umm..mm try this way
use Code:
copy_from_user( .. ) try to study this code as user space Code:
//--- ignored header you should know by yourself --- |
Code:
size_t |
Thanks for your response. But that just for user access kernel device driver. I actually want to find a way for kernel initiates a message to a specific user application or user thread when kernel receives an interrupt. Any luck for that solution?
Thank you. Jim |
"When the kernel receives an interrupt" is probably a bit too hasty. There are an awful lot of those...
The kernel can easily issue a signal to a running process, and this might well be the easiest way to handle any sort of asynchronous notification. You can also have the user application open a virtual-device, and when you need to tell the user process something, just write to the device. udev does that... |
I don't know what your exact requirements are. But you could always use AIO (async I/O) which allows you to register callback functions for async notifications of I/O requests.
Check this: http://lse.sourceforge.net/io/aio.html |
All times are GMT -5. The time now is 01:58 AM. |