Why must a computer have a BIOS?

The BIOS software is built into the PC, and is the first code run by a PC when powered on ('boot firmware'). When the PC starts up, the first job for the BIOS is the power-on self-test, which initializes and identifies system devices such as the CPU, RAM, video display card, keyboard and mouse, hard disk drive, optical disc drive and other hardware. The BIOS then locates boot loader software held on a peripheral device (designated as a 'boot device'), such as a hard disk or a CD/DVD, and loads and executes that software, giving it control of the PC.[2] This process is known as booting, or booting up, which is short for bootstrapping.

Which requisites determine that a computer system must have a BIOS installed on it?

Why can't the Operational System actually do all of the BIOS work?

8

10 Answers

A BIOS is a hardware dependent piece of code stored on the motherboard itself. Every different motherboard needs a custom BIOS written for it, so it would be impossible to have a generic BIOS/OS all-in-one (although the BIOS is technically just stored code, so you could theoretically write an OS for one particular motherboard). As you mentioned, the purpose of the BIOS is to do the following:

When the PC starts up, the first job for the BIOS is the power-on self-test, which initializes and identifies system devices such as the CPU, RAM, video display card, keyboard and mouse, hard disk drive, optical disc drive and other hardware.

Note that you can still start a computer without any external storage - which is why the BIOS is a requirement for a computer. In other terms, the BIOS provides a common software interface to allow a stored computer program to communicate with various hardware devices connected to the motherboard.

For example, if I have two different motherboards with two different SATA controllers, the BIOS allows me to write a piece of code that can work with both, without my knowledge of how the motherboard actually sends commands to the SATA device. I just have to tell the computer "read sector X from this SATA device", and the BIOS is responsible for actually sending those commands to the hardware.

Where it actually gets the "read sector X" information from is a stored program contained within the BIOS, which usually directs the computer to start reading from a bootloader stored in a common location. These common locations are agreed upon by various software and hardware developers, and usually provided to the public to allow for more compatibility between systems.

Once a basic level of interfacing (again, logical interfacing through software) is established, the operating system itself builds a common interface with your various hardware devices (usually by using "device drivers"), and the operating system can then control the hardware.


Finally, it should be noted that the BIOS is also used to make modifications to the computer hardware configurations, and store them in the on-board EEPROM (so your computer remembers the changes next time you start it up). However, as I previously stated, once the operating system is loaded, it has full control of the computer.

This allows for motherboard manufacturers to develop software allowing you to make these changes from within your operating system, as opposed to having to reboot into the BIOS. Again, this is very hardware and software dependent, but goes to show that all computer interfacing is relative. The BIOS is exactly what it's name implies - a basic input/output system, to allow a common software interface for a more advanced program ("operating system") to take control of the machine.

13

Your operating system is on your hard disk, if you turn on your computer it won't magically start reading from that hard disk. It is the BIOS that loads the boot loader from the hard disk, as well as do some testing and allowing you to configure certain settings of the BIOS.

Your OS can't do that because it is on the hard disk and not in your ROM.

Hence, you need a BIOS or a similar (but different) technology like EFI...

It is possible to put part of the OS on the ROM (responsible for loading the boot loader of the OS) by the manufacturer; however, this is not widely applicable and there is a BIOS or EFI available anyway.

10

No real logical reason. It's more a matter of legacy and history.

  1. There's no requisite that a computer must have a BIOS installed. It's legacy from IBM PC. Although this proved to be a good idea

  2. Having the Operating System doing that wouldn't really change anything because it would still do something like the BIOS does. Of course the OS would need to be in a ROM, not on a I/O device. The problem might arise for monopoly issues when a OS builder decides to make his OS BIOS incompatible with other OSs. Having BIOS manufacturers separate from OSs improves freedom over what software might run.

11

Something is required to start the Operating System. If the OS could fit in some non-volatile memory then it could be started directly, but with fully featured OSes such as Windows, OSX or Linux this isn't possible.

What's needed is a small lightweight "OS" that can be loaded on powerup that does the basic things like memory and disk access and then that loads the Operating System. While this could be part of the OS itself and not a separate entity there are other reasons why you might want another process to start first:

  1. Updates - if the OS was fixed like this then it would become difficult to update it if any security patches were needed. It can be done - firmware updates happen all the time to devices to such as routers etc. but these have relatively simple operating systems installed.
  2. Flexibility - a computer is a general purpose machine and the same hardware can run several different operating systems. Having a BIOS which then loads the OS from disk means you can choose which one to run - you can even go as far has having several installed side by side.

The process is known as bootstrapping.

12

The concept PC BIOS dervies from CP/M, an operating system popular on 8-bit Z-80 "S-100" bus based computers before the IBM PC took over.

CP/M expected hardware-dependent functions to be in a ROM (BIOS). Another part, loaded off disk by the bootloader, was the software that supported the CP/M filesystem (BDOS) and then last the command processor or "shell" (CCP). The hardware that CP/M was expected to support was not very much: a disk drive, a display, a serial port or two (COM or AUX ports) which could have printers or modems attached.

