From owner-freebsd-hackers Wed Apr 3 7:44:25 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mail12.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by hub.freebsd.org (Postfix) with ESMTP id 26EC737B41A for ; Wed, 3 Apr 2002 07:44:18 -0800 (PST) Received: (qmail 8450 invoked from network); 3 Apr 2002 15:44:17 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 3 Apr 2002 15:44:17 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g33Fj0v23619; Wed, 3 Apr 2002 10:45:00 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <40835.1017848294@critter.freebsd.dk> Date: Wed, 03 Apr 2002 10:44:17 -0500 (EST) From: John Baldwin To: Poul-Henning Kamp Subject: Re: read a file from a driver Cc: freebsd-hackers@FreeBSD.ORG, freebsd-questions@FreeBSD.ORG, "Kreider, Carl" 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 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 <>< 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