From owner-freebsd-hackers Wed Apr 5 06:34:18 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id GAA19911 for hackers-outgoing; Wed, 5 Apr 1995 06:34:18 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id GAA19890 for ; Wed, 5 Apr 1995 06:33:58 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id XAA20445; Wed, 5 Apr 1995 23:31:23 +1000 Date: Wed, 5 Apr 1995 23:31:23 +1000 From: Bruce Evans Message-Id: <199504051331.XAA20445@godzilla.zeta.org.au> To: rgrimes@gndrsh.aac.dev.com, steve2@freefall.cdrom.com Subject: Re: Colorado Jumbo 250MB ft, and FreeBSD 2.0R Cc: freebsd-hackers@FreeBSD.org Sender: hackers-owner@FreeBSD.org Precedence: bulk >> timing problems. At one time the timing characteristics of the driver >> worked for almost everyone as long as your CPU and bus speed was not >> on the extreme in either direction. It seems with PCI and/or pentium >> systems this may no longer be the case. Has anyone examined the DELAY >> (microtime?) function to see if it is running noticeably faster on those >> systems? >Bruce, do we need to something with the DELAY code? I have 4 different >Pentiums here, 3 w/PCI if you need someone to run some test code. DELAY(n) is currently only guaranteed to delay for n - 20 + small_machine_dependent_delay(machine(time)) microseconds. small_machine_dependent_delay(machine(time)) is a rapidly decreasing positive function of time :-). You could add 20 to guarantee a minimal delay, but then DELAY(1) would take much too long on slow machines and too long on most machines. Use the kernel option DELAYDEBUG to get some boot-time calibration. Add another test `for (n1 = 0; n1 < 1000000[0...]; ++n1) DELAY(20);' and use a stopwatch to see how wrong DELAY(20) is. The calibration should be done in the kernel. This requires 1) finding a suitable clock calibrate against. The 8254 clock is suitable, but nit very easy to use because it has a small maximum count and DELAY() is first run with interrupts disabled so it can't depend on clock interrupts to keep track of counter overflows. 2) recalibration often enough to allow variations in machine speed. Bruce