hi there
is it possible to have a memory area which i can access from both userspace and kernelspace?
so i can exchange data between these _without_ copying
can you please give me a hint how to do that in general (idea) or where i can read something about this
thx
mb
Look at the packet capturing
Look at the packet capturing code (net/packet/af_packet.c), it has support for a circular mmap-buffer that is shared between kernel and user space.
There's some documentation in Documentation/networking/packet_mmap.txt too..
thanks, i will check this
thanks, i will check this out ;)
All user space memory is
All user space memory is accessible from kernel space; any ioctl or syscall with a pointer argument will be reading user space memory. :)
But be careful, don't make any assumptions that two subsequent reads will return the same result -- read individual values only once, and keep them around as local variables while you need them.
yes but then i would be able
yes but then i would be able to access the right memory only if the user process is actual running.
but i need to write data in the memory from the kernel while the userprocess is sleeping.
Huh? The calling thread is
Huh? The calling thread is always suspended when a syscall is invoked (or an ioctl which is just another syscall). Other user threads from the same process might still be running, but it's the userspace programmer's problem to guarantee proper locking of their resources.
system calls
Hi,
Please help me in finding the system calls which can be use to share all kind of data between user space and kernel space, for example in accessing memory parameters.
RDMA does the same thing
You might also check out the current support for RDMA, as it also locks user buffers in physical memory for a considerable period of time. Here is an article about it from lwn.net:
http://lwn.net/Articles/133649/
We can write a character
We can write a character device driver as an interface between kernel space & user space...! using the ioctl functionalities.....!
also by using the copy_from_user() & copy_to_user() functions we can copy just the pointer of the data & we can send it directly to kernel level & back to userlevel...!
we can reserve some buffer/page cache(doesnt make difference in linux 2.6)which wil actually contain the pointer information for the data accross the domain....!
we can write our own write "read" & "write" "lseek" system calls...
One copy in the kernel zone exchange cant b avoided...!
We can use the circular linked list buffer for reusability by overwriting the oldest one...!
!......BRAVO......!
We can write a character
We can write a character device driver as an interface between kernel space & user space...! using the ioctl functionalities.....!
also by using the copy_from_user() & copy_to_user() functions we can copy just the pointer of the data & we can send it directly to kernel level & back to userlevel...!
we can reserve some buffer/page cache(doesnt make difference in linux 2.6)which wil actually contain the pointer information for the data accross the domain....!
we can write our own write "read" & "write" "lseek" system calls...
One copy in the kernel zone exchange cant b avoided...!
We can use the circular linked list buffer for reusability by overwriting the oldest one...!
We can use conventional approach to lock that particular buffer.....!
U can check IO-Lite Paper or beltway buffers concept for the same.....!
!....Bravo....!