From owner-freebsd-hackers Wed Apr 3 7:38:49 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id D4E9A37B416; Wed, 3 Apr 2002 07:38:42 -0800 (PST) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.2/8.12.2) with ESMTP id g33FcE4F040836; Wed, 3 Apr 2002 17:38:14 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: "Kreider, Carl" Cc: freebsd-questions@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: read a file from a driver In-Reply-To: Your message of "Wed, 03 Apr 2002 10:16:14 CDT." <20020403101614.A12363@indy.doctordesign.com> Date: Wed, 03 Apr 2002 17:38:14 +0200 Message-ID: <40835.1017848294@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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-hackers" in the body of the message