Memfault State of IoT Report

Firmware vs Software vs Hardware vs Device Driver, what are the differences?

Started by stephaneb 6 years ago8 replieslatest reply 1 year ago4786 views

Once we are done here, the goal is for this thread to become a great place to learn about the differences between Firmware, Software, Hardware and Device Driver.  If I forgot a term or two that you believe should have been included, please do not hesitate to mention it in your answer.  


[ - ]
Reply by dcblackFebruary 2, 2023

I must start by establishing that we are talking here about electronics as understood in the embedded world. Otherwise, hardware could refer to a rake or a hammer purchased at a "Hardware" Store, and I don't think that is the purpose of this forum.

Traditionally, three of these terms are related: hardware, firmware, software.

Hardware refers to the physical aspect of electronics and once designed and put into production, it is "hard" to change. The cost of changing hardware is very high. Hardware is the processor, but almost never the code that runs on it.

Software refers to the other end of that spectrum. Software is the code that runs on a processor. Because it is "soft", changes are relatively easy to propagate to the end product. Software used to be distributed on tapes or floppy disks. Now-a-days, software is often obtained over the Internet.

Firmware is also code that runs on the processor, but is in between hardware and software because it may be physically implemented in harder to modify forms of memory (e.g. one-time fused Read-Only memories or EPROMs). Thus it is "firm", which is somewhat between hardware and software in the ease of modifications. It is more commonly placed in FLASH memories in modern times. Thus firmware is relatively easy to update, but still takes some effort and time.

Device Drivers are a completely different category and represent a form of code that may be placed in software or firmware (never hardware though). There are many forms of "devices" that have "Device Drivers". Device drivers represent code that handle very low-levels of control over devices (also known as peripherals or I/O) with a simpler interface for higher levels of software (higher abstraction levels). It is quite common for device drivers to be part of the firmware; however, operating systems (another type of software) such as Linux have device drivers as part of their architecture and can be in the form of software that is dynamically loaded during operation.

[ - ]
Reply by Tim WescottFebruary 2, 2023

Having worked in a number of different places over a number of decades -- it overlaps.  And it changes.  Walking into any new situation, you should always be sure you know who means what -- and it won't necessarily be the same as (or any better or worse than) the last place you were in.

"Software" can mean anything from "only that which runs on a PC (or mainframe)" to 42 words of PIC-12 assembly code that comprise the entire program loaded on a teeny micro.

"Firmware" can mean anything from "only that which configures FPGAs" to "anything that's inside the box" (meaning, an 8-core Pentium running at 5GHz, with a 5TB disk, may be running something called "firmware" in some places).

"Hardware" can mean anything from just mechanical stuff (with circuit boards being "electronics" or "circuits"), to that which strictly pertains to chips-on-a-board, to the serial flash or EEPROM chips containing that which configures FPGA's (AKA, "firmware").  In a mixed group of EE's and mechanical engineers, the word "hardware" may change meaning depending on who you're talking to at the moment.

