The Big Picture: Where Does the PC Remember Its Settings?

You change the boot order, set the clock, turn on a memory profile. You turn off the PC, and the next day everything is still set. How? The firmware needs a place to write things down that survives power-off. This section explains the two places: the old CMOS memory (with its coin battery) and the modern NVRAM (inside the firmware flash chip).

7.1 CMOS Memory

What it is: CMOS is a tiny block of memory that stores the BIOS settings and the date and time. The name comes from the chip technology it was first built with: Complementary Metal-Oxide-Semiconductor, a type of circuit that uses very little power. (Almost all chips today are CMOS, so the name is just history.)

The history:

TimeDetail
1984The IBM PC/AT adds a clock chip (the Motorola MC146818 RTC, Real-Time Clock) with a small block of battery-backed RAM
Original sizeAbout 64 bytes, with part used by the clock itself
Later128 bytes (and more on some boards)
TodayThe CMOS RAM and the RTC are built inside the chipset (PCH)

What is stored there:

Stored itemExample
Date and timeKept by the RTC (it counts using a 32.768 kHz crystal, from Chapter 4)
Basic settingsBoot order, disk types, "boot with keyboard error"
A checksumA number that proves the data is not damaged
Passwords (some systems)Setup passwords

How the CPU talks to it: Through two I/O ports (Chapter 4). Port 0x70 takes the address of the byte you want, and port 0x71 reads or writes it. That is all! The old Award and AMI BIOS used this to save the settings you see in the setup screen:

CPU ── OUT 0x70, index ──►  CMOS chip   (choose which byte)
CPU ── IN  0x71        ◄──  CMOS chip   (read that byte)

The checksum. The BIOS adds up all the settings bytes and stores the total. On the next boot, it adds them again. If the totals differ, the data was damaged (usually because power was lost), and the BIOS shows "CMOS checksum error" and loads the defaults.

Look at the screen in Figure 5.7. On a classic Award screen, the menu Standard CMOS Features is the place for date, time and drives, and Load Fail-Safe Defaults or Load Optimized Defaults replaces all your settings with factory ones. Save & Exit Setup (key F10) writes your changes into the CMOS.

A blue Award CMOS Setup Utility screen showing the Load Defaults and Save and Exit menu items

Figure 5.7 — The same classic Award "CMOS Setup Utility". On the right, Load Fail-Safe Defaults, Load Optimized Defaults, Set Supervisor Password, Set User Password and Save & Exit Setup are the items that read and write the settings memory. Screenshot: Award Software International Inc., recreated by User:Kephir, public domain, via Wikimedia Commons.

7.2 NVRAM

What it is: NVRAM means Non-Volatile RAM: memory that keeps its data without power. In a modern UEFI PC, this is an area inside the SPI flash chip (Chapter 4). It is not powered by the coin battery. Flash simply remembers by itself.

CMOS RAMNVRAM (UEFI)
TechnologySmall battery-backed RAMFlash memory area
Needs a battery?YesNo
Size64 – 256 bytesTens or hundreds of kilobytes
StoresOld BIOS settings, the clockUEFI variables (settings, boot entries, keys)
Loses data if the battery dies?YesNo

UEFI variables. Each stored item is a variable: a name, a vendor GUID, some attributes, and a value. The attributes say how it can be used:

AttributeMeaning
NV (Non-Volatile)Keep it after power-off
BS (Boot Services)Visible during boot
RT (Runtime)Still readable and writable by the OS
AuthenticatedCan only be changed with a valid signature (Secure Boot keys use this)

What lives in NVRAM:

  • The boot entries and BootOrder (Section 5.5)
  • The Secure Boot keys (PK, KEK, db, dbx)
  • Firmware setup choices (many makers keep these as variables)
  • Capsule update flags, and vendor data

Windows can read these variables (with the right privileges), which is how Windows tools set the boot order or restart into firmware: shutdown /r /fw sets a variable and restarts.

Wear. Flash cells wear out after many writes, so the firmware does not write NVRAM constantly. It writes when something changes.

7.3 Storing Boot Settings

What it is: The boot settings are the boot order and the boot entries. How they are stored depends on the firmware kind.

