The sequence of calls in user land:
Process 1:
buf_fd = open("/dev/buf");
ioctl(buf_fd, get_address_of_allocated_kernel_buf, &kernelbufaddr)
buf = mmap(kernelbufaddr, ...)
read(buf_fd, ...) /* blocks until another proc puts something in buf */
work on buf
close(fd);
Process 2
buf_fd = open("/dev/buf");
write(buf_fd, ...)
close(buf_fd);
The details are a bit more complicated than this, but I hope you get the idea.
I have looked at the mmap code of the mem device driver, but it seems it
doesn't do exactly what I want to accomplish. It expects a physical address
to be mapped (correct me, if I'm wrong), buf I have a virtual kernel address
from my call to kmalloc.
What code do I need in buf_mmap to map a piece of allocated kernel memory
to userland?
Any and all replies are appreciated.
K. Schuler
kschuler@freenet.columbus.oh.us