If firmware is a CS concept, how is it defined?

I have a problem understanding the term firmware (as a type of software);
If it is a CS concept, it might be good to ask about it here to get a formal definition and a correction for my mistake, as a solution.

I recall from different lectures by Richard Stallman that firmware is usually a non-free software hence its source code (or compiled code, I guess) is embedded in hardware and therefore cannot be studied and changed per need (hence also cannot be deleted).
This made me confused in the following manner:

If firmware is software that isn't stored "virtually" in memory but is rather embedded in hardware ("written metally") as hardware-architecture, how can it be upgraded say as in a Bios upgrade but not ever deleted?
For example, I can upgrade an Apple iphone's OS in kernel, but never delete it and I misunderstand why.

3

2 Answers

“Firmware” is a rather fuzzy concept. The exact boundary between what counts as firmware and what doesn't depends on the context.

Firmware is generally code that is not the main operating system nor software that runs on top of the main operating system. But this definition leaves some wiggle room.

In the context of peripherals on a computer, firmware as opposed to drivers has a precise definition: a driver runs on the main processor (CPU) as a component of the main operating system, whereas firmware runs on an auxiliary processor (GPU, disk controller, network controller, …). The firmware for such peripherals may be supplied with the peripheral and stored EEPROM or flash memory, or the driver may load it into RAM on the peripheral — it depends whether the peripheral has persistent memory. If the firmware is not provided with the peripheral, it usually comes as a “binary blob” which manufacturers do not document.

In other contexts, firmware can also mean code that runs on the main processor. Firmware is software that runs on some lower level than the operating system. Or, if you're a firmware or operating system developer, your software may be somebody else's firmware, while somebody else's firmware is your software — firmware is below software on the stack, but the boundary depends on who you talk to. For example, an OS developer typically considers BIOS and UEFI to be “firmware”, but the developer of a portable UEFI implementation might think of their software as an application running on top of firmware made by the hardware manufacturer.

Another possible definition of firmware is that it's software sold with the hardware, as opposed to software that can be installed later. But there's some inconsistency in how this definition is applied. It's common to call the operating system on a mobile phone “firmware” but not on a PC.

How hard it is to upgrade or modify firmware depends on what tools the hardware manufacturer provides and what restrictions they put on it. For a peripheral with persistent storage, the interfaces to upgrade firmware may or may not be documented, and may or may not be implemented in the driver for this or that operating system. For an autonomous device, upgrading the firmware may be doable via some graphical interface (upgrading the OS on a phone or on some routers), or may be doable with the help of some external hardware and software (e.g. connecting a USB dongle of the right format, or connecting to a JTAG port, or yanking out the EEPROM chip).

The reason to have non-open-source firmware (whatever the definition) is a purely social construct: there is no technical reason why firmware should be less open-source than any other kind of software.

3

I think you are confused about the "understanding / studying" part.

Firmware is compiled and embedded in the hardware, so it's "harder" to understand than high-level programs. And end users cannot easily inspect and modify this firmware. That doesn't mean it's not an executable object (a program) with proper semantics. In fact, people do reverse engineer firmware to understand exactly how it interfaces with the hardware. It just requires a lot more effort to fully understand what a compiled low-level program exactly does. However, many firmware are also open source, and you can choose to flash one of them onto your hardware.

Also, firmware is stored in some form of memory, and can be erased. This memory however is nonvolatile, unlike RAM, so the written firmware persists across multiple power cycles, till it is explicitly erased / rewritten via flashing.

When you upgrade your iPhone firmware, it is very much possible to delete it completely -- it's just that Apple's software makes it much harder for end users to make such mistakes.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like