DragonFly kernel List (threaded) for 2007-05
Re: firmware loading
On 5/12/07, Matthew Dillon <firstname.lastname@example.org> wrote:
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.
i thought of it but i can't understand the implications of Intel's
(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.
(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.
I think (3) is the best way to do it as it would relieve me from
writing the user-space utility.
Something is wrong up on cloud # 9!