Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Sep 1997 17:49:45 -0700 (PDT)
From:      Archie Cobbs <archie@whistle.com>
To:        tony@dell.com (Tony Overfield)
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Raise your hand if you know how to make this work.
Message-ID:  <199709280049.RAA03368@bubba.whistle.com>
In-Reply-To: <3.0.2.32.19970927053159.006c81e8@bugs.us.dell.com> from Tony Overfield at "Sep 27, 97 05:31:59 am"

next in thread | previous in thread | raw e-mail | index | archive | help

>    >> there is a function to do this for you
>    >> it's rather trivial.
>    >> check clock.c
>    >> and see how the PCAUDIO device uses this to get itself
>    >> called 16000 times per second..
> 
> At 07:23 AM 9/25/97 +0000, Terry Lambert wrote:
> >> > Note: this is about twice as fast as the standard clock can go; at
> >> > the highest divider, it's only capable of 8192 interrupts a second.
> >>
> >Jamil J. Weatherbee wrote
> >> If we are still talking about an 8253 I know you to be wrong here, the
> >> frequency varies like 1.9MHz/(1-65535).
> >
> >This information is from the Linux tier code and from the FreeBSD
> >clock divider code for the PC audio driver, and not from the chipset
> >documentation, so I'm prepared to be wrong (along with the comments
> >in both these drivers).
> 
> I think Terry has confused the two "standard" timers.
> 
> The "standard clock" timer, on IRQ0, is a 1.193 MHz clock with a 
> programmable 16-bit divisor that can interrupt as fast as you 
> would ever want it to.
> 
> The "CMOS real-time clock" has a periodic interrupt, on IRQ8, based 
> on a 32768 Hz clock with a small set of divisors that support 
> interrupt rates between 2 Hz and 8192 Hz, inclusive, in powers of two.

Here is a file you can add to your kernel which will create a new
sysctl variable "kern.ticker". Setting this variable to any value
between 100 and 20000 will set the standard clock rate to that value.
Setting it to zero resets it back to what it was before.

This comes in very handy when you're trying to reproduce certain types
of bugs.... :-)

-Archie

___________________________________________________________________________
Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com

begin 644 ticker.c.gz
M'XL(`(&H+30"`XU4;6_:,!#^W/R*6RM5294!U:1M75^DC$(7#4$5PJI^BE+'
M-%9-0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