On January 11, 2010 at 2:24 PM Peter Stuge peter@stuge.se wrote:
congedete@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.
Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org