[BRLTTY] BRLTTY in GRUB2

Vladimir 'φ-coder/phcoder' Serbinenko phcoder at gmail.com
Thu Mar 22 15:50:55 EDT 2012


On 22.03.2012 20:34, Dave Mielke wrote:
> [quoted lines by Vladimir 'φ-coder/phcoder' Serbinenko on 2012/03/22 at 20:19 +0100]
>
>> atexit in braille_core is not defined
> I can add this to our autoconf. Not that it'll ever be missing for us, of
> course, but it'll give you a #define to set in your copy of our config.h.
That would be great. It should be handled together with the availability 
of exit.
>> gettimeofday in braille_core is not defined
> Do you have struct timeval?
>
> You said there was a way to get reasonable resolution except that the base for
> the value isn't known. Is there a way to know what the resolution is? If so, we
> should be able to fake gettimeofday() even if it's reporting the wrong time. In
> most cases, that'll be okay.
We have common for all platforms:
grub_uint64_t grub_get_time_ms (); from <grub/time.h>
This gets you 1ms resolution except on i386 if no tsc support is 
available in this case you get only 55ms resolution but such cpu are 
rare nowadays.
Also on some platforms you can get better resolution. Do you need better 
resolution than 1ms?
grub_err_t grub_get_datetime (struct grub_datetime *datetime); from 
<grub/datetime.h>
It returns the broken down representation since on all platforms we 
support except emu it's the way timer supplies us the info. It can be 
converted to unixtime if needed (I've already added the wrapped time and 
localtime, except that localtime is actually gmtime).
GRUB has no concept of timezones and supposes that all times are in UTC. 
It assumes BIOS clock is in UTC as well. Unfortunately not always true 
but GRUB doesn't use the time for anything serious by default.



-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



More information about the BRLTTY mailing list