Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

CMOS, DRAM, ROM and EPROM are all types of memory found in PC systems. Explain which of these is used to contain the initialisation code and which are accessed by this code.

The first answer is the ROM/EPROM contains the initialization code. I don't know which one it accesses though?

share|improve this question
To make things more confusing. A modern PC does not yet have access to the main memory when it boots. It first needs to initialise the memory controller. If it need to store data then it will do ugly hacks like use the on CPU cache in a sort of deferred write back mode. – Hennes Dec 18 '13 at 5:07
That's not much of a hack. In 8086 mode (16/20 bits), 1 MB is needed. That's less than the cache size, so the cache never needs to evict a single byte to main memory. So why bother initializing the memory controller before the switch to 32 or 64 bits mode? – MSalters Dec 18 '13 at 10:33
DRAM, ROM, EPROM are memory types. CMOS is not a memory type, but a technology to build integrated circuits. TTL and NMOS are other technologies. CMOS technology is widely used for circuits that are not memory. It has been, and is still, common to refer to the BIOS memory as CMOS because the motherboard had a wrongly named button "Clear CMOS" to erase the content of the BIOS parameters (not the BIOS code). – mins Jan 27 '14 at 1:02
up vote 8 down vote accepted

First, lets introduce the memory types. Once we understand them, we can understand booting process more easily.

DRAM (Dynamic Random Access Memory)

DRAM is a volatile (means the contents are gone when the power is off) memory type which stores data for CPU usage. Every data to be used, program to be ran should fetched from it's source to RAM first. In case you are interested, this link contains a huge image with numerous connectors, sockets, DRAM types of computer hardware.

EPROM (Erasable Programmable Read-Only Memory)

A ROM has it's circuitry configured during the manufacturing. There is no way to change the contents of the ROM. EPROMs, on the other hand, can have their internals re-configured. But to do that, the EPROM should be detached from the board. The next step from EPROM is Electrically Erasable Programmable ROM (EEPROM) where you do not have to detach the memory from the system. You can simply reconfigure it electrically. All types of ROMs are non-volatile.

CMOS (Complementary Metal-Oxide Semiconductor)

As seen from the title, it's hard to understand what type of memory is this since it says semiconductor, not memory. Well, there is a history behind the name. In early days of modern PCs the BIOS was stored in a volatile, low power consumption CMOS SRAM (Static RAM). If it's volatile, then when the power is off, the contents of BIOS should be lost. To overcome this issue, manufacturers added a battery for CMOS to the motherboard, as seen below (the huge metallic circle to the right and center).

enter image description here

Modern motherboards have the BIOS installed in non-volatile EEPROMs (Electrically EPROM) and still keep the battery. If the memory is non-volatile, why keep the battery? The answer is to keep track of peripherals and date-time, to power RTC (Real-Time Clock).

Bootup Sequence

BIOS is stored in an EEPROM. When you turn on the computer, after the CPU gets ready for operation, it first goes to the EEPROM's address to find the BIOS program to execute. At the BIOS, the CPU checks for potential hardware malfunction, then starts the GPU. After that, peripheral devices are checked (USB, hard disk, keyboard, etc.). Finally, BIOS visualizes the startup screen. Below is an example of this screen.

enter image description here

Then, the BIOS reads system date and time and the connected hard drives from the CMOS to start the bootup sequence from the correct disk that stores the operating system files. Once the disk is determined, BIOS detaches itself. From that point on, operating system data are fetched from hard disk into DRAM. You know the rest :)

Clarification Edit

It's a misconception that BIOS resides in CMOS. This is WRONG . BIOS is stored in an EEPROM or a flash memory which are non-volatile. CMOS serves as a memory to the BIOS code in which the BIOS settings are stored.

share|improve this answer
your first link is broken. I do wonder if its… you're referring to – Journeyman Geek Dec 18 '13 at 1:55
that is correct. Let me fix it. Thanks for pointing out. – Varaquilex Dec 18 '13 at 1:55
Well, I re-checked the link. It seems to work for me but I'll add yours just in case. – Varaquilex Dec 18 '13 at 1:56
@Varaquilex, Thanks for the comprehensive answer, however you are missing an important part: How UEFI fits into the picture (as most systems now are modern). – Pacerier Apr 23 '15 at 21:43

CMOS stores the BIOS which is the first thing that gets initialized on boot, so I would assume CMOS, it really depends on what is meant by the term "Initialization Code" because the code itself has to be accessed too, so the question is a bit vague.

share|improve this answer
CMOS store the BIOS settings, not the BIOS code. – Werner Henze Dec 18 '13 at 10:57
@WernerHenze I assumed that the "Initialization Code" would be the BIOS itself, so it would then access its settings. – Slowki Dec 18 '13 at 22:47
"CMOS stores the BIOS": the BIOS is the BIOS program code, not the BIOS settings. "which is the first thing that gets initialized on boot": neither BIOS code nor BIOS settings are initialized on boot. And on the level we are talking here you normally won't say that CMOS gets initialized (it is loaded). – Werner Henze Dec 19 '13 at 8:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .