Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Jul 1998 00:25:57 +0200
From:      Stefan Esser <se@FreeBSD.ORG>
To:        Robert_Wagner@dgii.com, freebsd-stable@FreeBSD.ORG
Cc:        Stefan Esser <se@FreeBSD.ORG>
Subject:   Re: driver needs to read file when loading
Message-ID:  <19980711002557.20337@mi.uni-koeln.de>
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
References:  <8625663B.00742455.00@msp-ln01.dgii.com>

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980711002557.20337>