Subject: Re: Where to put firmware?
To: Jason R Thorpe <thorpej@wasabisystems.com>
From: Lennart Augustsson <lennart@augustsson.net>
List: tech-kern
Date: 08/23/2002 04:30:49
Jason R Thorpe wrote:

>On Fri, Aug 23, 2002 at 03:46:27AM +0200, Lennart Augustsson wrote:
>
> > The firmware is 100kbyte, so I don't want to bloat the kernel
> > with it.  The firmware loader itself can happily live in the
> > kernel (it's easier for various reasons).
> > So this leads to my question: where in the file system should
> > I put the firmware?  I'd prefer to have it in the root file system,
> > but there's not good a place for it.  I guess /usr/lib/libdata might do,
> > if I don't insist on keeping it in the root.
>
>There's another problem with dynamically loaded firmware -- a proliferation
>of *ctl programs to load it.
>
Well, I actually want the loader itself in the kernel, I just want the files
outside the kernel.  I could live with a loader outside the kernel, but then
we need a mechanism to execute programs as devices are hot plugged.

>If we're going to go down this road of dynamically loaded firmware (and,
>hey, let's face it -- the cz driver's firmware is pretty big, too), then
>we should try to come up with some sort of "abstract-enough" interface
>for doing it.
>
>There are a few problems here, of course:
>
>	1. Different device vendors use different formats for their
>	   firmware.
>
>	2. Firmware can have metadata assocaited with it.
>
>We will need something that can describe the potentially multiple
>sections that the firmware will have.
>
>At first thought, we could hijack ELF for this ... have special programs
>that take the firmware contents and wrap it up in ELF program headers.  Then
>a simple ELF parser in the kernel to separate out the chunks as needed.
>  
>
I've not seen enough firmware&loaders yet to know if this approach would 
buy you
anything at all.  The gory details of how to load the firmware is always 
going to
be device specific.

    -- Lennart