Firmware vs Device Drivers: Explained with Examples!

In this article, let us learn what the term “Firmware” means and see how that differs from the term “Device Driver”. Let us also see how these 2 types of code fits in the spectrum of “Computing” with the help of a few examples!

I am sure all of us have come across the notification in one of our devices saying “Firmware update available” and asking us to keep the device either plugged into the power outlet or have at-least 50% of charge before pressing the button “Install”

Also all of us has at some point have googled problems related to some accessory not functioning properly and have found the solution to be to update the device driver.

So firmware and device drivers are both related somehow to the hardware in our system. But the question is how are they different? This article is about answering that question!

I have written this article keeping beginners in mind, hence I have tried not to use too much “Technical Jargon” in this article. So, let us begin!

For those of you in a hurry, here is the short version of the answer!

The Short Version of the Answer

Both Firmware and Device drivers are technically sub-classes of software and are strongly related to the hardware on our system. Other than these facts firmware and device drivers have some major differences. The table below shows the main differences between Firmware and Device drivers.

FirmwareDevice Drivers
Firmware is a class of software that is written for specific custom hardware. Device drivers are software that is needed to make a given hardware accessory work within a given operating system. Device drivers are tightly connected with and controlled by the operating system.
Firmware lives and runs directly on the hardware.Device drivers live on the hard-disk.
Firmware is independent of an operating system, i.e you can run any operating system on top of a given motherboard’s firmware. Device drivers are highly dependent on the operating system on which they are used. For example, for the same hardware device, you need different device drivers for using that on Windows vs Linux.
Firmware cannot be updated through an operating system, we need to go into the BIOS/UEFI to update the device driversDrivers can be updated from within the operating system.
Firmware engineers do not need any knowledge of operating systems. But they need core knowledge on processors and the latest RAMs, PCIe standards, and so on to write firmware that complies with the latest standardsDevice driver engineers need knowledge about the specific device that they are using, the communication standard the device uses to talk to the computer (like Bluetooth, USB, etc), and the operating system the device driver is written for.
Firmware is written by motherboard manufacturersDrivers are written by engineers in companies that produce hardware accessories that connect to your computer
Examples include the BIOS/UEFI interface that comes with the computer’s motherboardExamples include special software you install to handle the extra buttons on your mouse, software that comes with any non-standard hardware like special game controllers, also the software that helps us use all the standard hardware like USB storage devices, keyboards, mice, headphones, etc.

If you did not completely understand the above table, don’t worry as that is just the short version of the answer. Read on for the longer version of the answer below where I try to answer the following questions

  • What is firmware?
  • How firmware helps us with hardware?
  • What are some examples of firmware?
  • What is a Device driver?
  • How device drivers help us with hardware?
  • How firmware differs from Device drivers?

So let’s continue with more informative version of the answer!

Firmware vs Software

Typically software is built in the form of layers. Typical layers of software are shown in the figure below.

In terms of how far the software operates in terms of distance to the hardware, software can be classified into the following 4 types

  • Firmware
  • device drivers
  • operating systems and
  • applications

Though practically speaking almost all the famous operating systems come pre-loaded with device drivers if you look at things from a theoretical point of view operating systems and device drivers have different roles.

We use this layered approach because each layer of software requires expertise with specific technologies and knowledge on specific algorithms. So a typical team/organization usually focuses on only one of these layers to produce the best possible software product!

As you can see, the layer just above the hardware is called Firmware. Let’s first learn more about what firmware is!

Firmware

What is Firmware? Firmware is a computer program that is written to work directly on specific custom hardware and it lives in non-volatile memory such as a flash chip and it is executed directly from it. The job of the firmware is to make the hardware accessible to the operating system.

The firmware takes the physical hardware and presents it to the operating system, which then builds on top of it. In other words, Firmware can be thought of as the glasses through which the operating system can see the actual hardware!

The reason behind the name “Firmware”

There are 2 ways of thinking about this naming convention. The first way to think about this is that Firmware is a special program that sits between the hardware and all other types of software.

The second way of thinking about this naming convention is that it is not “hard” to change, at the same time it is not “easy/soft” to change. Hardware is hard to change, usually, the only way is to buy a new one and replace the old one. Software is easy to change. You can always install applications on your smartphones and computers with a few clicks.

But to change/update the firmware is not impossible like hardware, at the same time it is not as easy as changing the other types of software.

Before we can understand why we need to take care of the device and make sure the device has enough power while the firmware is getting updated, we need to understand the types of memory that are used to store firmware.

Types of Memory used to store Firmware

Originally Firmware is written on Masked ROMs, which is a special type of memory that can be programmed/written-data-to only once. The products were then shipped with these unchangeable programs called firmware and they run for ages till the device goes out of use.

The first replacement of Masked ROMs came in the form of EPROM which can be erased by exposure to UV light and then reprogrammed as required. Then came EEPROMs which used electricity to change the contents. Nowadays the Masked ROMs have been replaced with Flash memory, which is cheaper and serves the purpose. (You can refer to this article to read more about the different types of memory.)

Reason you need to keep the power on during firmware updates

