Date: Wed, 03 Apr 2002 19:58:41 -0700 (MST) From: "M. Warner Losh" <imp@village.org> To: phk@critter.freebsd.dk Cc: carl.kreider@windriver.com, freebsd-questions@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: read a file from a driver Message-ID: <20020403.195841.89251387.imp@village.org> In-Reply-To: <40835.1017848294@critter.freebsd.dk> References: <20020403101614.A12363@indy.doctordesign.com> <40835.1017848294@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <40835.1017848294@critter.freebsd.dk> Poul-Henning Kamp <phk@critter.freebsd.dk> writes: : In message <20020403101614.A12363@indy.doctordesign.com>, "Kreider, Carl" write : s: : > : >I am working on an embedded project running FreeBSD, and my driver : >for our custom card needs to load an FPGA with code. I know I can : >compile the code in as data, but for ease of development, I would : >rather fetch the FPGA code from a file. With a driver in kernel : >space. Really. : > : >Can it be done? If so, how? open() and read() are obviously in libc : >which rules them out. Do I have to write my own in assembler? : : Don't even think about it. : : At the time your driver is probed/attached, there is no filesystems : mounted yet. : : Best suggestion is to use an ioctl to download the data from : userland. The other alternative that I've seen used is to have a module that loaded at the same time as the driver that has the firmware. This allows that second module to, in theory, be unloaded and the memory reclaimed. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020403.195841.89251387.imp>