A device driver is the piece of code that provides an interface to an electronic item (FPGA, some actual real live chip, etc.) on the one hand and some sort of a consistent API* on the other.  The term may also refer to some virtual device (i.e., if I want at driver that looks like a UART to you, but actually tunnels all of the communications over Ethernet to some UART a mile away, that's definitely a "driver", but we may debate over whether it's a device driver.

* Definition of API in a different post, please!

[ - ]
Reply by lmitchamFebruary 2, 2023

Having done programming on PC’s as well as in the embedded world, my definitions are:

HARDWARE: Any physical electronic device or component. This can include a microprocessor, resistor, hard drive, Bluetooth module, or any other physical device that you can touch and that can break.

SOFTWARE: This is the code that can be written in any programming language, and is stored on a hard drive or Solid State Drive and runs on a PC, MAC, or other computer. Software can be created to perform virtual tasks, such as a CAD program or word processor. Software can also be created to interface with external devices in the “real world”, such as a printer or the internet. Software can be changed, using a development environment, on the host computer, and will not affect the operation of the computer system unless it is “called” to run on the operating system.

FIRMWARE: This is similar to software in that it can be written in almost any programming language.However, firmware is stored on a medium that is usually internal to a processor, but can also be stored on an external medium such as a FLASH, EPROM, or EEPROM chip. Firmware is also different from software in that it cannot be changed on the host because firmware controls a single processor chip and how it interfaces to external devices. For example, the processor of a computer system has a BIOS (Basic Input Output System) which is the firmware that controls the main processor (Intel or AMD, etc …) of a computer system. Firmware is created by software that is specific to the target processor and includes an editor, compiler, and linker, and requires an operating system on a computer system for development. The resulting firmware is then burned, flashed, or somehow transferred from the computer development platform to the embedded processor. Firmware cannot be called, but runs as soon as a power up or reset condition is met on the target processor.

DEVICE DRIVER: This is common to both software and firmware and can also be written in many different programming languages. The purpose of a device driver in software is to be the template or instruction manual, if you will, that provides the computer system with the “keys” to interfacing with an external device. The device driver “tells” the operating system how to send information to a printer, for example. It identifies the communication interface and all of the specifications to format a page on a specific printing device. Every device has to have a device driver that is specific to its model and manufacturer, for example an HP printer has a different device driver than an Epson. A device driver in firmware is created for the target processor to interface with external peripherals through its pins. This interface can be simple logic I/O that is connected to other ICs on the circuit board, such as I2C, SPI or a parallel logic interface. This is usually a very low level of control on the register level. Firmware can also be created to interface with off board devices using serial interfaces (RS-232 or USB for example) and are pretty much tied to that specific interface, due to the hardware design of the circuit board.

[ - ]
Reply by JackCrensFebruary 2, 2023

I guess I'll lose this competition because I'm not going to try to answer the question directly, but talk in more general terms.

First of all, I reject any notion that software is related to stuff that goes in PCs or Macs.  We're supposed to be talking about EMBEDDED stuff here, right?

Second, we're talking about things that involve digital computers, be they microcontrollers or "giant brains."  No analog computers allowed.  Otherwise, notions like software and firmware make no sense.

That said, I think there's only two main kinds of "ware"

  • Hardware:  The CPU(s) and any devices connected to them(e.g. ROM,RAM, A/D/A converters, comparators, serial <> parallel converters, USB, Ethernet, etc. etc.
  • Code that runs in the CPU(s)

Firmware, software, device drivers -- they're all code.  And sometimes the boundaries can be a little fuzzy.  In general,

  • Software is code that can be easily changed, whether it's via disk, memory stick, Ethernet, or even the code in a spacecraft halfway to Jupiter.  
  • Firmware is code that's not easily changed (or impossible to).

Used to be, software ran in RAM, firmware in ROM, i.e. PROM or EEPROM. Nowadays, with ROM like TI's FRAM Flash, the distinction is rather meaningless.

Ca. 1979 I worked for an aerospace company that built flight systems. The firmware guys there were adamant that because they were developing firmware instead of software, they didn't need to adhere to software development standards and methodologies.

I reject that notion, too.  When the code is hard to change, you need _MORE_ careful and formal methodology, not less.

[ - ]
Reply by BVRameshFebruary 2, 2023

Hardware is the electronic unit on which the product is built to perform, which has sensor interface, analog circuit, ACD, DAC, relays, power supply, controller, CPLD, FPGA, memeory, communication interface, display, switches, keyboard, mechanical box, with mounting, cooling, all equally important.

Firmware is the code for pure hardware devices like CPLD, FPGA, and for the code which stay on hardware unit itslef as XIP (execute in place) like boot code, Board support packages, BIOS, test and diagnostic code. Firmware is a code which do not need any operating system interface and can work as stand alone code found in low end devices like field sensor, actuators, display aor human interface units.

Software is the code, which can be loaded from storage devices or communicating interface. This include high end operating system like linux, windows, android, and communication interface system like browsers and simulation of one system on others like Virtual system, VM ware, virtual box. The sotware also include application code develpoed on operating system or browser and database system with a wider interface to world like cloud.

Device driver is a code on and above hardware. In case of firmware a device driver will be a part of it and does all the functionality of the device required for the functioning, testing and diagnostics of the product. In high level operating system device driver is a code which will be part of kernel code for functioning of the complete system and device driver will be an additional code which will be a part of application software which requires a different behavoiur than the existing system.

[ - ]
Reply by Bob11February 2, 2023

Firmware: code that compiles down to bits to control a device in real-time, eg, Verilog code for an FPGA. Typically parallel execution at the lowest level.

Software: code that compiles down to bits to control a device in non-real-time, eg, C code for a microprocessor. Typically serial execution at the lowest level.

Hardware: if I can physically hold it in my hand, it's hardware.

Device Driver: software that controls hardware devices--perhaps programmed with firmware--in near-real-time, typically using hardware-derived signals.

Real-time is defined as hardware speed, ie, as fast as signal lines on an IC can toggle. A 'real-time' operating system is not truly real-time, it's just deterministic in its scheduling response (or close enough).

[ - ]
Reply by SolderdotFebruary 2, 2023

Hardware is the physical device or Gadget, which may be operated by a processor or Controller.

Firmware is the software that is running embedded in such a device or gadget, normally invisible. So if you look into your router you will find a quite powerful processor which is driven by some quite complex piece of software, and since this software is embedded into the device and not really exposed to the end-user it is Firmware.

Software is a piece of software which is meant to be interacting with the user. In your PC you have Windows, MacOS, Linux, Word, Excel, etc. all those pieces are Software. The BIOS is also quite complex but you do not interact with it (except via the BIOS setup utility), so the BIOS is firmware.

Of course the differences between firmware and software are gradually and you often can argue whether a piece of code is software or firmware. A few years ago you could find barriers in car parks which were operated by a MS Windows System - in those installations even that MS Windows installation can be considered firmware.

Of course, the ability to change or upgrade software is also suitable for discriminating software from firmware. Software is normally way easier to change than Firmware. Still I would not use the term "Firmware" for the Android running on my cell phone. In my eyes the apps are clearly "Software".

Device drivers are pieces of software which expose an abstract interface for accessing Hardware. You can imagine that you there are multiple WIFI chips from different manufacturers and each of the needs being accessed in it special way. You can have device drivers for each of those devices, each accessing the device as it requires but still exposing the same interface to the overlying software.

You can find device drivers in both firmware and software.

Memfault State of IoT Report