60

From https://en.wikipedia.org/wiki/BIOS:

BIOS software is stored on a non-volatile ROM chip on the motherboard. ... In modern computer systems, the BIOS contents are stored on a flash memory chip so that the contents can be rewritten without removing the chip from the motherboard. This allows BIOS software to be easily upgraded to add new features or fix bugs, but can make the computer vulnerable to BIOS rootkits.

Since ROM means read-only memory, why can the BIOS contents be rewritten?

Is the "flash memory chip" the same thing as the "non-volatile ROM", both referring to where the BIOS is stored?

Tim
  • 17,743

9 Answers9

63

To add to Varaquilex's answer, the BIOS software is stored in an Electrically Erasable and Programmable ROM (EEPROM) which enables firmware updates to be performed electronically. Very old BIOS chips were actually UV-EPROM chips which required erasing with UV light exposure before they could be reprogrammed.


Edit: As has been pointed out in the comments, even earlier than that single use Programmable ROM (PROM) chips were sometimes used which could not be reprogrammed at all once configured and required complete replacement to upgrade (although this was rarely required).

zelanix
  • 1,234
42

ROM is read only, so why is the BIOS contents can be rewritten?

BIOS program itself is stored in an EEPROM (which can be [E]lectrically [E]rasable and [P]rogrammable) or a flash-memory. So the read-only here is about the chip being non-volatile. The contents of the memory stays when the power is cut off, unlike volatile RAM. The ROM being EEP helps the BIOS can be re-written or updated. Back then for such operations, you had to remove the BIOS chip from the board, put a new one (if its not PROM or EPROM), or if its EPROM you have to get it to the manufacturer and let them re-program the chip and re-attach it to the board. After the current advances, thanks to EEPROMs, you do not have to remove chip to do such operations, you just make the computer do the job electrically.


Does the "flash memory chip" mean the same as the "non-volatile ROM", both meaning where BIOS is stored?

from Wikipedia:

Flash memory is an electronic non-volatile computer storage medium that can be electrically erased and reprogrammed.

Flash memory was developed from EEPROM (electrically erasable programmable read-only memory). There are two main types of flash memory, which are named after the NAND and NOR logic gates. The internal characteristics of the individual flash memory cells exhibit characteristics similar to those of the corresponding gates. Whereas EPROMs had to be completely erased before being rewritten, NAND type flash memory may be written and read in blocks (or pages) which are generally much smaller than the entire device. NOR type flash allows a single machine word (byte) to be written—to an erased location—or read independently.

EEPROM and flash memory do not refer to same thing: they are two similar memory types as one is developed from the other and contain different type/configuration of MOS transistors. However, they are the memory where BIOS program resides.


To address another misconception I want to mention this CMOS-BIOS relationship:

The BIOS settings are stored in the CMOS chip (which is kept on power via the battery on the motherboard). That is why the BIOS is reset when you remove the battery and re-attach it. The same program runs but the settings are defaulted. See this answer for a detailed view of memories used during the booting process.

Edit

To extend the CMOS-BIOS topic, thanks to @Andon M. Coleman, I want to add his comment to the answer:

It is worth mentioning that the BIOS settings do not have to be stored in volatile CMOS memory. There are plenty of embedded systems that store their settings in NVRAM. The only reason PCs have gotten away with using volatile CMOS over all these years is that they already had a battery to keep the internal real-time clock ticking while the power is off (recall that when you pressed the power switch on a PC-AT, it literally cut all power off to the motherboard). This meant that cheaper volatile memory could be used to store system settings. So it is mostly for historical purposes.

Varaquilex
  • 3,846
32

As a supplement to the other answers, I like a more visual approach:

BIOS location

This BIOS chip doesn't seem to be particularly well seated in its socket.

The BIOS, including fancy new UEFI BIOSes, are software stored on a chip on the motherboard. The technical details have already been covered by zelanix and Varaquilex.

The chip is is often, but not always, removable for easier servicing. Some motherboards include more than one BIOS, mostly as a sales gimmick, but in some cases the second BIOS helps recover from certain (usually user-caused) problems:

Dual non-removeable BIOS

8

It may also be worth noting that on most machines before the 80286, data could be read from ROM just as quickly as from RAM, but while RAM bandwidths have improved enormously since the 1980's, commodity-ROM bandwidths have not [fast ROM chips do exist, but increasing the ROM's speed beyond a certain point would increase the price]. Since reading every byte of a BIOS ROM once would only take a fraction of a second, some 80386 machines and most 80486-and-later machines offered an option to copy the BIOS to RAM on start-up. Modern machines take things even further, and actually place the BIOS ROM chips on a bus which is entirely separate from the RAM bus and is much slower. Unlike 80486-era machines which would start out by running from ROM a program which would copy itself to RAM, many newer machines have processors that can't run code from ROM at all. Instead, they have circuitry which on start-up reads certain parts of the ROM into RAM and executes it.

supercat
  • 1,819
  • 10
  • 8
1

Look at that Wikipedia article as it read in January 2005:

Before 1990 or so BIOSs were held on ROM chips that could not be altered. As their complexity and the need for updates grew, BIOS firmware is stored on EEPROM or flash memory devices that can be upgraded by the user. However, an improperly executed or aborted BIOS update can render the computer or device unusable. To avoid BIOS corruption, some new motherboards have a backup BIOS. Also, most BIOSes have a "boot block" which is a portion of the ROM which runs first and is not updateable. This code will verify that the rest of the BIOS is intact (via checksum, hash, etc.) before jumping to it.

