Difference between a RAM and a CMOS

Computer hardware: BIOS: CMOS

The "CMOS-RAM" has been part of every PC since the 286. CMOS is the abbreviation for C.complementary M.et al Oxide S.emiconductor and refers to an extremely energy-saving semiconductor technology. If a static RAM is manufactured with this technology, it is referred to as CMOS RAM. To call the CMOS-RAM only as CMOS is wrong.

Since the 286 there has been a clock circuit in every PC, the MC146818. This RTC (Real Time Clock) is also manufactured using CMOS technology and, like the CMOS RAM, is supplied by a battery while the PC is switched off.

It made sense to integrate the two circuits manufactured in CMOS technology. Since the 386, CMOS-RAM and RTC have been in the same chip housing, in rare cases even together with the battery.

The CMOS RAM is used so that the manufacturer of the PC can store important information about the hardware. The user can use the BIOS setup program to read and change values. The CMOS-RAM is outside the normal address range and cannot contain any directly executable code. It can be reached by IN and OUT commands via port 70h and 71h. To read a CMOS byte, an OUT command is required on port 70, specifying the address to be read. The required information is obtained by an IN command from port 71h.

The CMOS RAM memory has an upper limit of 128 bytes due to the bit assignment of port 70h. Only bits 0-6 are used for the address, bit 7 is used to switch NMIs on (0) or off (1).

The BASIC program below reads out 128 CMOS bytes and displays them on the screen.

10 CLS 20 FOR x = 0 TO & H7F 30 OUT & H70, x 40 PRINT USING "\ \"; HEX $ (INP (& H71)); 50 NEXT x 60 PRINT ""

The first 14 bytes are reserved for the clock circuit MC146818: 10 bytes for the values ​​of seconds, minutes, hours, day, month, year, day of the week and for the alarm time. 4 bytes are provided for status information.

The following 114 bytes are assigned differently depending on the BIOS manufacturer.

Clear CMOS RAM [edit]

Deleting or resetting all values ​​is necessary, for example, if you have forgotten the setup password. Take out the battery and disconnect the PC from the mains (pull the plug). Wait one to ten minutes for the last capacitors to discharge. Reinstall the battery.

How do the initial values ​​get into the CMOS-RAM? [Edit]

The values ​​in the CMOS-RAM are protected against changes with a checksum. If a byte is accidentally changed or if the entire memory content has been deleted (e.g. because the BIOS battery is exhausted), the BIOS detects this the next time it is started and asks whether or not the BIOS setup should be called whether a set of initial values ​​should be copied into the CMOS-RAM. Such a table was compiled by the manufacturer and made available in the BIOS ROM as a precaution.