Dec 172017
 
Description of the CMOS data area and how to access it directly.
File AT-CMOS.ZIP from The Programmer’s Corner in
Category Tutorials + Patches
Description of the CMOS data area and how to access it directly.
File Name File Size Zip Size Zip Type
AT-CMOS.DOC 8120 2540 deflated

Download File AT-CMOS.ZIP Here

Contents of the AT-CMOS.DOC file


ibm.at/long.messages #135, from bredd, 6522 chars, Mon Oct 3 13:54:35 1988
--------------------------
TITLE: AT CMOS RAM Contents
I felt like I was shouting when I typed all of those acronyms onto the
title line. Below is a description of the entire contents of the
CMOS RAM and how to access it. I am posting this at the request of
several people.

Byte Contents
00 Seconds
01 Second Alarm
02 Minutes
03 Minute Alarm
04 Hours
05 Hour Alarm
06 Day of Week
07 Date of Month
08 Month
09 Year
0A Clock Status A
0B Clock Status B
0C Clock Status C
0D Clock Status D
0E Diagnostic Status
0F Shutdown Status
10 Diskette drive type (drives A, B)
11 Reserved
12 Fixed disk type (types 1-14)
13 Reserved
14 Equipment byte
15 Base memory lsb
16 Base memory msb
17 Expansion memory lsb
18 Expansion memory msb
19 Fixed disk #1 extended type
1A Fixed disk #2 extended type
1B-2D Reserved
2E Checksum msb
2F Checksum lsb
30 Found expansion memory lsb
31 Found expansion memory msb
32 Date century
33 Information flags
34-3F Reserved
-----------------------------------------------------------------------
Clock:

Bytes 00-09:
The date and time are stored in Binary Coded Decimal

Byte 0A: Clock Status A
Bit 7: Update in Progress. A 1 indicates that the
clock is updating the time registers. A
0 indicates that the time is valid and can
be read.
Bits 6-4: 22-stage divider. Selecte the divide amount
for the time base. Always set to 010 on the
IBM AT.
Bits 3-0: Rate selection. Allows selection of a divider
output frequency. This is connected to one of
the interrupts on the at and is normally disabled.

Byte 0B: Clock Status B
Bit 7: Set. 0 updates the clock registers at 1-second
intervals. 1 disables clock updates and allows
the clock registers to be set.
Bit 6: Periodic Interrupt enable. A 1 causes the clock to
interrupt the cpu at the rate specified in register A.
Bit 5: Alarm interrupt enable. A 1 allows the clock to
interrupt the cpu when the alarm time is hit.
Bit 4: Update-ended interrupt enable.
Bit 3: Square wave output enable. A 1 enables the square
wave at thre rate set in register a.
Bit 2: Date Mode. A 1 indicates time and date are done
in binary. A 0 indicates binary coded decimal. Always
set to 0.
Bit 1: 24/12 hour time. A 1 indicates 24 hour mode. A 0
indicates 12 hour mode. The system initializes to 1.
Bit 0: Daylight Savings Enabled. A 1 enables automatic daylight
savings changes. A 0 disables this. The 1 does not work
properly since Congress changed the dates that daylight
savings time changes.

Byte 0C: Clock Status C
Bits 7-4: IRQF, PF, AF, UF. Flags set when the clock interrupts
according to the flags in register B. Read only.
Bits 6-0: Reserved. Should be set to 0.

Byte 0D: Clock Status D
Bit 7: Valid RAM Bit. Read only. 1 indicates that the battery
is good. 0 indicates that the battery is dead and RAM
contents are probably invalid.
Bits 6-0: Reserved. Should be set to 0.

-----------------------------------------------------------------------
Power On Self Test Status:

Byte 0E: Diagnostic Status (Set by the power-on self test)
Bit 7: Power status of the real time clock. 0 indicates that
power has not been lost. 1 indicates that a power loss
has been detected.
Bit 6: Configuration Good. 0 indicates that checksum test was
good. 1 indicates checksum bad. Probable power loss.
Bit 5: Incorrect configuration information. A 1 indicates that
the equipment byte in the configuration did not match
installed hardware.
Bit 4: Memory size comparison. A 1 indicates that the detected
memory does not match that in the configuration record.
Bit 3: Fixed Disk Initialization Status. A 1 indicates that the
fixed disk failed the initialization.
Bit 2: Time status indicator. A 1 indicates that the clock
contained an invalid time.
Bits 1-0: Reserved.

Byte 0F: Shutdown Status
Undocumented. Probably used for the reset when changing from protected
mode back to real mode.

-----------------------------------------------------------------------
Configuration Record:

Byte 10: Diskette Drive Type
Bits 7-4: Type of first diskette drive.
0000 No Drive
0001 Double Sided Double Density 5 1/4 inch drive
0010 High Density 5 1/4 inch drive
0011 Double Sided Double Density 3 1/2 inch drive
0100 High Density 3 1/2 inch drive

Bits 3-0: Type of second diskette drive.

Byte 11: Reserved

Byte 12: Type of fixed disk drives.
Bits 7-4: Type of first fixed disk
0000 No Disk
0001 Defined type 1 to 14 in the fixed disk table.
to
1110
1111 Type 16 to 255. Defined in extended byte.
Bits 3-0: Type of second fixed disk

Byte 13: Reserved

Byte 14: Equipment Byte
Bits 7-6: Number of diskette drives installed
00 1 drive
01 2 drives
10 Reserved
11 Reserved
Bits 5-4: Primary display
00 EGA/PGA/VGA Etc
01 40 Column CGA
10 80 Column CGA
11 MDA
Bits 3-2: Not Used
Bit 1: Math Coprocessor
0 Not installed
1 Installed
Bit 0: Diskette drive presence
0 No diskette drives installed
1 Diskette drive installed

Bytes 15-16: Amount of conventional memory installed
Number of Kbytes. Eg. 0100h = 256K

Bytes 17-18: Amount of extended memory installed

Byte 19: Fixed disk #1 extended type
Types 16-255. Note that the drive type table is different
depending on the BIOS ROM installed

Byte 1A: Fixed disk #2 extended type
Types 16-255.

Bytes 1B-2D: Reserved

Bytes 2E-2F: Checksum.
The checksum is calculated by adding the bytes from 10 to
2D. The high byte is stored in 2E and the low byte in
2F. Note that the byte ordering is backwards compared
to what is normally used on 80x86 based machines.

-----------------------------------------------------------------------
Miscellaneous Info

Bytes 30-31: Amount of extended memory detected
Contains the amount of extended memory detected by the
power-on self test.

Byte 32: Date century byte.
Contains the BCD value for the current century. Presently
set to 19h

Byte 33: Information flag
Bit 7: 1 Indicates that the top 128k of conventional memory is
installed.
Bit 6: Instructs the setup utility to put out a first user message
after initial setup is completed.
Bits 5-0: Reserved

Bytes 34-3F: Reserved

-----------------------------------------------------------------------
To read or write CMOS RAM or Real time clock:

Out to port 70h the byte number to be accessed.

In or Out to port 71h to read or write the actual byte.


 December 17, 2017  Add comments

Leave a Reply