Debian Developers - How the kernel firmware loader works

This is Interesting: Free IT Magazines  
Home > Archive > Debian Developers > January 2006 > How the kernel firmware loader works





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How the kernel firmware loader works
Marco d'Itri

2006-01-06, 5:58 pm

Gated from my blog.


(#104) How the kernel firmware loader works

fEnIo[0] learnt an important lesson about the kernel firmware loader:
it (usually) does not work as expected for non-modular drivers.

The reason is that the request_firmware()[1] interface is synchronous.
Since it's usually called in the initialisation section of drivers, the
userspace firmware loader is not available yet if the calling driver is
built-in in the kernel. The request_firmware_nowait()[2] asynchronous
interface was designed to replace it, but most drivers have not been
ported yet.

When a driver calls request_firmware(), a uevent[3] is sent by the
kernel to udev over a netlink(7) socket, requesting that a specific
file is uploaded. udevd runs /lib/udev/firmware.agent, a simple shell
script which will look for the $FIRMWARE file in a few directories and
then copy it to the designated place in the driver $DEVPATH in sysfs.

If the driver is initialised before userspace is started then the
loader will not be available, and the request will fail. A possible
solution is to run udev in the early userspace environment (initramfs),
but just compiling the driver as a module is usually simpler.

[0] http://jabba.uaznia.net/fEnIo/id/8689
[1] http://lxr.linux.no/ident?i=request_firmware
[2] http://lxr.linux.no/ident?i=request_firmware_nowait
[3] http://lxr.linux.no/ident?i=kobject_uevent

Posted at 23:57:34. [http://blog.bofh.it/id_104]
-----------------------------------------------------------------------------

--
ciao,
Marco


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Bartosz Fenski aka fEnIo

2006-01-09, 11:02 pm

On Sat, Jan 07, 2006 at 12:05:48AM +0100, Marco d'Itri wrote:
> (#104) How the kernel firmware loader works
>
> fEnIo[0] learnt an important lesson about the kernel firmware loader:
> it (usually) does not work as expected for non-modular drivers.


Yeah... thanks a lot for your explanation. I'm now a little smarter.

> The reason is that the request_firmware()[1] interface is synchronous.
> Since it's usually called in the initialisation section of drivers, the
> userspace firmware loader is not available yet if the calling driver is
> built-in in the kernel. The request_firmware_nowait()[2] asynchronous
> interface was designed to replace it, but most drivers have not been
> ported yet.
>
> When a driver calls request_firmware(), a uevent[3] is sent by the
> kernel to udev over a netlink(7) socket, requesting that a specific
> file is uploaded. udevd runs /lib/udev/firmware.agent, a simple shell
> script which will look for the $FIRMWARE file in a few directories and
> then copy it to the designated place in the driver $DEVPATH in sysfs.
>
> If the driver is initialised before userspace is started then the
> loader will not be available, and the request will fail. A possible
> solution is to run udev in the early userspace environment (initramfs),
> but just compiling the driver as a module is usually simpler.


So I suppose that it shouldn't be possible to compile in such drivers, if
they work only as a module. At least since they aren't ported to new
interface.

Anyway, once again thanks for explanation, and now I'm glad that I posted
this question in blog, otherwise I would probably lost more time to figure
out what's going on.

regards
fEnIo

--
,''`. Bartosz Fenski | mailto:fenio@debian.org | pgp:0x13fefc40 | irc:fEnIo
: :' : 32-050 Skawina - Glowackiego 3/15 - w. malopolskie - Poland
`. `' phone:+48602383548 | proud Debian maintainer and user
`- http://skawina.eu.org | jid:fenio@jabber.org | rlu:172001

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com