In comp.os.msdos.programmer message <43c63229-a58b-48fc-9e62-59941107b18
e...@cc2g2000vbb.googlegroups.com>, Sat, 12 Nov 2011 11:53:59, Ruud
<
ruud.ba...@gmail.com> posted:
>One of my hobbies is 'playing' with old PC-XT (compatible)s. As you
>know the XT didn't have a RTC (Real Time Clock) chip on board. You
>could get cards providing you with a RTC but you also needed a program
>that read the RTC and set the date and time for you. The time is saved
>at 0004:006C and 0004:006E. But I haven't any idea where the date is
>stored. In fact, I thought that the date was a DOS thing and couldn't
>be set by the BIOS.
>
>The Commodore PC10-III and PC20-III are both XT compatibles (with and
>without hard disk drive) and have a for me unknown RTC; it's inside
>one of their custom ICs. I noticed that both time and date were set
>after booting. But I only recently realised that this was done without
>the need of an extra program. Which means that they were set by the
>BIOS.
>
>Has anyone an idea were the date is stored? Or is there more then just
>'storing some bytes'?
Google "pctim003" and read the document (own a copy) - perhaps from
<
ftp://garbo.uwasa.fi/pc/programming/pctim003.zip> - "Timing on the PC
family under DOS" (1995).
My
<
http://www.merlyn.demon.co.uk/pc-links.htm> may help, as may
<
http://www.merlyn.demon.co.uk/pas-time.htm> and
<
http://www.merlyn.demon.co.uk/pas-wait.htm>, etc.
Via <
http://www.merlyn.demon.co.uk/programs/00index.htm>, my program
INT_TEST may be of interest; one can investigate the situation with it.
The RTC contains a 32-kHz battery-powered clock, running all the time.
At boot, DOS reads it, and initialises a 32-bit 18.2Hz time counter at
$0040:$006C. When, at "midnight", that counter reaches $1800B0, a carry
bit nearby is set and the counter is zeroed,
At boot, the date from the RTC is copied into an unknown location, as a
16-bit daycount. When DOS is asked the date, it adds the carry bit to
its daycount and zeroes the bit. Therefore, either turn the PC off
overnight or ask it the date at least once every day.
INT_TEST, in DOS, Win3, and maybe Win98, can search memory for an
appropriate 16-bit value and (IIRC) verify it by changing the date
briefly.
The daycount rolls over at counting into $1800B0, not at or after
$1800B0. I found, by setting the count above that, that the possibility
had been ignored by DOS coders!
BTW, a DOS clone has what must be the most harmless possible DOS bug -
the comment about the leapness of AD 2400 is wrong.
My program HUNT can report all 2^32 possible values of a file datestamp,
from 1980-00-00 00:00:00 to 2107:15:31 31:63:62; and another program can
set them (?). My HUNTTEST.ZIP contains zero-length files with
interesting dates.
But I have only worked with PC-AT and later.
--
(c) John Stockton, nr London UK. ?@
merlyn.demon.co.uk Turnpike v6.05 MIME.
<
http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
<
http://www.merlyn.demon.co.uk/clpb-faq.txt> RAH Prins : c.l.p.b mFAQ;
<
ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ.