From owner-freebsd-current Fri Feb 27 08:19:17 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA12045 for freebsd-current-outgoing; Fri, 27 Feb 1998 08:19:17 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from critter.freebsd.dk (critter.freebsd.dk [195.8.129.14]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA11980 for ; Fri, 27 Feb 1998 08:18:49 -0800 (PST) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.8.7/8.8.5) with ESMTP id RAA03450; Fri, 27 Feb 1998 17:13:34 +0100 (CET) To: dannyman cc: freebsd-current@FreeBSD.ORG Subject: Re: Curious: "Timecounter"? In-reply-to: Your message of "Fri, 27 Feb 1998 09:51:15 CST." <19980227095115.05314@urh.uiuc.edu> Date: Fri, 27 Feb 1998 17:13:34 +0100 Message-ID: <3448.888596014@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <19980227095115.05314@urh.uiuc.edu>, dannyman writes: >arh0300 kernel log messages: >> Timecounter "i8254" frequency 1193182 Hz cost 2524 ns >> Timecounter "TSC" frequency 99952423 Hz cost 356 ns >> wcd0: 0Kb/sec, caddy >> wcd0: medium type unknown > >Wow, the new kernel compiling mechanism is kinda neat. > >I'm curious about these Timecounter lines. Can anyone explain, in terms a >fairly unsophisticated guy like me could understand, what these lines mean? It means that the machine has two pieces of hardware it can use for the construction of "time-of-day". "frequency" should be pretty obvious, "cost" is how long time it takes to read the counter, and consequently a measure of the overhead by using that timecounter. To get from the reading of the timecounters which is just a binary counter running at "frequency" to microtime() and/or nanotime() various scaled integer math is done. You can find the relevant code in sys/sys/time.h, sys/kern/kern_clock.c, sys/kern/kern_ntptime.c, sys/i386/isa/clock.c -- Poul-Henning Kamp FreeBSD coreteam member phk@FreeBSD.ORG "Real hackers run -current on their laptop." "Drink MONO-tonic, it goes down but it will NEVER come back up!" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message