* Re: Accessing file from drivers (fwd) [not found] <Pine.LNX.4.21.0103160943270.9927-100000@localhost.localdomain> @ 2001-03-16 5:32 ` Soumya Desai 2001-03-16 8:28 ` Stefano Coluccini 2001-03-16 15:06 ` Wolfgang Denk 0 siblings, 2 replies; 3+ messages in thread From: Soumya Desai @ 2001-03-16 5:32 UTC (permalink / raw) To: wd; +Cc: gopi, linuxppc-dev > Hi Wolfgang, The exact problem that we're trying to solve, is to program an FPGA with a hex file which is in our file system. But the problem is general is to have a way to write a system call say 'sys_copy' which will copy one file to another. An user-mode application would read from one file and write back to another, which would result in copying the data from the file driver ( kernel space ) to the user-space, and again back to the kernel space. We were curious as to whether a way existed by which we can do the read and write, sitting in the kernel space itself. Of course adding our own ioctl to the drivers will serve the purpose, but we were looking for some way in which we would NOT need to modify the existing file system drivers. I was wondering if it would be possible to bypass the read/write call themselves, but hack our way into the buffer caches of block drivers, to do this ? Anyone tried something similar ? Regards, Soumya. > > ---------- Forwarded message ---------- > Date: Thu, 15 Mar 2001 15:04:31 +0100 > From: Wolfgang Denk <wd@denx.de> > To: gopi@tejasnetworks.com > Cc: linuxppc-dev@lists.linuxppc.org > Subject: Re: Accessing file from drivers > > In message <Pine.LNX.4.21.0103151822090.9108-100000@localhost.localdomain> you wrote: > > > > Is it possible to read and write to files (say /etc/xyz) > > in a device driver without resorting to user space? I want > > You do not want to do this. It's bad design. Implement an ioctl() for > the configuration, and use that. > > Wolfgang Denk > > -- > Software Engineering: Embedded and Realtime Systems, Embedded Linux > Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd@denx.de > "Send lawyers, guns and money..." - Lyrics from a Warren Zevon song ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/ ^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Accessing file from drivers (fwd) 2001-03-16 5:32 ` Accessing file from drivers (fwd) Soumya Desai @ 2001-03-16 8:28 ` Stefano Coluccini 2001-03-16 15:06 ` Wolfgang Denk 1 sibling, 0 replies; 3+ messages in thread From: Stefano Coluccini @ 2001-03-16 8:28 UTC (permalink / raw) To: Soumya Desai, wd; +Cc: gopi, linuxppc-dev > Hi Wolfgang, > > The exact problem that we're trying to solve, is to program > an FPGA with a hex file > which is in our file system. But the problem is general is to > have a way to write a > system call say 'sys_copy' which will copy one file to > another. An user-mode > application would read from one file and write back to another, > which would result in > copying the data from the file driver ( kernel space ) to the > user-space, and again > back to the kernel space. We were curious as to whether a way > existed by which we can > do the read and write, sitting in the kernel space itself. I don't know if I well understand the problem, but it seems to me that you can use the mmap system call ... ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/ ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Accessing file from drivers (fwd) 2001-03-16 5:32 ` Accessing file from drivers (fwd) Soumya Desai 2001-03-16 8:28 ` Stefano Coluccini @ 2001-03-16 15:06 ` Wolfgang Denk 1 sibling, 0 replies; 3+ messages in thread From: Wolfgang Denk @ 2001-03-16 15:06 UTC (permalink / raw) To: Soumya Desai; +Cc: gopi, linuxppc-dev Dear Soumya, in message <3AB1A57E.669B3166@tejasnetworks.com> you wrote: > > The exact problem that we're trying to solve, is to program an FPGA with a hex file > which is in our file system. But the problem is general is to have a way to write a I thought it was something like that. The conventional way to solve this is implementing an ioctl() call for this function, and use a user-space program to select the file and feed it into the driver. > system call say 'sys_copy' which will copy one file to another. An user-mode > application would read from one file and write back to another, which would result in > copying the data from the file driver ( kernel space ) to the user-space, and again > back to the kernel space. We were curious as to whether a way existed by which we can > do the read and write, sitting in the kernel space itself. Of course adding our own Why do you want to do that? Is this such atime-critical operation? Of course it's possible to implement such a function, but I'm not sure if it really makes sense. > ioctl to the drivers will serve the purpose, but we were looking for some way in which > we would NOT need to modify the existing file system drivers. I was wondering if it Ummm... I don't understand this sentence. Adding an ioctl() for YOUR OWN driver to accept a buffer with FPGA image date and load that image into the FLGA does not mean you have to modify anything else. You just have to write a small user application which opens the file, reads or mmap()s it, and calls that ioctl(). > would be possible to bypass the read/write call themselves, but hack our way into the > buffer caches of block drivers, to do this ? Anyone tried something similar ? Possible? Sure it's possible. But there is some effort involved, and your resulting solution is probably very restricted to a specific setup. What do you want to save that you are willing to pay such a price for? Wolfgang Denk -- Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd@denx.de I have the simplest tastes. I am always satisfied with the best. -- Oscar Wilde ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/ ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-03-16 15:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <Pine.LNX.4.21.0103160943270.9927-100000@localhost.localdomain>
2001-03-16 5:32 ` Accessing file from drivers (fwd) Soumya Desai
2001-03-16 8:28 ` Stefano Coluccini
2001-03-16 15:06 ` Wolfgang Denk
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).