The HyperNews Linux KHG Discussion Pages

Question: writing to user file directly from kernel space, How can it be done?

Forum: The Linux Kernel Hackers' Guide
Keywords: driver write memory file help
Date: Wed, 06 May 1998 08:54:05 GMT
From: Johan <d3sunden@dtek.chalmers.se>

Hello, I am collecting data at a high rate into a circular buffer residing in my driver. I want this data to be written to disk or network. To avoid unnecessary copying from kernel space to user space to kernel space again I want a application to open a file or socket and then do a ioctl to my driver which I then want to start performing write's from the buffer to the file/socket using the file operation write in the file block of the opened file. Unfortenaly for me I get a page fault when I try f_op->write(...). My buffer is in the kernel whith a kernel address but the write wants a virtual address (I guess).

How can I get around this? Other ideas?

I use Linux 2.0.33

Thanks in advance/ Johan