If you plug a device into the computer you probably don’t think about the communication mechanics behind the hardware and the CPU. If a CPU can’t “talk” with the hardware, the hardware doesn’t do a thing.
I did not know how this worked but it seems that firmware has everything to do with this. In this post, I will explain the role of firmware in setting up communication between hardware devices (and with this I mean literally all devices that you plug into your computer) and the CPU.
Communication device
When you plug a keyboard into a computer you expect it to immediately work. The keyboard is vital because it enables you to give commands to the computer. Additionally, a monitor is pretty handy as well because you can read the feedback of the computer as well after you have given it a command.
To set up a communication line between CPU and devices, you first need to create a connection between the hardware and the CPU. This is done with a chip (or a controller). In order to set up communication between the chip and the CPU, you need a communication bus (a set of wires) so that the CPU can send commands to and from devices.
In the early days, the chip manufacturers created one chip for every piece of hardware. For instance:
- Memory controller
- Keyboard controller
- Mouse controller
- Hard drive controller
- Etc.
This was not very space-efficient on a motherboard so, over the decades, manufacturers started to combine multiple controllers (chips) into chipsets. Nowadays almost all chipsets are integrated into one single chip. Intel calls this (thanks to the marketeers over there I guess) the “Platform Controller Hub” (PCH). But other manufacturers like AMD, simply call it a “chipset”. Chipsets are heated up as well so like the CPU they also need to get cooled. This is for instance done by installing the chipset on a heat sink.
The chipset extends the data bus (wires) to every device on the PC (keyboard, mouse, USB devices, speakers, wired networks, printers, and so on).
So how does the communication between, for instance, keyboard and CPU work? As we saw, the chipset contains a keyboard controller. When you press a key on the keyboard, a scanning chip identifies what key was pressed. Then the scanning chip sends a coded pattern of 1s and 0s (binary) to the keyboard controller. This code is called the scan code. Every key on the keyboard has a unique scan code. The keyboard controller stores this scan code in its own register (lots of chips have their own registers: small units of internal memory to store codes). With these registers, the keyboard controller can accept multiple commands based on its own “codebook” that is used by the keyboard controller and send it to the CPU. When the CPU wants to communicate with the keyboard it sends a response in binary code (a command) that is then executed by the keyboard controller based on the codebook.
To make it a bit more dynamic now, let’s involve the monitor as well. If you press a key on the keyboard, a coded pattern of 1s and 0s is sent to the keyboard controller and after that, the translated command is sent to the CPU. The CPU then sends a command to the monitor controller who then translates the command with its own “codebook” and projects the command on the screen: the character on the keyboard. Of course (as always in IT) there are a lot of exceptions to this process and this is a bit simplified, but in order to get a grasp of the basic mechanisms, this should be sufficient for now.
As we saw before, the CPU needs to send a command to a device controller. But to be able to send this command, a CPU needs a support program loaded into its memory in order to be able to talk with a specific device. This program is called “BIOS”.
BIOS
BIOS stands for Basic Input/Output Services. These programs (services) enable the CPU to communicate with the devices in their own “language”. Every device on your computer needs BIOS.
If you build a new computer system, this system has no Operating System (OS). But in order to operate the devices, the CPU needs access to BIOS in order to be able to run the most important hardware on your PC. Otherwise, the PC won’t run. You can’t store this code on a hard drive/SSD because when you start up your PC for the first time, the code to communicate with the hard drive is not loaded yet. That is why it is stored on the motherboard. However, it can’t be stored on DRAM because every time you start the system, the data on DRAM is being erased. So where is it stored then?
ROM
ROM is short for read-only memory and this is the device where BIOS is stored. Once information is stored on ROM it isn’t erased when you reboot your computer. Additionally, ROM is read-only so you can’t change a program once you store it. Motherboards use a specific type of ROM: flash ROM. It’s the same device that also stores your data on your smartphone, tablet or SSD. When BIOS firmware is updated most people call it “flashing the BIOS”.
The flash ROM chip is called the system ROM chip. This is because it has code that enables your CPU to talk to the basic hardware on your PC (keyboard, monitor, USB ports, hard drive, etc.).
The programs (services) for all these different types of hardware need code and this code for all these programs are stored on the system ROM chip on your motherboard. Together all these programs are called “system BIOS” but they are also called firmware. This is totally different from the software which is programs that are stored on other media devices than ROM (hard drive, SSD, etc.).
UEFI
Nowadays, our systems use UEFI instead of BIOS. UEFI stands for Unified Extensive Firmware Interface. Still, a lot of people name UEFI, BIOS instead. It’s hard to stop a habit if you have lived with it all your life (I know myself because I also still call it BIOS).
CMOS/RTC
ROM is read-only and needs a place to store all settings so it doesn’t have to be re-entered every time you reboot your computer. You need to be able to save the settings and, if necessary, also change them. This is done by a RAM unit that is connected with a small battery to keep it up and running even when the PC power is off. This memory unit is called the CMOS which is short for Complementary Metal-Oxide Semiconductor. CMOS also handles the RTC which is short for Real-Time Clock. This is very handy because otherwise, you would have to set the time on Windows every time you reboot. Tip: if your O/S clock resets every time you start up the system there is a big chance that the small battery (also called the CMOS battery) needs to be replaced:
Before you install a new battery, make sure that it has the same voltage and amperage as the old battery. To keep CMOS settings while replacing the battery you need to keep your PC plugged in an AC outlet. The power doesn’t have to be on but you still have to be careful about Electrostatic Discharges (ESD).
In order to be able to change the CMOS settings and save them, a small program is built into the system ROM called the system setup utility. This program gives you the ability to access and change CMOS data. BIOS itself is invisible but the CMOS setup utility is visible once you start it. If you screw up the settings and wrongly overclock your PC for instance (hopefully not frying your CPU by doing so) you don’t have to panic. Every CMOS setup utility has a few options to reset your settings in case you screw up. These options are called Load Default Settings and OS Optimized Defaults. Optimized Defaults set the CMOS to the best speed/stability for the system. Another option to reset the settings to factory settings is to open the computer and check the motherboard for a dedicated set of wires, called the CLRTC. By moving the shunt from wire 1 and 2 to wire 2 and 3 and then by waiting 10 seconds and moving the shunt back to wire 1 and 2, settings are reset to factory settings when you plug in the power again and reboot the system:
As a last resort, you can also take out the small coin battery and wait for a few seconds. After that, reinstall the coin battery and reboot the system and the settings will be reset to factory settings as well.
Option ROM
BIOS/UEFI can’t anticipate every type of new hardware. Therefore it is possible to add programming other than BIOS in order to set up a communication between CPU and services. In the past, this was done by putting BIOS on the hard drive itself. For instance, an extra hard drive that could have its own flash ROM on the card itself that stored BIOS for that card. Nowadays this is replaced most of the time by another tool: device drivers. There is one exception to the rule: video cards. They still have their own BIOS on the card.
Device Drivers
Device drivers are files that are stored on the hard drive of your PC. They contain all the commands that are necessary for the CPU to talk to the device for which it was written. All operating systems have a method nowadays to load these drivers into RAM every time the computer boots up. This means that it doesn’t matter that RAM is wiped clean every time you restart your computer because the drivers are loaded into RAM again once the computer restarts. All operating systems use online tools to automatically install device drivers. You can also search for them manually on the internet if this is not the case or if you need to update a driver for a specific piece of hardware.
Power-On Self Test (POST)
The Power-On Self Test (POST) program checks out the system every time that the computer is booted. When something is not right with, for instance, the printer controller chip, POST informs the user. In the beginning, PCs used a series of beeps to communicate with the user that something was wrong. These beep codes are called POST code beeps. Nowadays, new PCs have only two beep codes: one for bad or missing video which is one long beep that is followed by two or three short beeps, and another beep code for missing RAM which is a single beep that repeats indefinitely.
When the system check is completely OK, POST is successful and the PC will produce one or two beeps.
A common sound you might hear is a series of short beeps after the system has been running for a while. This is the CPU alarm that tells you that the CPU is approaching its high heat limit. Shut down your computer immediately when this is the case because your CPU is going to be fried otherwise.
In addition to the beep sounds, there are also text errors that can be shown on the screen. This is far more convenient than an alarm because you can read on the screen what is wrong.
POST can be disrupted by a device that doesn’t work. This can create an endless loop. The PC will look dead when that happens. In that case, you need a device, called a POST card, to monitor POST and determine what hardware/device is causing the trouble. A POST card can be plugged into one of the expansion slots of your motherboard. If the POST card shows no reading you will know that the problem is before the POST and it must be related to the CPU, RAM, motherboard or the power. If the board posts, then you know immediately that it must be an issue with the drive or device.
A POST card
Booting process
After you have powered on the PC, the power supply circuitry tests for proper voltage. After that, it will send a signal down a wire that is called a “power good” wire to wake up the CPU. After the CPU is awake, a built-in memory address is sent via its address bus. This address is the first line of the POST program on the system ROM. This is how the system starts the POST. After the POST has finished, your computer must find programs on the hard drive to start the operating system. This is done by the POST, passing control to the last BIOS function which is the bootstrap loader. The job of this line of code is to find the operating system. The CMOS setup utility of your PC has an option that you can configure. With this configuration, you tell the bootstrap loader the boot sequence. For instance, first USB, second CDROM, third Hard Disk. Almost all storage devices can be configured to boot an operating system by setting aside a specific location. This location is called the “boot sector”. Any device with a functional operating system is called a “bootable disk” or a “system disk”.
When a bootstrap loader locates a good boot sector, it passes control to the operating system and removes itself from the memory. If it doesn’t, the bootstrap loader moves to the next device in the boot sequence that you have set in the CMOS setup utility.
The boot sequence is also very important because it enables you to load in special bootable devices so that you can run utilities to maintain a PC without using the primary operating system.
In modern (UEFI) systems, the POST hands control of the boot process to the Boot Manager. The Boot Manager checks the boot configuration and after that, loads the operating system boot loader directly.
Some BIOS have a feature that allows you to use a preboot execution environment (PXE). With this, you can boot a PC without local storage by retrieving an operating system from a server over a network.
Flashing the ROM
With flash ROM, you can easily update your system BIOS to add support for new technology by running a small command-line program in combination with an updated file. After that, your BIOS is updated and you are good to go again. This process is called “firmware update”.
You do this by inserting a removable disk (for instance a USB thumb drive) that contains an updated BIOS file. After that, you use the updating utility in the CMOS setup. Most of the time, you will also be able to back up your current BIOS so that you can return to a previous version: do that! If you don’t have a good backup it might end in a useless motherboard that has to be replaced when a BIOS update goes wrong.
In this current time, a lot of motherboards also have system utilities that can connect directly to the Internet and access updates that way.
Final thoughts
Firmware is a key component of a computer. Over time, Firmware evolved and nowadays it is integrated in an easier way with the support of drivers instead of all kinds of different chips on the motherboard. But the general rule still applies: a computer can’t be operated by its user and there is no way to interact with it without Firmware. Humans are still not able to communicate directly in binary code with a computer without additional devices and until then we are depending on Firmware as a communication device between human and computer.
Feel free to contact me if you have any questions or if you have any additional advice/tips about this subject. if you want to keep in the loop if I upload a new post, don’t forget to subscribe to receive a notification by e-mail.

