[BRLTTY] BRLTTY in GRUB2
Vladimir 'φ-coder/phcoder' Serbinenko
phcoder at gmail.com
Thu Mar 22 17:45:55 EDT 2012
On 22.03.2012 22:23, Dave Mielke wrote:
> [quoted lines by Vladimir 'φ-coder/phcoder' Serbinenko on 2012/03/22 at 20:50 +0100]
>
>> 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.
> But the returned value is still in ms?
Yes
> Is the base value (meaning of 0) truly unknown, or is it something like the
> time when grub was started?
Depends on time source. With TSC source it's supposed to be the time of
TSC calibration (but because of a bug I don't want to fix until after
release (it has no consequence) isn't) but at different platforms we use
different sources and it's often either the power-on time or unspecified.
> If the latter, does grub save the datetime of when
> it was started, in which case the actual current time in ms could be clculated?
Saving time is possible but the problem is that in order to combine both
sources into gettimeofday you'd need to synchronise the edge. Otherwise
you may have the effects like:
{x, 20} -> {x, 21}-> {x+1,22} gives you an impression of whole second
elapsed in between.
Or even worse
{x,998}->{x,999}->{x,0} which gives you an impression of time going
backwards.
Additionally the clock skew is different.
Moreover datetime unlike ticks isn't essential for GRUB, even though all
currently supported platforms provide one.
So I'd prefer if possible not to use datetime in anything which actually
modifies behaviour, at least per default, and not purely cosmetic (log
timestamps are cosmetic in GRUB since they are not saved in a file).
>> Also on some platforms you can get better resolution.
> Presumalby, with a different function?
Yes grub_get_rtc. Currently it's used only in clock backend and
shouldn't used by normal consumers. If higher resolution is desirable a
function can be introduced but some platforms e.g. ieee1275 provide only
milliseconds resolution.
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
More information about the BRLTTY
mailing list