FIFOsFrom the mailinglist:
Q: I have a kernel/RTAI module which open [rtf_create()] a RTAI fifo and write on it with [rtf_put()] periodically. On the other hand there is Linux process which uses the same RTAI fifo, open it with the normal unix open() and read it with the read() function. When the kernel module is installed after the execution of the Linux process, there is no problem. I get evrything right from the beginning. But when I start/kill/start again the Linux process after installing the RTAI module, I get sometimes wrong data. The read() seems to be synchronous of the rtf_put() but the data are meaningless for a while until it returns right.
A: Try resetting the FIFO in your Linux process on startup. Furthermore reset (rtf_reset()) and resize (resize()) the FIFO to the right size in your Kernel module each time you notice that the rtf_put command did not write all the data. In my application the FIFO-size was changed to the default size of 1K in these cases and I still don't know why.
Q: I want to exchange data between a kernel module and an user space task?
A: To use the same semaphore in user and kernel space, use semaphores associated to fifos..;
rtf_sem_init() rtf_sem_post() rtf_sem_get()
A: There should be rtf_overwrite(int fd, void *buf, int count), even if it might not have been used very much. Much more tested should be the same functionality under mailboxes. You can use them as a full fifo substitute with (NEW)LXRT support.