🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.msdos.programmer
Article #1440

Re: BIOS/CMOS clock

#1440
From: Ernie Deel
Date: Tue, 09 Dec 1997 00:00
28 lines
2040 bytes
> 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??

What you're getting is the BIOS tick count.  If this count is correct, it
can be used to reset the DOS clock.  It's fairly easy to figure the time
from the tick count, there are 65536 (2^16) ticks per hour.

Int 1A, Function 02 reads the time directly from the real-time hardware
clock.  The returned data is in BCD format which you will have to decode.
This should be the date/time that is displayed in your CMOS setup. It is
possible to go directly to the hardware itself but it's rather tricky
programming and there's not much point in it if the BIOS will do the job
for you.

The DOS clock is set on startup and maintained thereafter by the OS.  This
DOS clock is Y2K compliant but the timer hardware in many (if not most) PCs
has some problems.  A cold shutdown and re-start is often required to
re-set the hardware timer after the turn of the century.  Until that
happens, your software will likely be showing something like Jan. 1, 1900
if you get date/time from hardware.  All part of the Y2K mania.

-- 
Ernie Deel, EFD Systems
------------------------------------------
Technical Details
Message-ID: <01bd04b4$81bfd8a0$75de45cf@mindspring.http>
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: 108ebd,69dadd8657dc8cd
X-Google-Attributes: gid108ebd,public
X-Google-Thread: 109e38,69dadd8657dc8cd
X-Google-Attributes: gid109e38,public
X-Google-Thread: 102bfa,69dadd8657dc8cd
X-Google-Attributes: gid102bfa,public
From: "Ernie Deel" <efd@spamless.mindspring.com>
Subject: Re: BIOS/CMOS clock
Date: 1997/12/09
Message-ID: <01bd04b4$81bfd8a0$75de45cf@mindspring.http>
X-Deja-AN: 296610274
References: <01bd048a$106b3020$783779c3@pppjgravestinter.NL.net>
Organization: EFD Systems
Newsgroups: alt.msdos.programmer,borland.public.delphi.winapi,borland.public.turbopascal,comp.sys.ibm.pc.hardware.misc