[comp.binaries.ibm.pc.d] Reading time and date without using bios or dos ?

mercier@iros6.iro.umontreal.ca (Denis Mercier) (02/06/89)

I want to know, if it is possible, where and how i can read time and date
set on a pc system, i know that the timer counter is at port 46cH but i
don't know how to decode the information it contains. I have to precise
that i can't use bios or dos since these routines are not reetrant and
need this in hardware interrupt routine. It will help a lot, thanks.


-- 
-----------------------------------------------------------------------------
  /* Denis  Mercier */  | mercier@iros1.UUCP                    | Where is
 Universite de Montreal | mercier@iro.umontreal.ca              | the beef ?
 Dep. I.R.O., Lab. VLSI | mercier%iros1@larry.mcrcim.mcgill.edu |
 Montreal,Quebec,Canada | uunet!utai!musocs!iros1!mercier       | I need it! 
-----------------------------------------------------------------------------

simcha@humming.UUCP (Simcha Lerner) (02/08/89)

In article <891@mannix.iros1.UUCP> mercier@iros1.UUCP (Denis Mercier) writes:
>I want to know, if it is possible, where and how i can read time and date
>set on a pc system, i know that the timer counter is at port 46cH but i
>don't know how to decode the information it contains. I have to precise
>that i can't use bios or dos since these routines are not reentrant and
>need this in hardware interrupt routine. It will help a lot, thanks.

I think that your needs would be better served by using the BIOS 
routines, and installing a monitor on INT 1Ah that sets and clears
a flag as the routine is entered and exits, and that you condition
your use of the interrupt based on whether this busy flag is set.
This would protect you from any hardware differences that your 
program might be subjected to.

If you want to get fancy, you could design the monitor to allow
you to be called upon the call to the true int. handler exiting
when you encounter a busy state.

Simcha Lerner
harvard!humming!simcha

euloth@dalcsug.UUCP (George Seto) (02/11/89)

References: <4368@okstate.UUCP> <17841@gatech.edu> <891@mannix.iros1.UUCP>


I am not an IBM user and this question is related to yours. I know that
not all IBM machines and clones have a Time/Date Clock builtin to the
system. Like my Atari ST, a device called the SmartWatch is available
for it. This appears to be a socket and there is a version which fits
under the standard 28 pin ROM. This device can either be sold by 
electronics supply houses by itself or with commercial software for it
to be set. The software needed for the device needs to be able to set
date/time and also to read the date/time. I have PD software available
for the Atari ST, and was wondering if there was software in the Public
Domain for the IBM people as well. I don't need the software, but I 
would appreciate knowing the names of any PD or Shareware programs 
out in the IBM world for such an date/time device. Note the nice part
of this date/time socket is that it is battery backed up with a lithium
battery so it won't require changing for several years, and is priced
quite reasonably. In Canada, it is around $25/$30 for the socket itself
from an Electronics supplier. BTW if anyone sends me Mail about any 
software they know about, could they also advise if sources are available
for any of it? Thanks in advance.
  


-- 
*******************************************************************************
* euloth@dalcsug.uucp  || Disclaimer: All opinions are my own unless other-   *
* /\/\/\/\/\/\/\/\/\/\ ||             wise noted.			      *
****AKA: Atari Nut*************************************************************

igp@camcon.co.uk (Ian Phillipps) (02/17/89)

mercier@iros6.iro.umontreal.ca (Denis Mercier) writes:

>I want to know, if it is possible, where and how i can read time and date
>set on a pc system, ...
>i can't use bios or dos since these routines are not reetrant and
>need this in hardware interrupt routine. It will help a lot, thanks.

The Bios just counts up a three or four bytes at 40h:mumble, at the rate
of 2^16 per hour - the addresses you'll find in the listing of the ROM in
your technical manual. [I don't have one at this site]
Your interrupt routine can read these.
-- 
UUCP:  igp@camcon.co.uk   | Cambridge Consultants Ltd  |  Ian Phillipps
or:    igp@camcon.uucp    | Science Park, Milton Road  |-----------------
Phone: +44 223 420024     | Cambridge CB4 4DW, England |