Technical article 118825

My kernel clock is running faster on OpenServer 5.0.6/5.0.7 with a slow machine.

OpenServer 5.0.6OpenServer 5.0.7

Written · Last revised

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_unix
The new kernel will use the same clocking mechanism as OpenServer
5.0.5.

See also

date(C), setclock(ADM), rtc(HW)

From the Xinuos technical article database, record 118825. Reproduced with permission. The original is at www.sco.com/ta/118825, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.