1
\$\begingroup\$

Recently reading about Linux and its folder /lib/firmware, I read that firmware is not needed to "live" on the device, that some network devices dont have any ROM to store a firmware. How is this possible if its definition is that is software that is present on the device and it software that runs on the device? Or maybe its called firmware buts its some kind of driver?

I understand that software drivers are the ones which know the "api language" of the device and what data or instructions send to this to do something but its needed a firmware on the device because its a software "listening" to these instructions from a physical port on the device and executing some code after these instructions are received. I dont know if I got it wrong

Thanks

\$\endgroup\$
1
  • 2
    \$\begingroup\$ There is always firmware built into devices, but some have more or less stored locally. \$\endgroup\$ Commented Jan 13, 2021 at 23:52

2 Answers 2

2
\$\begingroup\$

This is done various ways. Think of it as a bootloader perhaps. Either purely in hardware or combination of hardware and software, the device would need just enough functionality to show up on whatever bus (USB, PCIe, etc)(get enumerated), but also be identifiable as some product. Then the driver will download the latest application firmware so that it does not have to be burned to flash every time an update is available and also flash is expensive.

It can be a case with usb for example that the logic in the chip can enumerate as a simple device, the firmware is downloaded into sram, then the logic or that software then re-enumerates by electrically disconnecting then reconnecting but reconnecting as per the software/firmware has chosen to use the device.

PCIe does technically have a re-enumeration thing but not the kind of thing you would use for this.

So it is not a chicken and egg problem, there is logic or firmware or a combination of the two that gets the item on the bus initially but the full featured product firmware is then downloaded.

If there is firmware on the device in order to facilitate this it may be a mask rom or a rom (or flash) on the part that the chip vendor has provided for the chip customers. Or it may be the case that the chip level product does not support anything like this but the system design for the product is to have just enough firmware to get started and then the rest downloaded live.

So if there is software/firmware involved (in getting on the bus in the first place) there is some form of non volatile storage containing code on the product, so it is not a case of there is zero rom/flash but maybe less rom/flash than if the whole of the firmware lived on the product.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks, but from the electronic way speaking, I understand that this kind of "firmware software" that lives outside the device, its l"oaded" into the device in any way and executed by the "microcontroller" from this device, right? \$\endgroup\$ Commented Jan 14, 2021 at 23:04
  • 1
    \$\begingroup\$ Yes the items in /lib/firmware are downloaded into the device runtime (when the driver loads it) and that code is run on the device. Each vendor does that a different way, might be exceptions where the firmware isnt used, etc...But the concept is, driver detects the device, driver knows there is firmware to download, downloads the firmware and the assumption from there is that device switches over and runs that firmware. \$\endgroup\$
    – old_timer
    Commented Jan 15, 2021 at 0:50
0
\$\begingroup\$

Firmware is whatever resides on the device even when the device is powered down and which provides some control over the device's behavior. As user1850479 points out, all devices have firmware, even if it is just wiring. "Firmware" that is loaded via network on power-up, is not "firmware", but software. It may be the kind of software that does the work that "firmware" often does, but it is software, because it is loaded from elsewhere on power-up.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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