On Saturday 12 May 2007, Matthew Dillon wrote:
quoted text > :is it really necessary to do it this way? cause i don't like the idea
> :of using a user space program for directing the driver to load the
> :firmware. instead the firmware can be loaded and cached during the
> :device attach routine.
> :
> :the firmware_image_load_file can be the appropriate candidate for such
> :functionality provided that it just returns the raw data from the
> :/etc/xxx firmware file without allocating the dma resources.
> :
> :Cheers
> :kmb
>
> The root filesystem will not be mounted during driver attach so
> the kernel will not have access to the filesystem. But there are
> a couple of other possibilities:
>
> (1) You could embed the firmware as a const char [] array in the
> source code itself. It would depend how big the firmware image
> is... if it's really big I'd rather not embed it in source code.
>
> There might also be a copyright issue with the firmware that
> prevents it from being embeddable in the source code.
>
> (2) The firmware could be loaded into kernel memory as a module by
> the boot loader. The boot loader does have access to the root
> filesystem (usually). The driver would then be able to locate and
> access it at attach time.
In FreeBSD we have firmware(9) to assist with building and accessing such=20
modules. It now also has support for licenses that require a user to=20
acknowledge something before they can use the firmware. See for instance=20
http://www.prweb.com/releases/2007/03/prweb509818.htm
quoted text > (3) There is a kernel firmware loading facility in
> sys/kern/kern_firmware.c. Again, the file cannot be loaded at
> attach time but this way you could have an ioctl that just passes
> the filename to the driver as part of the RC boot sequence
> and the driver could then use the kern_firmware.c facility to
> actually get an image map into kernel memory.
>
> Method #1 or #3 is probably the best way to do it. Method #2
> requires more configuration glue and changes in the loader config.
>
> -Matt
> Matthew Dillon
> <dillon@backplane.com>
=2D-=20
/"\ Best regards, |
mlaier@freebsd.org
\ / Max Laier | ICQ #67774661
X
http://pf4freebsd.love2party.net/ | mlaier@EFnet
/ \ ASCII Ribbon Campaign | Against HTML Mail and News