From owner-freebsd-current Wed May 22 00:42:12 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id AAA25827 for current-outgoing; Wed, 22 May 1996 00:42:12 -0700 (PDT) Received: from bunyip.cc.uq.oz.au (pp@bunyip.cc.uq.oz.au [130.102.2.1]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id AAA25820 for ; Wed, 22 May 1996 00:42:04 -0700 (PDT) Received: from bunyip.cc.uq.oz.au by bunyip.cc.uq.oz.au id <26331-0@bunyip.cc.uq.oz.au>; Wed, 22 May 1996 17:41:27 +1000 Received: from orion.devetir.qld.gov.au by pandora.devetir.qld.gov.au (8.6.10/DEVETIR-E0.3a) with ESMTP id RAA01587 for ; Wed, 22 May 1996 17:21:30 +1000 Received: by orion.devetir.qld.gov.au (8.6.10/DEVETIR-0.3) id RAA22373; Wed, 22 May 1996 17:19:18 +1000 Date: Wed, 22 May 1996 17:19:18 +1000 From: Stephen McKay Message-Id: <199605220719.RAA22373@orion.devetir.qld.gov.au> To: freebsd-current@freebsd.org cc: syssgm@devetir.qld.gov.au Subject: Re: Wildly inaccurate clock calibration. X-Newsreader: NN version 6.5.0 #1 (NOV) Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Bruce Evans claimed: >>May 16 17:01:33 stupid /kernel: 63814 Hz differs from default of 1193182 Hz by more than 1% > >You are experienced enough to debug it :-). Start by defining option >CLK_CALIBRATION_LOOP and booting with -v. Each calibration should take >about 1 second if the mc14* clock is working. Maybe if I just act dumb long enough, the problem will go away? ;-) Ok, for my first stab in the dark, I lowered the interrupt frequency (as in the patch below). This yielded very reasonable calibration values from 1193766 to 1193782 (difference of 16Hz, or 0.0013% variation) over 15 tests. Perhaps it is working now, or perhaps it has some more subtle systematic error. I can't tell yet for sure. If the set_timer_freq() call is necessary, and must be lower for slow 386 CPUs, it could be set based on the probed CPU type. What observable system feature will change if I accept 1193782Hz vs the default of 1193182Hz (600Hz difference)? Will I be able to check "date" vs wall clock and find 43sec difference over 1 day? Is this stuff used yet? Stephen. --- clock.c-1.58 Tue May 14 14:07:09 1996 +++ clock.c Wed May 22 12:13:53 1996 @@ -542,7 +542,7 @@ * Temporarily calibrate with a high intr_freq to get a low * timer0_max_count to help detect bogus i8254 counts. */ - set_timer_freq(timer_freq, 20000); + set_timer_freq(timer_freq, 2000); freq = calibrate_clocks(); #ifdef CLK_CALIBRATION_LOOP if (bootverbose) {