BIOS

BIOS


This section of the ITFreeTraining courses will look at the BIOS. BIOS or Basic Input/Output System is the software that is responsible for initially testing and communicating with your hardware. Without the BIOS the computer would not start. This video will look at what the BIOS can do, upgrading the BIOS and how the BIOS works.

Download the PDF handout:

What is BIOS?
To start with, I will first look at what the BIOS is. Essentially, the BIOS is a microchip found on the motherboard. BIOS is essentially what is referred to as firmware. Firmware contains basic low-level software that controls the hardware in the device it is installed in. In the case of computers, the BIOS contains basic input and output software which is used to communicate with hardware. When the computer is first switched on, the BIOS software is used to test the hardware within and connected to the computer. Once complete, the software in the BIOS is used to access the hardware.
BIOS was first created in 1975 by IBM. It was later reverse engineered to be used in non-IBM computers. Nowadays there are three companies that make the majority of BIOS chips and IBM is not one of them. I will now have a closer look at what happens when a computer starts up, to give you a better understanding of how the BIOS works and what it does.

Powering Up PC
To start with, I will first look at what happens when the power button is pressed on a computer. When the power button is pressed, a circuit is closed which causes a test to be preformed of the computer’s power supply. If there is a problem with the power supply, usually there will be no power output at all and the computer will not start.
If the power supply test is o.k., the power supply will send power to the CPU. Now the CPU has powered up, it will start executing instructions, because that is what a CPU was designed to do. In order to do this, it needs software and this is where the BIOS comes into play.

Load BIOS Software
The BIOS is essentially a microchip on the motherboard. This is also often referred to as firmware. Older BIOS chips use Electrically Erasable Programming Read-Only memory called EEPROM, whereas modern BIOS uses flash RAM. This allows the code in the BIOS to be updated, but the code on the BIOS cannot be directly run from the chip itself.
In order for the CPU to execute the code in the BIOS, the code in the BIOS is copied to the memory inside the computer. So essentially this means that in order for a computer to start, it requires memory. If you attempt to power up a computer that does not have memory installed, the motherboard will emit a number of beeps to alert you that there is a problem.
Once the BIOS code has been copied to memory, the CPU can now start executing the code. So essentially what happens is this. When you press the power button, the code in the BIOS is copied to memory and then is executed by the CPU. The next question is, what does this code do?

Posts Tests
The next step is that the BIOS performs a number of tests. These tests are referred to as POST or power- on self-test. These are a number of quick tests to check everything appears to be working. There may still be hardware faults, but the POST tests should pick up any basic problems.
POST tests include but are not limited to, checking the memory installed. This is a quick check to see if everything appears to be working correctly. There are a number of memory testing software tools available that can do more advanced tests if required.
Tests also include checks of any attached storage devices. This is basic testing to ensure the devices start up and are accepting commands. For example, a hard disk test would spin the drive up and test it to ensure the drive can be accessed.
Other checks include checking the keyboard. The check tests every key on the keyboard. Depending on the BIOS, if a stuck key is detected a warning message will appear.
Any devices like a mouse are also checked. This includes devices like trackpads and trackballs.
Next, the BIOS will initialize any additional BIOS chips installed in devices inside the computer. For example, a BIOS contained in a RAID controller. The BIOS allows access to storage devices connected to the computer, however it may not be able to access storage connected to expansion cards like RAID controllers. This is because RAID controllers will often use manufacturer specific code. Having an additional BIOS on the RAID controller allows additional code to be loaded to access the storage connected to the RAID. Without this, it would not be possible to boot from storage connected to a RAID controller. So what happens if a problem is found when the computer first starts up?

Beep Codes
If a problem is detected, the computer will make a series of beeps. Unfortunately, there is no common standard for these beeps. Different BIOS will have different beep codes. A lot of BIOS however, use similar beep codes.
First, pretty much all BIOS will have one beep if all tests are passed and no errors are detected. The beep will sound like this.
If there is a problem with the video card, most BIOS will have a long beep followed by two or three short beeps like this.
If there is a problem with the memory in the computer, the computer may give an indefinite or long beep like this.
Both a video and memory error can potentially mean that there will be no video displayed. So, regardless of which BIOS is being used and the beep codes that I hear, if I have a black screen when the computer starts and I hear long or multiple beeps, I would check the video and memory first. Often the problem may be as simple as the memory module or video card are not seated correctly.

