[coreboot] Test : printing current time in serial debug
peter at stuge.se
Mon Jan 11 15:24:32 CET 2010
congedete at voila.fr wrote:
> I want to display the current date and time inside functions like
> add_mainboard_resources, suspend_resume or to find the elapsed time
> between the end of coreboot and the end of the payload for example.
I suggest to do this is by passive measurement outside the running
code, e.g. by timestamping messages on the serial port or by timing
edges or data on a signal or bus which is accessible throughout the
execution of coreboot and the rest of the system.
Kevin O'Connor has written a script for serial port timestamping
which is available in the SeaBIOS repository. It also does accounting
for the serial port output overhead in coreboot, which is nice.
> I search how to get the current time from protected mode in
> coreboot. Since there is no library, I think the only way is to
> call real mode int 1ah from protected mode, but I can't find any
> example. Is it the only way ?
There are no BIOS interrupt services available in coreboot. If you
need them, you can use coreboot with a SeaBIOS payload, but it will
not help during execution of coreboot itself.
> If someone can help me or gives me the source to implement this
Basically you have to rely on what the hardware provides you. There
are several different timer peripherals in a modern x86 system and
which one you should use depends on lots of parameters (resolution
and maximum primarily, but also the cost of using the timers) for the
times that you want to measure, if you choose to do it internally in
the coreboot code.
More information about the coreboot