Colin D Bennett <[EMAIL PROTECTED]> writes:

> Hi Marco,
>
> On Thu, 03 Jul 2008 20:52:53 +0200
> Marco Gerards <[EMAIL PROTECTED]> wrote:
>
>> Hi Colin,
>> 
>> Colin D Bennett <[EMAIL PROTECTED]> writes:
>> 
>> > I have implemented high resolution time support (through the
>> > new grub_get_time_ms() function) using the RDTSC instruction
>> > available on Pentium and higher x86 CPUs.  The TSC value is simply
>> > a 64-bit block cycle counter that is zeroed at bootup, so
>> > grub_main() calls grub_time_init(), which is defined by each
>> > platform.  If a platform links to kern/i386/tsc.c, then the
>> > grub_time_init() function from tsc.c is used, which calibrates the
>> > TSC rate and absolute zero reference using the RTC.
>> What if TSC is not available?
>
> I updated the changelog entry to indicate that running on a 386 or 486
> will fail, since TSC is provided in Pentium+.  Do we support running on
> 386 or 386?  Should I check for this?  If so, the code will have to
> change a bit, and be able to select between the generic implementation
> and the TSC implementation at runtime.
>
> I think this would be best done letting the "grub_get_time_ms"
> implementation be selected by setting a function pointer in
> grub_machine_init() depending on the machine's capabilities.  I would
> have to significantly re-structure my patch, but it might be
> necessary (and could lead to more understandable code?).
> What do you think?

That would be great.  I do not want to drop 486 support just because
of this.  You could even drop back to a lower granularity of the timer
or better: submit code that does the trick for the 486 as well.

--
Marco
 



_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to