Hannes Mayer
2005-Jun-17 12:06 UTC
Kernel module/IPC with userland: create and write to FIFO
Hi all! I've modified a standard driver and now I'd like to create a FIFO in it to communicate / send data to a userland process. Opening, reading and writing to a FIFO in userland is easy, but I have no clue how to do this in kernel space. Googling and looking to the kernel source didn't help. The only thing I found is "kern_mkfifo" and int mkfifo(struct thread, struct mkfifo_args);, but no example on how to use them (if that's the right approach anyway). To cut a long story short, how can I open a FIFO in kernel space and write to it, so I can open and read from it in userspace ? Thanks in advance for any hints! Best regards, Hannes.
Daniel O'Connor
2005-Jun-17 12:29 UTC
Kernel module/IPC with userland: create and write to FIFO
On Fri, 17 Jun 2005 21:36, Hannes Mayer wrote:> To cut a long story short, how can I open a FIFO in kernel space and > write to it, so I can open and read from it in userspace ?Why don't you create a device node? If you read and write to it, it acts like a FIFO. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20050617/69c3b03f/attachment.bin
Hannes Mayer
2005-Jun-22 16:53 UTC
Kernel module/IPC with userland: create and write to FIFO
Daniel, Alexander, thanks a lot for your suggestions. So far I've made good progress. For the time being I'll buffer in kernel space - I'll look into the pipe stuff later. I just implemented tsleep and wakeup for the read blocking. After major problems when starting, this is going to be fun :-) Thanks again, Hannes.