CMOS, BIOS and battery

6

As far as I know, if the BIOS has a password set, you can reset it by removing the battery and inserting it again.

Why is this so? Do all the CMOS settings reset to default after such a manipulation with the battery? What exactly happens to all the settings when reinserting the battery?

Alexander Shukaev

Posted 2011-06-08T12:45:53.063

Reputation: 318

Answers

6

Well, this is the wrong site to ask this (it's not programming related), but here goes: the battery is primarily needed to drive the RTC (real time clock) which needs to keep running even if the computer is powered off.

The BIOS often has a dedicated RAM which stores the settings, and the battery is needed to preserve this RAM as well. Information in RAM is not stable and "decays" and thus need to be read and stored again to keep the information. This called a memory refresh. You obviously need power for that, thus the battery. So if you remove the battery and the power is off, the RAM can't be refreshed and the information in it is lost.

However, AFAIK most modern BIOS chips have NVRAM (non-volatile RAM) which is able to keep the settings even without a battery. I remember that on one mainboard I had there was a jumper that you had to close to actually make the BIOS clear the NVRAM (and thus go back to factory default settings), since there was no battery.

I've also seen mainboards that use special capacitors instead of batteries.

DarkDust

Posted 2011-06-08T12:45:53.063

Reputation: 1 405

Yeah, but what happens next? Default settings will be loaded into it when I will turn power on? – None – 2011-06-08T12:59:07.040

2You normally write code so that "setting not set" means to use a default value. A BIOS wouldn't be different. – DarkDust – 2011-06-08T13:00:21.017

1

Some of the data in CMOS will be check-summed, so that when it is first powered on, the BIOS will "know" that the data in CMOS is not correct. It will then write whatever default values it wants into CMOS.

BTW, any modern BIOS should not have a password that depends on CMOS. That is simply too easily bypassed. Current PCs should have the password stored in some non-volatile memory, preferably memory that isn't connected to the CPU at all, but is accessed via commands from the CPU to some other embedded controller.

ReluctantBIOSGuy

Posted 2011-06-08T12:45:53.063

Reputation: 131