Before updating the firmware, you need to download it, verify the integrity of the data, reboot the device and go into boot mode (to read more about boot mode and bootloaders refer to this article), then rewrite the flash memory and reboot it again in normal mode.

The reason you are asked to keep the power on while updating the firmware is because, if you stop the update-process in the middle, then the flash chip on which the firmware lives will end up having an incomplete program and since the operating system needs the proper-firmware to actually see the devices, if you remove the power, then next time you turn the power on, there won’t be a firmware to actually take the hardware to present that to the operating system. When this happens, in the industry we call it “bricking the device” which essentially means you cannot use the device other than as a brick or a very expensive paper-weight!

But these days, the motherboards usually come with a back-up chip (which is usually read-only), so that if the main chip gets corrupted during the update process, you can still use the back-up chip to start the computer, and then you can try updating the main chip again!

Now that we have understood the role of firmware and how that is different from all other types of software, let’s have a brief look at the other types of software seen in the layer-diagram above

Device Drivers

What are device drivers? Device drivers are programs that can control a given hardware and provide a software interface to it. Other programs like Operating Systems can interact with the hardware through this software interface without needing to know the actual underlying implementation of the software interface.

An interface is nothing but a group of functions. All operating systems talk to hardware via some predefined software interfaces.

For example, I could design an operating system that hands Wireless cards with 4 predefined functions/interface as below

turn_wifi_on()

turn_wifi_off()

connect(string AP_name, string password)

disconnect()

Every Wireless card manufacturer who wants to make his device work on my operating system must provide a driver software that has these 4 functions. My operating system can then happily call these functions whenever the end-user needs something to be done. This is just a simple example of how drivers are implemented, in real life these interfaces tend to get a little bit more complicated. I hope you got the point.

Also, different operating systems have different interfaces and since the driver software needs to run inside the operating system, the design of the drivers also tends to match the styles/nuances that are followed on a particular operating system.

So for example, if I manufacture a device and I want that device to be used with Windows, Mac OSX, and Linux, I need to write/compile/package 3 device driver software separately for these 3 OSes since one cannot install a driver provided via a .deb package on windows or install a driver using .exe file on Linux!

But for most of the common devices like Keyboards, mice, headphones, game controllers, USB storage, cameras, Bluetooth dongles, etc, all the operating systems usually has drivers preinstalled so that you can simply plug and play without the need to install additional drivers.

But say instead of a regular mouse, you bought a gaming mouse with some special programmable buttons, then you need to install the driver software provided by the manufacturer to use the extra functionality provided.

How Device Drivers Differ from Firmware?

Now that we have seen what both the terms “Device drivers” and “Firmware” mean, let us see have a look at the table from the beginning of the article again!

FirmwareDevice Drivers
Firmware is a class of software that is written for specific custom hardware. Device drivers are software that is needed to make a given hardware accessory work within a given operating system. Device drivers are tightly connected with and controlled by the operating system.
Firmware lives and runs directly on the hardware.Device drivers live on the hard-disk.
Firmware is independent of an operating system, i.e you can run any operating system on top of a given motherboard’s firmware. Device drivers are highly dependent on the operating system on which they are used. For example, for the same hardware device, you need different device drivers for using that on Windows vs Linux.
Firmware cannot be updated through an operating system, we need to go into the BIOS/UEFI to update the device driversDrivers can be updated from within the operating system.
Firmware engineers do not need any knowledge of operating systems. But they need core knowledge on processors and the latest RAMs, PCIe standards, and so on to write firmware that complies with the latest standardsDevice driver engineers need knowledge about the specific device that they are using, the communication standard the device uses to talk to the computer (like Bluetooth, USB, etc), and the operating system the device driver is written for.
Firmware is written by motherboard manufacturersDrivers are written by engineers in companies that produce hardware accessories that connect to your computer
Examples include the BIOS/UEFI interface that comes with the computer’s motherboardExamples include special software you install to handle the extra buttons on your mouse, software that comes with any non-standard hardware like special game controllers, also the software that helps us use all the standard hardware like USB storage devices, keyboards, mice, headphones, etc.

Lets us also have another look at the layer diagram before we end this article!

Hence to make it really short Firmware is a class of software, which runs directly on the hardware while device drivers help make different devices work with a given operating system.

I hope by now, you are clear with what these terms mean, how firmware differs from other types of software where each of these software-types is employed on a typical computer!

And with that I will stop this article!

Hope you enjoyed reading this article and learned something useful!

Feel free to share this article with your friends and colleagues!

Here are some of my other articles that might interest you!

Related Articles

Embedded Software Explained with Examples!

A Clear-Cut Explanation To Embedded Linux..!!

Firmware vs Software: Explained with Examples!

Photo of author
Editor
Balaji Gunasekaran
Balaji Gunasekaran is a Senior Software Engineer with a Master of Science degree in Mechatronics and a bachelor’s degree in Electrical and Electronics Engineering. He loves to write about tech and has written more than 300 articles. He has also published the book “Cracking the Embedded Software Engineering Interview”. You can follow him on LinkedIn