From owner-freebsd-bugs Mon Jun 21 13:20:23 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.26.10.9]) by hub.freebsd.org (Postfix) with ESMTP id 9C00514C85 for ; Mon, 21 Jun 1999 13:20:16 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id GAA15130; Tue, 22 Jun 1999 06:20:13 +1000 Date: Tue, 22 Jun 1999 06:20:13 +1000 From: Bruce Evans Message-Id: <199906212020.GAA15130@godzilla.zeta.org.au> To: freebsd-bugs@FreeBSD.ORG, John.Shue@symmetron.com Subject: Re: kern/12022: System clock timewarps Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > 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