Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jun 1999 06:20:13 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs@FreeBSD.ORG, John.Shue@symmetron.com
Subject:   Re: kern/12022: System clock timewarps
Message-ID:  <199906212020.GAA15130@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
> Here is a temporary hack that fixes the timewarps on my Pentium-100MHz machine.
> 
> I use the sysctl command to change the TSC setting from whatever the timecounter code
> detected to the speed of my processor.

Not really a hack.  That's what the sysctl is for, although it is normally
for fixing errors of only a few ppm.

> To run this command at boot, I created a file in the /usr/local/etc/rc.d directory called
> buggy_TSC_fix.sh (contents of this file are listed at the end of this email).
> 
> With this fix, my clock has gone from being 25 minutes fast every 2 hours to being 0.1
> seconds fast every 2 hours.  I have also added a line to my /etc/crontab to run ntpdate
> every 2 hours.

I put it in /etc/rc.local, and tune it so that the clock drift is < 0.5 ppm
relative to a reference machine.  The drift then changes with the temperature
by huge amounts (I hope for < 10 ppm but wouldn't be surprised by 50 ppm), so
perfect tuneing is not very useful.  I also tune the i8254 clock:

sysctl -w machdep.i8254_freq=1193359		# (boot calibration: 1193307)
sysctl -w machdep.tsc_freq=450066942		# (boot calibration: 450046942)

Note that the boot time calibration is wrong by about 50 ppm for the
i8254, and the i8254's nominal frequency of 1193182 is wrong by about 150
ppm.  The boot time calibration is rlative to the RTC.  The RTC on this
machine (which has an Abit BX6-2 motherboard) is particularly inaccurate.
It gives the error of 50 ppm (4 seconds/day).  The RTC on my Asus P5TP4XE
motherboard had an error of only 0.08 seconds/day last month.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906212020.GAA15130>