Legacy BIOSUEFI
WhereIn CMOSIn NVRAM variables
What is listedDevice types in order (floppy, CD, hard disk, USB)Named entries with a path to an .efi file
How you edit itSetup screen onlySetup screen, plus OS tools (bcdedit, efibootmgr on Linux, installer programs)
Who may change itThe userThe user and installed operating systems

Why an OS can change your boot order (UEFI). When Windows installs, it creates a new boot entry ("Windows Boot Manager") and puts it first. When you install Linux next to Windows, its installer adds an entry too. That is why dual-boot menus can appear.

Other settings that live in NVRAM or flash:

SettingStored as
Fast Boot, CSM, Secure Boot stateFirmware variables
Memory profile (XMP/EXPO) choiceSettings and saved training data
TPM and security optionsFirmware settings
Date and timeIn the RTC (not NVRAM; the battery keeps it)

What clearing does:

ActionEffect
Load Optimized Defaults (in setup)Rewrites the settings to the maker's defaults
Clear CMOS (jumper, button or battery)Resets the settings, clears the clock and often resets the firmware settings to default
Update the firmwareMay reset settings (write them down first)

(Boot entries may or may not survive a CMOS clear. If Windows disappears from the boot menu, re-adding it with the Windows recovery tools or a "browse for .efi file" option in setup usually fixes it.)

Windows tip: Reading the entries:

bcdedit /enum firmware

(Run in an Administrator Command Prompt.)

7.4 Battery Backup

What it is: The CMOS battery is a coin cell that keeps the clock (and on older boards the CMOS RAM) running while the PC is unplugged. It is usually a CR2032, 3 volts.

A round silver CR2032 coin battery in a holder on a motherboard

Figure 5.8 — The round silver coin is a CR2032 battery in its holder on a motherboard. Photo: Arnulf zu Linden, CC BY-SA 3.0, cropped from a motherboard photo, via Wikimedia Commons.

ItemDetail
TypeCR2032, a 3 V lithium coin cell (not rechargeable)
DrawA few microamps: tiny
Typical lifeSeveral years (3 to 10, depending on use and PC)
PowersThe RTC (date and time) and, on old systems, the CMOS RAM
When it mattersOnly when the PC is fully off and unplugged. While the PSU is plugged in, the board takes standby power from it.

Symptoms of a dying battery:

SymptomWhy
Clock resets to an old date (like 2000 or 2009)The RTC lost power
"CMOS checksum error"Old settings memory was lost
Settings forgotten at each power-offSame reason
Web pages warn about certificate datesThe wrong clock confuses secure sites
"Press F1 to continue" at every bootThe firmware keeps loading defaults

How to replace it safely:

  1. Shut down and unplug the PC. On a laptop, power off and disconnect the charger (many laptops have the battery hidden under the case; consult the maker's guide).
  2. Touch bare metal on the case to discharge static electricity.
  3. Gently push the retaining clip aside and lift the old coin out. Note which side faces up (the + side, usually up).
  4. Put in a new CR2032, + side up. Click it in.
  5. Start the PC. Set the date and time, and set any settings (boot order, XMP/EXPO).

Clear CMOS (reset to default). If a bad setting stops the PC from starting:

MethodHow
ButtonPress Clear CMOS on the rear panel or board (power off first)
JumperMove the jumper on pins marked CLR_CMOS for a few seconds
BatteryUnplug, remove the coin for about a minute, put it back

Note on UEFI PCs: A dead battery on a modern PC often only affects the clock (and a "settings lost" warning). Boot entries stored in flash NVRAM stay, so the PC may still boot Windows correctly.

Summary

TermPlain meaning
CMOSA small memory for settings and the clock; also the name of a circuit type
RTCReal-Time Clock: counts the date and time
Ports 0x70 / 0x71The address and data ports used to access CMOS
ChecksumA total that shows if the data is damaged
NVRAMMemory that keeps data without power (a flash area in UEFI PCs)
UEFI variableA named, stored setting (name + GUID + attributes + value)
BootOrderThe stored list of boot entries
CR2032The 3 V coin battery
Clear CMOSReset the settings to the defaults (jumper, button or battery)
Load Optimized DefaultsSetup option that restores the maker's settings