Date: Wed, 3 Apr 2002 17:40:29 +0200 (MET DST) From: Magnus B{ckstr|m <b@etek.chalmers.se> To: "Kreider, Carl" <carl.kreider@windriver.com> Cc: freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: read a file from a driver Message-ID: <Pine.OSF.4.21.0204031722050.28379-100000@downy.etek.chalmers.se> In-Reply-To: <20020403101614.A12363@indy.doctordesign.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 3 Apr 2002, Kreider, Carl wrote: > 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? The way this is usually done is by having the driver implement some interface (e. g. an ioctl) through which a user-mode utility can download the data to the hardware. Have the utility run at boot along with all other boot-time stuff, i. e. /etc/rc*. (Anecdote: I knew an Ultrix system years ago with a PXG (IIRC) accelerated graphics adapter that needed a firmware download at boot time. At one time the firmware file, or the dowload gizmo, somehow suffered bit rot -- which resulted in some really bizarre glitches in the graphics rendering...) Magnus To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.OSF.4.21.0204031722050.28379-100000>