Re: Moving data from kernel to user space

Jonathan Bartlett <[email protected]> Fri, 9 Jul 2004 14:15:51 -0700 (PDT)
Newsgroups gmane.linux.redhat.devel
Message-ID <[email protected]>
> What is the best way to go about doing this?
>
> The module will be collecting huge amounts of data. So
> I guess it would be best if the user app keeps
> querying the module for data in a periodic fashion.
> Once the task is done the user mode app can remove the
> module.

Maybe a better way would be for the module to install a syscall or similar
entry, and the userspace program could provide a buffer to store the data
in.  Then, kernel space wouldn't have to worry about masses of data, and
just use copy_to_user() to transfer the data into the given buffer.

When the program wants to finish gathering data, they just call another
system call, and maybe have another system call for changing buffers.  You
might also have a signal that is delivered when the buffer needs changing.

Jon
----
Learn to program using Linux assembly language
http://www.cafeshops.com/bartlettpublish.8640017