12

I'm being confused by the use of firmware in the context of Linux.

My understanding of firmware & driver is that firmware is the code that runs on the bare metal of a device such as a Bluetooth IC, or keyboard controller, or video card, or a single-purpose micro-controller. The firmware exposes an interface for the OS to use its services.

The driver, in comparison, is the software that the kernel uses to communicate with previously mentioned interfaces provided by the firmware. Thus, a video driver, a keyboard driver, a bluetooth radio driver.

So why is it that I keep reading about Linux firmware files having to be installed (e.g. here). Do these get uploaded into the hardware? Are these files used by the kernel? What is the meaning of firmware in this context?

  • 1
    Generally speaking: Software is a program. Hardware is a physical device. Firmware is a program integrated into hardware; typically for the purposes of configuring how the hardware works (so it is sort of between software and hardware, just as 'firm' is between 'soft' and 'hard' on a scale of bluntless). Generally, firmware is OS-agnostic (for example, the RAID configuration on an SCSI RAID controller). – DopeGhoti Apr 19 '17 at 17:27
  • Just to add to DopeGhoti's comment, many devices now allow live firmware loading making them more flexible/evolutive than fixed implementations. – Julie Pelletier Apr 19 '17 at 17:37
  • 1
    @DopeGhoti it doesn’t just configure the hardware, it runs on the hardware. Some firmware is very complex indeed and basically runs a mini-OS. – Stephen Kitt Apr 19 '17 at 17:53
  • I agree, though I would assert that "software integrated into hardware" implies that the hardware is that upon which said software runs. (: – DopeGhoti Apr 19 '17 at 18:20
19

In the Linux kernel context, firmware is software which runs on another processor in the system, e.g. a wireless controller, a GPU, a SCSI controller... This software used to be stored in ROM (of various types) attached to the relevant controller, but to reduce costs and make upgrades simpler, controllers now tend to rely on the host operating system to load their firmware for them.

So firmware files aren’t used by the kernel, they’re loaded by the kernel onto other pieces of hardware. This is also what makes it vaguely acceptable to have software without source code in FLOSS systems: the argument goes that it’s not running on the main CPU but on another device.

  • 1
    You are being very benevolent with your use of "vaguely acceptable". – Rui F Ribeiro Apr 19 '17 at 20:01
  • 1
    Not everyone can be RMS. – DopeGhoti Apr 19 '17 at 20:37
  • That's not just in the Linux kernel context, it's a fairly general definition of “firmware” in the context of a multi-processor system. – Gilles Nov 27 '17 at 7:40
  • So does /etc/lib/firmwares actually contain firmwares and not drivers loaded by the kernel at boot? But wireless controller and graphic cards have their own ROM with a firmware burned by the manufacturer. – defalt Nov 27 '17 at 8:10
  • 2
    @defalt yes, /lib/firmware (singular, no /etc) contains firmware used by other devices. Many devices (including wireless controllers and GPUs) need firmware provided by the host system, even though they may have their own ROM (or flash) containing firmware. – Stephen Kitt Nov 27 '17 at 8:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.