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?
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?
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.)
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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