[coreboot] How can I call the interrupt of SeaBIOS in coreboot?
Zhang Rui
zrfail at gmail.com
Tue Aug 5 06:50:54 CEST 2008
Hello,
I am blocked with calling interrupt in coreboot.
I tryed these ways:
1. use "asm("int $0x19 \n");". Qemu has no output when executeed
here and nothing happens. The reason is that it should jump to real
mode before calling int 19.
2. write a function boot_coreboot() in seabios. like:
void VISIBLE32 boot_coreboot()
{
struct bregs br;
dprintf(1, "boot_coreboot: begin\n");
memset(&br, 0, sizeof(br));
dprintf(1, "boot_coreboot: call int 19\n");
call16_int(0x19, &br);
dprintf(1, "boot_coreboot: end\n");
}
then call boot_coreboot() in seabios. It booted successfully.
I have read the source code of call16_int, it jump to real mode and
jump to the int 19 handler function directly, but do not use "int
$0x19" asm code. why?
3. write asm code to jump to real mode and call int 19.
but in coreboot there is compiling errors when I write asm codes with
lables in it in vm86.c.
for a simple example:
__asm__ __volatile__ (
/* paranoia -- does ecx get saved? not sure. This is
* the easiest safe thing to do. */
" pushal \n"
" ljmp $0x28, $cbint16bit\n"
"cbint16bit: \n"
" .code16 \n"
" popal\n"
);
will cause errors:
{standard input}: Assembler messages:
{standard input}:746: Error: symbol `cbint16bit' is already defined
in seabios there is compiling errors because of ".code16":
out/../src/post.c:349: relocation truncated to fit: R_386_16 against `.text'
what is wrong here?
2008/7/17, Kevin O'Connor <kevin at koconnor.net>:
> On Thu, Jul 17, 2008 at 09:58:59AM +0800, Zhang Rui wrote:
> [...]
> > If I manually change to 16bit mode then call int19 in coreboot, will it be OK?
> > If it does, the 16bit mode option rom codes can use the int handler of SeaBIOS?
>
> It should work.
>
More information about the coreboot
mailing list