Thanks in advance.
Consult the hardware manual for your board. The addresses to read
should be there somewhere. Use that to set the system time.
Speaking only for myself,
Joe Durusau
The time which you read is a default time in vxworks system starting
up.If you use standard pc architecture,bios's time has been store in
north or south bridge(I forgot it).It provide two IO address as
follow:
#define RTC_INDEX 0x70
#define RTC_DATA 0x71
you can write a number in 0x70,then read from 0x71,you can read bios's
time,and using this time which you read to set vxworks time(function
clock_settime()).after you do this step by step, you can use time's
function by vxworks lib.
sample code as follow:
void readbiostime()
{
char second,minute,......
sysOutByte (RTC_INDEX, 0);
second = sysInByte(RTC_DATA);
sysOutByte (RTC_INDEX, 2);
minute = sysInByte(RTC_DATA);
sysOutByte (RTC_INDEX, 4);
hour = sysInByte(RTC_DATA);
sysOutByte (RTC_INDEX, 6);
day = sysInByte(RTC_DATA);
sysOutByte (RTC_INDEX, 7);
date = sysInByte(RTC_DATA);
sysOutByte (RTC_INDEX, 8);
month = sysInByte(RTC_DATA);
sysOutByte (RTC_INDEX, 9);
year = sysInByte(RTC_DATA);
}
Set bios's time is same method,you can refer Linux's code about this
question.
> _______________________________________________
> VxWorks Users Group mailing list
> VxWe...@lbl.gov
> http://www-csg.lbl.gov/vxworks/
Vijay Peshkar wrote:
If the OP just wants to set time time manually, he could look
at clock_settime().