:i have a device buffer in contiguous physical memory. i want to write
:that buffer into
:a file disk. for that ive written a simple ioctl which works similar to
:the syscall
:write. except that it transfers from kernel space instead of user
:space. my user
:program calls this ioctl with the write file desc....the ioctl calls
:fp->f_ops->fo_write after setting up the uio to do the transfer.
:
:earlier the user code looked like:-
I think it would be a whole lot easier to implement mmap() on the
device, then allow the user process to mmap() the device buffer
and read() and write() it directly. I don't think you need to
implement any ioctl's for this problem.
fd = open device
ptr = mmap(...)
fd = open file
read(fd, ptr, BUFSIZE) read from file, store into device buf
...
write(fd, ptr, BUFSIZE) read from device buf, store into file
-Matt
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message