Which memory is accessed by the initialization code on a PC?

4

5

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?

user2018084

Posted 2013-12-17T19:53:56.940

Reputation: 1 604

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 – 2013-12-18T05:07:37.347

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 – 2013-12-18T10:33:57.227

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). http://en.wikipedia.org/wiki/Nonvolatile_BIOS_memory

– mins – 2014-01-27T01:02:04.103

Answers

11

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.

Varaquilex

Posted 2013-12-17T19:53:56.940

Reputation: 3 620

@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 – 2015-04-23T21:43:20.287

your first link is broken. I do wonder if its http://sonic840.deviantart.com/art/Computer-hardware-poster-1-7-111402099 you're referring to

– Journeyman Geek – 2013-12-18T01:55:19.820

1that is correct. Let me fix it. Thanks for pointing out. – Varaquilex – 2013-12-18T01:55:46.273

Well, I re-checked the link. It seems to work for me but I'll add yours just in case. – Varaquilex – 2013-12-18T01:56:44.637