Visual Errors
If the video, CPU and memory are all working, you should get something displayed. Depending on the error, what BIOS you have and how it is configured, you may get an error message displayed on the screen.
In this example, the keyboard has not been plugged in. In this case, the BIOS was configured to display the error. It is possible to configure the BIOS to skip certain errors. For example, in the case of the keyboard, the computer may be configured to provide services on the network and is not directly used and thus a keyboard is not required. When this occurs, often the keyboard related errors are configured to be switched off, so the computer will still boot when a keyboard is not attached.
In some cases, the BIOS will stop and will ask for input. In other cases, the BIOS will continue even though there was an error. If the BIOS is able to get past this step, the next step is to start loading an operating system.

Finding Bootable Partition
In order to load an operating system, the BIOS next needs to read the partition tables. The BIOS is then searching the partition tables for a bootable partition. The order it does this is determined by the BIOS. This includes devices like floppy disk drives, CDROM, USB Flash drives, hard disks, solid state drives and network adapters. The BIOS will search each device in the order it is configured until it finds the first device that it can successfully boot from.
Once the BIOS finds a device that is bootable, the next step is to read the boot loader from the device. The boot loader is a small amount of software. The boot loader’s job is to load the operating system. Remember that BIOS has software that is only for basic input and output. It is not able to load files from a file system – that is the operating system’s job. However, the operating system is a sizable amount of software. The boot loader provides the bridge between the BIOS and operating system. The BIOS does not have the ability to read files in file systems but the boot loader does. The boot loader is not a full operating system, but has the ability to load and launch a full operating system.

BIOS Basic Input/Output Only
The last question that remains is, what happens to the BIOS once the operating system loads? The point to remember is that the BIOS was only designed for basic input and output functions. The BIOS itself only runs 16-bit code. This code is enough to start the computer and load a boot loader but not much else.
In the old days of computing, operating systems would use the BIOS to access hardware. But nowadays with 32-bit and 64-bit CPUs being readily available on the market, having 16-bit software to access your hardware is not practicable.
Nowadays, the operating system will access the hardware directly. Thus, once the operating system has started up, the BIOS is no longer required. Essentially the job of BIOS is to provide a method to boot an operating system.

CMOS and BIOS
One common misconception I would like to bring up, is the difference between CMOS and BIOS. CMOS stands for Complementary metal-oxide semiconductor. In the old days of computing the CMOS was a separate chip on the motherboard. Nowadays the functions of CMOS have been integrated into the south bridge, so that on modern motherboards CMOS is not a separate chip.
Regardless of where the functionality of the CMOS chip is kept the function is the same. That is, it is used to store computer settings. This includes configuration, boot order, time and date. Essentially any basic computer settings are stored here. This includes CPU and memory timing. Thus, it is important that this configuration is not lost.
When the computer is powered on there is no problem keeping these settings. However, if the computer is switched off these settings will be lost. To prevent this from happening, the motherboard will have a battery on it. This battery will keep the settings even if the power is switched off. If you switch on a computer and it has lost all its settings or the time and date is wrong, this problem may be caused by the battery on the motherboard needing to be replaced.

UEFI
The last point that I will cover in this video is UEFI or Unified Extensible Firmware Interface. UEFI was designed to be a replacement for BIOS. I make the point here in this video as a lot of the time a technician will refer to UEFI as BIOS just out of habit.
As UEFI is designed to replace BIOS there are a lot of advantages to UEFI. First, UEFI supports different CPU architectures. So essentially it can support the same architecture as the CPU. Thus it is common for UEFI to support 32bit or 64bit directly. Remember that BIOS is limited to 16bit only. A BIOS based computer would need to start in 16bit mode before switching to 32bit or 64bit. However, it is not uncommon for the UEFI to be 32bit and for the CPU to switch to 64bit when the operating system has loaded. The important point to remember is, UEFI has the ability to match the CPU architecture if required.
The next big change is that UEFI supports booting from storage drives that are larger than two terabytes. With BIOS, you are limited to booting from two terabyte drives, but once the operating system has loaded the operating system can access larger storage drives.
UEFI is newer than BIOS, so you will often see graphical interfaces. It is a common misconception that BIOS does not support a graphical interface. This is incorrect. BIOS can also support graphical interfaces but being the older standard it is more likely going to be text based. UEFI being the newer standard is most likely to be graphical, however there are text based UEFI interfaces.
That concludes this video from ITFreeTraining on BIOS. I hope to see you in other videos from us. Until the next video I would like to thank you for watching.

References
“BIOS” https://en.wikipedia.org/wiki/BIOS
“The Boot Process” http://www.opsschool.org/en/latest/boot_process_101.html

Credits
Trainer: Austin Mason http://ITFreeTraining.com
Voice Talent: HP Lewis http://hplewis.com
Quality Assurance: Brett Batson http://www.pbb-proofreading.uk