Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 03 Apr 2002 10:44:17 -0500 (EST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        freebsd-hackers@FreeBSD.ORG, freebsd-questions@FreeBSD.ORG, "Kreider, Carl" <carl.kreider@windriver.com>
Subject:   Re: read a file from a driver
Message-ID:  <XFMail.20020403104417.jhb@FreeBSD.org>
In-Reply-To: <40835.1017848294@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help

On 03-Apr-2002 Poul-Henning Kamp wrote:
> 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.

Or load the firmware using kldload or from the loader using a type string
similar to the way we do MFS root filesystems.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

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?XFMail.20020403104417.jhb>