| Author |
Message |
the_risk_master
Joined: 12 Aug 2005 Posts: 671 Helped: 59 Location: UE+MIT, Philippines, (14°N , 120°E )
|
02 Aug 2008 4:01 BIOS clock data mining |
|
|
|
Dear sirs,
I want to know if I can extract information through the parallel port or serial port
from the BIOS clock (RTC), I am programming through C, the gettime displays in decimal form, I want to have it on HEX or BIN format to input it to my custom design circuit. Any help/advise/URL is welcome, thank you.
regards,
the_risk_master
|
|
| Back to top |
|
 |
rjainv
Joined: 18 Feb 2007 Posts: 147 Helped: 14 Location: Bangalore, India
|
02 Aug 2008 8:34 BIOS clock data mining |
|
|
|
Reading time in software(C) via BIOS call is a on-demand event. So C can call function in BIOS which will read the appriopriate register from RTC circuit on motherboard and give back the time.
Connecting this time information from RTC block to a parallel/serial port would be some sort of continuous connection. So Either there could be some s/w routine running in background that keeps reading time from RTC and write it to serial/parallel port, or if RTC chip outputs are visible on motherboard ( impossible these days, its part of super IO chip or southbridge), then it could be connect to some encoder circuit that could take the time/date and encode it to drive a new serial/parallel port.
|
|
| Back to top |
|
 |
the_risk_master
Joined: 12 Aug 2005 Posts: 671 Helped: 59 Location: UE+MIT, Philippines, (14°N , 120°E )
|
02 Aug 2008 13:53 Re: BIOS clock data mining |
|
|
|
Okay this is it, I made a test program
#include<conio.h>
#include<dos.h>
#include<time.h>
struct time t;
struct date d;
unsigned char h,m,s,month,num,year,flag;
void main()
{
while(1){ /* this makes my program read the time continuously */
gettime(&t);
getdate(&d);
h=t.ti_hour;
m=t.ti_min;
s=t.ti_sec;
month=d.da_mon;
num=d.da_day;
year=d.da_year;
printf("TIME: %02x:%02x:%02x DATE: %x/%x/%4x \n",h,m,s,month,num,year);
}
}
I'll update some other time for improvements...
at least I made to continuously read the date and time in HEX format
Now, I will plan the circuitry for the interfacing
|
|
| Back to top |
|
 |