Problem
I am running OpenServer 5.0.6/5.0.7 on a machine with a slow processor. The kernel clock is running anywhere from 5% to 20% faster than the battery operated real-time clock, which is keeping perfect time.
Cause
In OpenServer 5.0.6/5.0.7, a new clock scheme is used that takes
advantage of the time stamp counter (TSC). However, on slower
machines this may cause the clock interrupt to advance the clock more
than 100 times a second (the default amount). This increased rate of
clock interrupts causes the kernel clock to gain time while the
battery-operated hardware clock keeps the correct time. Solution
You can still use the old PIT-based clock scheme by going into the file /etc/conf/pack.d/clock/space.c and disabling the TSC by going to the clock tunable parameters:
/*
* Clock tunable parameters
*/unsigned long clock_debug = CLOCK_DEBUG_STD; /* see sys/clock.h */int disable_tsc_clock = 0; /* or 1 for old PIT-based clock */
int disable_hires_clock = 0; /* or 1 for old 10ms resolution */
int disable_pit_read = 0; /* or 1 for defective PITs */
int disable_short_timers = 0; /* or 1 for no short timers */
int track_rtc = 1; /* system clock tracks RTC */
int update_rtc = 1; /* setclock/adjtime updates RTC */
int track_rtc_interval = 20; /* track_rtc interval (sec) */
int update_rtc_interval = 20; /* update_rtc interval (sec) */
long clock_drift = 250000000; /* max adjustment rate (ns/sec) */
unsigned long tsc_clock_hz = 0; /* 0 means "auto-compute" */Find the first parameter:int disable_tsc_clock = 0; /* or 1 for old PIT-based clock */and change the 1 to 0:int disable_tsc_clock = 1; /* or 1 for old PIT-based clock */You can then relink the kernel and reboot:
# cd /etc/conf/cf.d
# ./link_unixThe new kernel will use the same clocking mechanism as OpenServer
5.0.5. See also
date(C), setclock(ADM), rtc(HW)