Nowadays, of course, we have a Wikipedia article that confuses people by saying that the chip is "non-volatile ROM" in one breath and that it can be written to in the next. The lesson to learn here is that Wikipedia often isn't very well written, and that articles change, not always for the better.

I suggest reading books. Scott Mueller's Upgrading and Repairing PCs, to pick one of several books, has a whole chapter on the BIOS, that discusses all sorts of things from where the BIOS chip is located to the various sorts (listing four: ROM, PROM, EPROM, and EEPROM) of such chips.

Some quotes:

No matter which type of ROM your system uses, the data stored in a ROM chip is [sic] nonvolatile and remains indefinitely unless intentionally erased or overwritten (in those cases where that is possible). — Upgrading and Repairing PCs, p.373

Virtually all PCs built since 1996 include a flash ROM to store the BIOS. A flash ROM is a type of EEPROM chip you can erase and reprogram directly in the system without special equipment. — Upgrading and Repairing PCs, p.387

Books aren't perfect. One can argue details with Mueller's "first blush" definition of flash memory here, for example. But the good ones are generally proofread and have more coherent explanations than much of Wikipedia has, that at least don't contradict themselves from sentence to sentence.

Presuming a modern PC, and not getting bogged down in how PCs used to work two decades ago:

Your machine's firmware is held on a non-volatile memory chip on the motherboard. It actually holds quite a lot. (The Pm49FL004T mentioned in my answer here holds half a MiB, and as mentioned in my answer here some chipsets are capable of supporting 16MiB of firmware.) It's involved in a lot more than just the system bootstrap, even for protected mode operating systems. Its contents are modifiable, but not as easily as the (volatile) contents of the main system RAM. On EFI systems, the chip not only holds the firmware code and (read-only) data but the values of the non-volatile EFI variables.

JdeBP
  • 27,556
  • 1
  • 77
  • 106
0

The original ROM was literally manufactured that way at the silicon level. Once they made it electrical programmable by users then a few things:

  1. in many they have a hardware voltage step-up circuit internally that allows 3.3V or 5V to get jumped up internally to 12V to do the actual programming. This is true for the older PROM, EPROM, UVEPROM, oR EEPROM.

  2. If available in older models, UV (Ultra-violet light) eraseable feature allowed the circuits to only enable internal +12V on programming the device, and a UV window allowed the UV light into the chip area, but the UV window had to be covered after programming or the chip would erase under any room flourescent lighting. The UV eraseable was also very fast to erase, much faster than reprogramming the whole chip to 0's or 1's.

In many cases there is a step-up circuit internal to all "programmable" PROMs.

  1. The later EEPROM allowed electrically eraseable, to the EPROM or UVEPROM.

  2. Later Flash technology came along and added different circuit technology (at the transistor level) and higher densities than the older EEPROM.

  3. In almost all cases ever since the original ROM was stopped, almost all BIOS PROMs are suspect in many (25% ?) of computer issues. These later PROMs (which all have some programmable feature) can be damaged or just 'forget' their program over time.

PROMs, no matter how erased or reprogrammed should be handled with care (ESD damage), and aging, or humidity.

In around 1/4 the bad computer cases re-programming a "good" BIOS usually corrects the problem. So, even if your BIOS is "good", it always pays to reflash if possible.

0

Actually, in last days there is more sofisticated system how to store BIOS. Imagine 2 storage banks similar to your flash drive, just smaller. One of them is accessed read only and second is available to be written (to flash new version of the BIOS). Reason for 2 parts is a backup, when writing of new BIOS is not successful. If Flashing of new BIOS succeed this 2 parts will switch and device could be rebooted under new BIOS.

BEWARE: not all kind of devices has this system. Sometimes is a simple small flash memory which is simply overwritten. Usually, you are prompted to backup the electricity and not to interrupt the upgrade process.

In old times of motherboards there was EPROM memory, which could be rewritten after memory was erased by strong light, or later a PROM memory, which could be written just once. Both could be done only by special programming device, so BIOS chip should be removed from the device to be written.

Dee
  • 240
  • 1
  • 9
0

In the original IBM PC the BIOS "ROM" was, I believe, some sort of electrically programmable ("write once") ROM (EPROM). I think it was socketed, but there was no real expectation that it would be "upgraded" in the field. Other computers of the era used something similar.

As systems got more complex it became more advantageous to have the BIOS "field upgradeable" (and without the need to open the box and physically swap the part). So systems began having various types of rewriteable BIOS "ROMs". The advantages were three:

  1. The likelihood of a bug became greater as systems got more complex.
  2. It was attractive to have the ability to upgrade, to incorporate new features.
  3. For motherboards that might be used in several different boxes (perhaps even under different brand names), it was attractive to be able to factory-customize the BIOS for the specific use.

Larger boxes, around the same time as the original IBM PC, also began having some sort of read-only "boot" memory instead of the more primitive "bootstrap loader" technology. Some of these were mask-programmed ROM, some EPROM, some even RAM that was read from a diskette via a small "service processor".

-1

the BIOS is stored in either on CMOS chip or NVRAM, which are small amounts of non-volatile memory on your motherboard (that is, they hold data indefinitely without needing power).

As for what message you get if everything passes the post, on older machines you'll usually get a single beep from your machine if everything checked out.

On newer machines, you won't get anything: you won't see the post, there won't be any messages, beeps, nothing... sort of a "no news is good news" type of deal. If you still want to see the POST run on a newer machine, the key to hit (at least on the computers I've used) is Tab. Hit that a few times right after you turn on the power to see the POST on the screen. Alternatively, there should be an option to have the POST come up on the screen in your BIOS settings.

amar
  • 1