[coreboot] Test : printing current time in serial debug

joe at settoplinux.org joe at settoplinux.org
Mon Jan 11 18:35:21 CET 2010

On January 11, 2010 at 2:24 PM Peter Stuge <peter at stuge.se> wrote:

> 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
> > feature.
> 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.
If you have an Intel chipset, I have meade some recent discoveries (thanks to
serialice) that the ICH southbridges actually have a timer built into the power
management registers. You could always do a read of this register at the
starting point and another read of this register at the ending point to
calculate load time if that is what you are looking for(some vender bios's use
this method to calulate memory timing). Hope that helps.

Joseph Smith

More information about the coreboot mailing list