From owner-freebsd-hackers Sat Sep 27 17:50:29 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id RAA23839 for hackers-outgoing; Sat, 27 Sep 1997 17:50:29 -0700 (PDT) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id RAA23834 for ; Sat, 27 Sep 1997 17:50:26 -0700 (PDT) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id RAA26930; Sat, 27 Sep 1997 17:49:54 -0700 (PDT) Received: from bubba.whistle.com(207.76.205.7) by whistle.com via smap (V1.3) id sma026928; Sat Sep 27 17:49:45 1997 Received: (from archie@localhost) by bubba.whistle.com (8.8.5/8.6.12) id RAA03368; Sat, 27 Sep 1997 17:49:45 -0700 (PDT) From: Archie Cobbs Message-Id: <199709280049.RAA03368@bubba.whistle.com> Subject: Re: Raise your hand if you know how to make this work. In-Reply-To: <3.0.2.32.19970927053159.006c81e8@bugs.us.dell.com> from Tony Overfield at "Sep 27, 97 05:31:59 am" To: tony@dell.com (Tony Overfield) Date: Sat, 27 Sep 1997 17:49:45 -0700 (PDT) Cc: freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > >> 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-0FV'K>OZWW>V"6]ATI`"Y'SWW'//W=EIGSAP`HJ1)RI:!/_KUVXY?Q'L M,5?@=CTX/3O[!'^]2+\6A%<9A0L$:,]3DR`DEDW57GZ\?-QKUYJ@?>-@EJ(D!6T;$;=CZB/.9DS)G3CVX?/' M-I.I?K;#UB>D^M>)3).,+A@Q$CAV7L)AW(N&P0#ZDV$W#D?#L6T1@%0X&006 M)AX42KE2B(LI.R!2;2>'$_&S&(,Z!E2;1+4SL MW,+X?MR-!\FW8'@]Z$5)$-V,SQM4?P11&'P=]':I:DS-;15AT6`<3_I]Z[O$ MOXU&7=@@G_X/_^(+A)HCL?$]E/QP?)?M-R M:I3PH5F'#X?A(7X=>BLN32?7LYS6[)W_4\1Y12HXX%*9DDN>)68%+\%6#\9\ M4-"?>^TX[J4XU[JQ*;BN>46?9>X\+3).$_1TL:US'XYK'%\7+NBSYWE&"D%5 M)0H;;UJKX59)+R[AM-.QGAM,.K4C`KV_PH.Y$O#N$H:3P0".C]>N:*L+LR#K M&:Q]3-(=%F]:;S#-7_E[RPL)+:!O`-$!58(L<3`1"A8IK[`X%$%0;NXWIC3% M-6NDO=4J/?#.]DZL.)GFF.G6FLZYV0+76^E=%_2ZU-!D3"PMUU0$L*G5VZZP M*%)*GBLF5E'K!JV7T#.LO4VXVLULX9S_