Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 May 1996 17:19:18 +1000
From:      Stephen McKay <syssgm@devetir.qld.gov.au>
To:        freebsd-current@freebsd.org
Cc:        syssgm@devetir.qld.gov.au
Subject:   Re: Wildly inaccurate clock calibration.
Message-ID:  <199605220719.RAA22373@orion.devetir.qld.gov.au>

next in thread | raw e-mail | index | archive | help
Bruce Evans <bde@zeta.org.au> 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) {



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