From owner-freebsd-current Wed Nov 1 00:03:25 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id AAA00314 for current-outgoing; Wed, 1 Nov 1995 00:03:25 -0800 Received: from zibbi.mikom.csir.co.za (zibbi.mikom.csir.co.za [146.64.24.58]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id AAA00202 for ; Wed, 1 Nov 1995 00:02:06 -0800 Received: (from jhay@localhost) by zibbi.mikom.csir.co.za (8.6.12/8.6.9) id KAA18894; Wed, 1 Nov 1995 10:00:29 +0200 From: John Hay Message-Id: <199511010800.KAA18894@zibbi.mikom.csir.co.za> Subject: Re: Time problems To: wollman@lcs.mit.edu (Garrett A. Wollman) Date: Wed, 1 Nov 1995 10:00:29 +0200 (SAT) Cc: current@FreeBSD.org In-Reply-To: <9510311747.AA29686@halloran-eldar.lcs.mit.edu> from "Garrett A. Wollman" at Oct 31, 95 12:47:55 pm X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1822 Sender: owner-current@FreeBSD.org Precedence: bulk OK, I changed the values in calibrate_cyclecounter() like suggested and now my time stay much closer to reality. My CPU even probe as a 90MHz processor! > CPU: 90-MHz Pentium 735\\90 (Pentium-class CPU) > Origin = "GenuineIntel" Id = 0x525 Stepping=5 > Features=0x3bf Can we get some kernel config option to do this or will I have to change clock.c after every ctm? Or will this get to be the default? John -- John Hay -- John.Hay@csir.co.za > In talking to David Greenman about this problem, we found that one of > his machines which exhibits this problem suffers from (1). Other > people have suggested (2) for their motherboards. (David's > motherboard took about 12 seconds to perform a ten-second delay.) > > Here's one thing which you might try: > > In this function (in i386/isa/clock.c): > > ------------------------------------ > calibrate_cyclecounter(void) > { > /* > * Don't need volatile; should always use unsigned if 2's > * complement arithmetic is desired. > */ > unsigned long long count; > > __asm __volatile(".byte 0x0f, 0x30" : : "A"(0LL), "c" (0x10)); > DELAY(1000000); > __asm __volatile(".byte 0xf,0x31" : "=A" (count)); > /* > * XX lose if the clock rate is not nearly a multiple of 1000000. > */ > pentium_mhz = (count + 500000) / 1000000; > } > ------------------------------------ > > Change the occurrences of `1000000' to `10000' and `500000' to > `5000'. This will reduce the calibration time, which makes it more > likely that the error in your clock will be small enough to get > rounded off. If that doesn't work, then just #ifdef out the body of > the function, which will cause the 8254-alike to act as the reference > for timekeeping. >