Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 03 Apr 2002 17:38:14 +0200
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
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:  <40835.1017848294@critter.freebsd.dk>
In-Reply-To: Your message of "Wed, 03 Apr 2002 10:16:14 CDT." <20020403101614.A12363@indy.doctordesign.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
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.



-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

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?40835.1017848294>