The PC BIOS performed a basic bootstrapping function similar to how CP/M did, and DOS used BIOS functions to perform basic input and output, as intended. Programmers ended up bypassing these functions as they were slow. This led to PC clone makers in the mid 80's recreating the platform as a whole (easy as IBM documented the original PC very well inside and out), instead of just providing a BIOS with compatible interfaces, though they had to do that too.

At this point we can say, for a modern OS, the BIOS isn't really necessary beyond booting the system. However ...

Starting in the early 90's, the notion of power management took hold and the BIOS was tasked with this. APM works well with a single-tasking OS such as DOS, but not with true multitasking OSs such as Windows or Linux. Around this time the 386 was in full force, the Intel CPU that supported real multitasking. DOS and the BIOS were not updated in response to the new capabilites of this CPU, mostly because all Intel CPUs will still run in legacy 16-bit compatibility mode that the original PC-BIOS was designed for. So modern OSes pretty much ignore/bypass all the CP/M-like input/output functionality of the BIOS except possibly during early boot stages.

Eventually ACPI was developed, mostly part of the BIOS, which supported power management and configuration of (often laptop) platform-specific things. ACPI also handles the final power-switching state of hibernation, sleep, or shutdown.

So these days it's ACPI and it's successor, EFI, that keeps something like the BIOS a necessity of PC's The overarching concept is for ACPI to be the interface between things platform or motherboard specific and the OS, so a separate build of OS doesn't have to be made for every different type of motherboard.

Development boards that house ARM CPUs running Linux (as well as cell phone hardware) have this issue. Typically they will come with a bootloader-only firmware such as U-boot, but pretty much the OS must support each board as a separate platform.

In a sense, you're right. BIOS and OS partly do the same things. The separation in BIOS and OS is solely for flexibility.

The BIOS is usually created by a hardware manufacturer. The hardware has to ensure, that a basic functionality is present, for example that a disk drive can be read from and that a basic display for diagnostics and errors is shown. Thus the name "Basic Input Output System".

This can be done, to some extent, without further knowledge of the actual components really present on the specific system, since they all have to support a certain small BIOS standard. This enables vendors to custom-build a complete system. The BIOS just has to do enough to start the OS. There are some conventions to where this start-points are, so it just tries one after the other. This also enables the use of different operating systems on the same hardware. (there is flexibility, again)

Once the operation system (or at least it's bootloader) ist found and started by the BIOS, the BIOS itself becomes largely obsolete. Modern OS use very little to nothing of the BIOS functionalitly after loading.

If you wanted to make the OS do all the work you'd have to put the OS in a place where it can be accessed by the hardware without the preliminary help of a software (ROM). This may be possible for some closed systems, where flexibility is no concern. If you think about building hardware support into some other hardware, you're basically building a kind of BIOS again...

Another concern is memory size and cost. Full featured OSs are large and trying to get a multi-gigabyte OS into ROM is expensive, besides the follow-up problems of patching and updating it.

So no, there is no technical reason, but many practical ones, especially for the flexible PC platform.

In order to run a program on a modern PC, you must already have a program running to begin with that knows how to operate the hardware and load programs into memory. This chicken-and-egg problem is solved by implanting a basic program into the hardware itself.

This basic input/output system (BIOS) is very small and very limited in scope, but provides enough of a foundation that second-stage boot loaders, like GRUB or NTLDR, can be loaded and run. These second-stage loaders are more sophisticated than the BIOS program which enables them to provide a more robust foundation for the operating system proper to load and assume control.

1

If a CPU had the ability to address a hard drive directly, without relying on BIOS, or EFI or other code in ROM (or NVRAM or what have you), then in theory such a CPU could load an OS from disk into RAM and begin executing it.

Actually, in theory, such a CPU could even execute instructions without loading them to RAM. There is no theoretical reason that a computer couldn't use a hard drive as primary storage. But this would be very, very slow.

This would mean having extra code in the CPU to access the disk, and hard-wiring some concepts about disks, like partition tables and file systems into the CPU. CPUs these days are big enough to do this, but it would not be a very flexible or efficient approach to designing a CPU.

2

Especially to Ex Umbris: The IBM System/360 and 370 started using an IPL (initial program loading). It loaded a first record from the device which address was set by dials on the console. Only the first 3 double words (8 bytes each) of the record were used. The second and third ones are the two CCW (channel control word, which are instructions to the I/O processor) used to start an instruction directed to the I/O device set by the dials in the console). At the end of the I/O operation, the first double word was used as the new PSW (program status word). This was really simple but worked very well. This IPL procedure was different on the RCA Spectra 70. The two CCW's were simply used to start the read operation of the program loader located starting at the next record on the I/O device from which one the IPL started.

Any device capable to read (basic read operation) was able to be used with IPL.

The BIOS of a PC is really more complex.

It does not need it!

What is often called the BIOS is a set of 4 things.

  • A boot loader
  • Power on self test
  • A configuration tool: now mostly obsolete, except boot order, and the clock. Most of the rest should be automatic or set by the manufacturer.
  • The BIOS: a library of input output routines to help the operating system communicate with the hardware. Unfortunately the bios is 16 bit, out of date and can not be used by modern operating systems, so is largely ignored.
2

You Might Also Like