From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JzViK-00010k-5J for mharc-grub-devel@gnu.org; Fri, 23 May 2008 07:45:36 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JzViI-0000zG-IG for grub-devel@gnu.org; Fri, 23 May 2008 07:45:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JzViH-0000xk-Ig for grub-devel@gnu.org; Fri, 23 May 2008 07:45:33 -0400 Received: from [199.232.76.173] (port=33973 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JzViH-0000xV-Dr for grub-devel@gnu.org; Fri, 23 May 2008 07:45:33 -0400 Received: from smtp-vbr1.xs4all.nl ([194.109.24.21]:1248) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JzViH-0004vh-04 for grub-devel@gnu.org; Fri, 23 May 2008 07:45:33 -0400 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr1.xs4all.nl (8.13.8/8.13.8) with ESMTP id m4NBjVp1096109 for ; Fri, 23 May 2008 13:45:31 +0200 (CEST) (envelope-from mgerards@xs4all.nl) From: Marco Gerards To: The development of GRUB 2 References: <20080512093354.2770e1cf@gibibit.com> Mail-Copies-To: mgerards@xs4all.nl Date: Fri, 23 May 2008 13:48:27 +0200 In-Reply-To: <20080512093354.2770e1cf@gibibit.com> (Colin D. Bennett's message of "Mon, 12 May 2008 09:33:54 -0700") Message-ID: <87fxs98cms.fsf@xs4all.nl> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by XS4ALL Virus Scanner X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 Subject: Re: Higher resolution timers X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2008 11:45:34 -0000 Hi Colin, Colin D Bennett writes: > To implement a nice GUI with some animations, it will be important to > have a timer with a better resolution than 1/18 second (which appears > to be the current GRUB timer resolution on the PC). Such patch will me more than welcome. We actually need this to get the ATA driver working on Coreboot. Furthermore, there are many other things we will need this for. I hope you can, when you have such a thing, can send in a patch for this? This will avoid duplicate work because we really need this soon. I expect I will need this for USB as well. > What would be the best way to do this? Possibilities that I am aware of > are: > * RDTSC instruction (must calibrate with RTC at startup?) > * HPET (complex to use?) > * RTC (can we set the timer interrupt rate to >18 Hz?) > > Does anyone have any thoughts on these options? > > I think that using the TSC (w/ RDTSC instruction) and calibrating it > with a quick 2-3 RTC tick loop at startup might be the easiest option. Only something that really returns a time seems like a good choise to me. AFAIK RDTSC returns clock cycles that passed since the system was switched on. This means that code will run faster on a processor with a higher clock speed. Am I mistaken? So I prefer something that can be used to wait a microsecond and not a certain amount of clock cycles. Using the RTC seems a good choice, but we have to keep in mind the BIOS uses it as well. Isn't HPET only available on newer processors? -- Marco