Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JSImR-0007JO-Lh for mharc-grub-devel@gnu.org; Thu, 21 Feb 2008 16:16:35 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JSImO-0007Id-VP for grub-devel@gnu.org; Thu, 21 Feb 2008 16:16:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JSImO-0007IR-HI for grub-devel@gnu.org; Thu, 21 Feb 2008 16:16:32 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JSImO-0007IO-Em for grub-devel@gnu.org; Thu, 21 Feb 2008 16:16:32 -0500 Received: from ns39764.ovh.net ([91.121.25.85] helo=nexedi.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JSImO-0008Fq-6R for grub-devel@gnu.org; Thu, 21 Feb 2008 16:16:32 -0500 Received: from [10.8.0.46] (unknown [10.8.0.46]) by nexedi.com (Postfix) with ESMTP id 4D1DC3D92A for ; Thu, 21 Feb 2008 22:24:33 +0100 (CET) From: "Yoshinori K. Okuji" Organization: enbug.org To: The development of GRUB 2 Date: Thu, 21 Feb 2008 22:16:29 +0100 User-Agent: KMail/1.9.4 References: <20080217115240.GB8497@boeglin.org> <20080217145514.GA10562@boeglin.org> <20080221185348.GA6558@boeglin.org> In-Reply-To: <20080221185348.GA6558@boeglin.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200802212216.29374.okuji@enbug.org> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: Re: [PATCH] fix GRUB_TICKS_PER_SECOND in include/grub/efi/time.h 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: Thu, 21 Feb 2008 21:16:33 -0000 On Thursday 21 February 2008 19:53, Alexandre Boeglin wrote: > It has a resolution of 1 second, which is OK I think, as afaik grub_get_rtc > is only used to display timeout counters. I don't think it is so good. In the future, we will have more active use of the timer (e.g. animation). > And my machine, for example, does not even report more precise information > (the struct returned by the EFI call has a nanosecond member, but it's > content is always 0) ... I suggest that you should look at SetTimer. According to the spec, you can trigger an event periodically in the units of 10 nanoseconds. So this might be used to count a timer, if the precision is not too bad. Otherwise, although this is very much hardware-dependent, you could use RDTSC. With the Stall call, you should be able to measure the clocks per second (or millisecond or whatever). Once you find the number of clocks per unit time, RDTSC gives you a very precise timer. Okuji