Purpose and usage of firmware packages on Linux

473 views Asked by At

I have written firmware for many micro-controllers, like 8051, AVR, and ARM. So I have a clear idea what a firmware is.

Recently when I was updating my Linux distro, I noticed that there are many firmware related packages being updated, e.g. iwl3160-firmware, and iwl1000-firmware. They have files with .fw extension.

If a firmware is a piece of code, that is burnt into the non-volatile memory of an embedded controller, then what are these .fw files doing?

Is it that they are actually burnt into the respective devices' non-volatile memory at the time of a system update, or they are dynamically loaded into the device's volatile program memory every time the device is switched on? Or are they just vendor specific proprietary codes which are used by the kernel to access the device?

An answer with a specific example, say iwl3160-firmware, would be appreciated.

2

There are 2 answers

0
Funkyguy On

"Firmware" has become broader and evolved from code that is written to the NVM of a chip to more of a term referring to programmed middleware.

I haven't inspected these files myself but I can't imagine they are actually being burned in. I imagine they are just drivers that will take the high level input from the application level and convert it to operations for the low level hardware. Thats what firmware is now.

0
InfiniteZoom On

Contrary to the other answer posted here, this article states that a device's driver may indeed load the firmware to the device.

That article explains that the firmware files are used in this way when using Ubuntu:

  1. Driver requests firmware file "ar9170.fw"
  2. The kernel sends an event to udev asking for the firmware
  3. The udev program runs a script that shoves the data in the firmware file into a special file created by the kernel
  4. The kernel reads the firmware data from the special file it created and hands the data to the driver
  5. The driver then does what it needs to do to load the firmware into the device

Also, per this answer, modern devices are designed to grab firmware from the main OS that will be controlling it. This is why linux provides a bunch of firmware files in /lib/firmware.