From owner-freebsd-stable Fri Jul 10 23:52:14 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA04055 for freebsd-stable-outgoing; Fri, 10 Jul 1998 23:52:14 -0700 (PDT) (envelope-from owner-freebsd-stable@FreeBSD.ORG) Received: from Octopussy.MI.Uni-Koeln.DE (Octopussy.MI.Uni-Koeln.DE [134.95.166.20]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA04050; Fri, 10 Jul 1998 23:52:05 -0700 (PDT) (envelope-from se@dialup124.zpr.uni-koeln.de) Received: from dialup124.zpr.Uni-Koeln.DE (dialup124.zpr.Uni-Koeln.DE [134.95.219.124]) by Octopussy.MI.Uni-Koeln.DE (8.8.8/8.8.8) with ESMTP id IAA09422; Sat, 11 Jul 1998 08:51:53 +0200 (MET DST) Received: (from se@localhost) by dialup124.zpr.Uni-Koeln.DE (8.8.8/8.6.9) id AAA01872; Sat, 11 Jul 1998 00:25:59 +0200 (CEST) X-Face: " Date: Sat, 11 Jul 1998 00:25:57 +0200 From: Stefan Esser To: Robert_Wagner@dgii.com, freebsd-stable@FreeBSD.ORG Cc: Stefan Esser Subject: Re: driver needs to read file when loading References: <8625663B.00742455.00@msp-ln01.dgii.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89i In-Reply-To: <8625663B.00742455.00@msp-ln01.dgii.com>; from Robert_Wagner@dgii.com on Wed, Jul 08, 1998 at 04:11:06PM -0500 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 1998-07-08 16:11 -0500, Robert_Wagner@dgii.com wrote: > when loading a pci driver I need to read in a firmware file for the > filesystem and put it in a place in memory. > > Any suggestions on how I can open a file and read it into a buffer in > the attach portion of the driver. > This driver is an PCI LKM. 1) It *is* possible to read a file from within the kernel, this has been discussed in the mail lists before. The driver could try reading the firmware from within the probe or attach code and could print meaningful messages if it doesn't succeed. 2) There could be a user land tool that loads the firmware after the LKM has been loaded, for example by means of an ioctl(). The real attach (or even the probe) may have to be delayed until after the ioctl() has been called. 3) A final linkage step of the LKM could combine the driver and firmware before the LKM is actually loaded into the kernel. That's all I found by thinking real hard about your problem for all of five minutes. So I assume there must be other and better ways ;-) Regards, STefan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message