🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.msdos.programmer
Article #1441

Re: BIOS/CMOS clock

#1441
From: Wayne D. Hoxsie Jr.
Date: Tue, 09 Dec 1997 00:00
52 lines
2748 bytes
On 9 Dec 1997 10:07:16 GMT, "PB-Systems" <pb-systems@wxs.nl> wrote:

>Hi All,
>
>I have a problem with my BIOS-clock. The clock runs too fast. The clock of
>the Operating System runs too fast. If I reset the computer the time is Ok,
>but if the PC keeps runnings the clock will move 10 seconds (a day) into
>the future. A strange but irritation problem. 
>I wrote a small program to read the BIOS clock ($0040:$006C) but this clock
>is the wrong one. Can anybody help me to get the right CMOS-time?! Is there
>a way to find it??

The CMOS clock runs independently of the BIOS clock.  It is actually
located on the CMOS chip and is read by the BIOS at bootup.  To access
the CMOS memory locations (some of which are updated continuously by
the CMOS clock) you need to do it through the CPU I/O lines 0x70 and
0x71 using the in/out instructions.  The desired address (one byte) of
the CMOS memory is accessed by writing the address to port 0x70 then
either reading from or writing to port 0x71.

The following table maps the CMOS addresses asscociated with the
realtime clock:

CMOS address    Contents
~~~~~~~~~~~~    ~~~~~~~~
00H             Current second
01H             Second alarm
02H             Current minute
03H             Minute alarm
04H             Current hour
05H             Hour alarm
06H             Day of the week
07H             Day of the month
08H             Month
09H             Year (00-99)
0AH             Clock status register A
0BH             Clock status register B
0CH             Clock status register C
0DH             Clock status register D
32H             For NON-PS/2's: Century in BCD (19 or 20)
                for PS/2's, the Century byte is at 37H, and 
                32H and 33H are used for a CRC value for bytes
                10H through 31H.




-- 
Wayne D. Hoxsie Jr.  KB9NWK
wayne@hoxnet.com
http://www.hoxnet.com
Technical Details
Message-ID: <348d603b.322070442@ntserv02>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <01bd048a$106b3020$783779c3@pppjgravestinter.NL.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1091e5,69dadd8657dc8cd
X-Google-Attributes: gid1091e5,public
X-Google-Thread: 109e38,69dadd8657dc8cd
X-Google-Attributes: gid109e38,public
X-Google-Thread: 102bfa,69dadd8657dc8cd
X-Google-Attributes: gid102bfa,public
X-Google-Thread: 108ebd,69dadd8657dc8cd
X-Google-Attributes: gid108ebd,public
From: wayne@hoxnet.com (Wayne D. Hoxsie Jr.)
Subject: Re: BIOS/CMOS clock
Date: 1997/12/09
Message-ID: <348d603b.322070442@ntserv02>
X-Deja-AN: 296615823
X-NNTP-Posting-Host: www.oigodfrey.com
References: <01bd048a$106b3020$783779c3@pppjgravestinter.NL.net>
Organization: Owens Brockway Machine Manufacturing
Reply-To: wayne@hoxnet.com
Newsgroups: alt.msdos.programmer,borland.public.delphi.winapi,borland.public.turbopascal,comp.sys.ibm.pc.hardware.misc