Link to home
Start Free TrialLog in
Avatar of tsddb
tsddb

asked on

API to read BIOS datetime in Win95

In Windows 95, running certain applications cause OS datetime slower than BIOS datetime. After reboot, OS datetime refreshed and equal to the BIOS datetime again.

I'd like to know if there is any API directly reads the BIOS datetime, therefore a program can be run locally to periodically force OS datetime syn with BIOS datetime?
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

#include <dos.h>

void main()
{
unsigned char hours, sec, min;
  int flag;
 

  gettime(&mytime);
 


  if ( running == 0 )
   {

     running = 1;

     hours = mytime.ti_hour;
     min = mytime.ti_min;
     sec = mytime.ti_sec;

 
    if (hours == 24|| hours==0)
     {hours = 12; flag = 0;}


    if (hours >12)
     {hours -= 12; flag =1;}
}

look in dos.h for settime.  Also, gettime may be _gettime or dos_gettime or something like that.  It's in dos.h
In theory, I think you should implement a driver, but because in win9x you can use in/out directly under user mode, so you needn't. You can simply read the RTC with 70/71h ports.
errm, sorry my mistake, take out anything to do with running.  (Mine was for a TSR at the time.)  
Avatar of tsddb
tsddb

ASKER

Beyond Wu

Could you tell me more about "read the RTC with 70/71h ports."? "RTC" means "Real Time Clock" and how can I read it?

TSDDB
ASKER CERTIFIED SOLUTION
Avatar of BeyondWu
BeyondWu
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial