Hi. If you have small amount of data and no hard real-time performance needed you can use slow copy_to_user/copy_from_user macros. The fastest way to share data between user space and several devices is to map physical memory into kernel and user's virtual spaces. This is a very interesting technique allows you to AVOID at least one data copy from user to kernel and back. If you are moving large amount of data plus performing DMA to/from your device(s) - this is the way. Now, there are several options to do that. 1. Allocate contiguous physical memory using bootmem_allocator (requires your driver to be built-in) 2. Allocate contiguous physical memory using mem=XXX parameter to get unmanageable chunk of memory. 'ioremap' the physical memory into kernel's space and implement 'mmap' to map the memory chunk into user virtual space and bingo! - you can access the chunk of memory from user and kernel space without extra or no copies at all. If you have DMA transactions - the memory is already contiguous. Using ioctls, spin-locks or other methods you can synchronize access to this shared memory from user applications and kernel methodes and isr. Regards, Konstantyn. -----Original Message----- From: Danilo Reinhardt [mailto:Danilo.Reinhardt@de.bosch.com] Sent: Monday, April 05, 2004 5:38 AM To: kernelnewbies@nl.linux.org Subject: Exchange Date Userspace<->Kernel Hi, I want to develop a driver that exchanges/modifies data between 2 devices. Now I try to find out whats the best way to do this. I think there are 2 ways to do it, the first by doing all work inside the driver, and the secondy by passing the data from the driver to an userspace programm which handles and forwards the data to the second device. Whats the fastest way to exchange data between the kernel and a userspace process and how fast is it? And on the other side, whats the best way to exchange data inside the kernel between 2 devices (which are handled by the same driver!). Thanks for all replies! Bye Dan -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/ -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/