On Mon, Feb 08, 2010 at 11:41:59AM +0100, congedete@voila.fr wrote:
Hello, I'm trying to read the timer in Seabios to test elapsed time between functions. Here is my code: static void readtimer(void) { // Read timer struct bregs br; memset(&br, 0, sizeof(br)); br.flags = F_IF; br.ah = 0x00;
call16_int(0x1a, &br);
dprintf(1, "timer:%d %d %d\n",br.cx,br.dx,br.al);
}
But gcc tells: undefined reference to `irq_trampoline_0x1a' (or 26 dec)
In order to use call16_int() an assembler "trampoline" needs to be defined. Just add "IRQ_TRAMPOLINE 1a" to the src/romlayout.S file next to the other trampolines.
BTW, the rdtscll() function and cpu_khz variable may be a more direct way of measuring times in SeaBIOS.
-Kevin