[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Higher resolution timers

From: Marco Gerards
Subject: Re: Higher resolution timers
Date: Fri, 23 May 2008 13:48:27 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

Hi Colin,

Colin D Bennett <address@hidden> 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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]