[coreboot] How can I call the interrupt of SeaBIOS in coreboot?
zrfail at gmail.com
Thu Jul 17 03:50:17 CEST 2008
2008/7/16 Stefan Reinauer <stepan at coresystems.de>:
> Zhang Rui wrote:
>> Hello Kevin,
>> I can use SeaBIOS to initialize vga and return to coreboot now.
>> But when I returned to coreboot and call int19, nothing happens.
>> It can boot correctly when call int19 in SeaBIOS.
>> Maybe it has something to do with the stack?
>> How can I call the interrupt of SeaBIOS in coreboot?
> How are you doing this currently?
> Maybe coreboot-v2/src/mainboard/via/epia-m/vgabios.c:void
> (around line 233) helps?
to use SeaBIOS to initialize vga, refer to
to return to coreboot from SeaBIOS, refer to
For calling int19 in coreboot, I wrote a function in SeaBIOS:
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");
dprintf(1, "boot_coreboot: end\n");
and then use run_address() to execute this boot_coreboot() function in coreboot.
I will read coreboot-v2/src/mainboard/via/epia-m/vgabios.c:void
vga_enable_console() to see if it can help.
>>> But pci_dev_init() is executed more than one time so vga is
>>> initialized more than one time in SeaBIOS. A flag variable would be
>>> used to run SeaBIOS only once.
>> This is fixed now.
> How are you doing it? I think the correct way is to only initialize one
> given device for every call into the init function.
I inserted some codes at the beginning of run_seabios() which I wrote in vm86.c:
static int entered = 0;
if (1 == entered)
entered = 1;
So run_seabios() will run only once.
And original pci_dev_init() function in pci_device.c can not execute
to the run_bios() function, so I modified it to the following code:
void pci_dev_init(struct device *dev)
printk(BIOS_SPEW, "PCI: pci_dev_init\n");
void run_bios(struct device *dev, unsigned long addr);
struct rom_header *rom, *ram;
printk(BIOS_INFO, "Probing for option ROM\n");
rom = pci_rom_probe(dev);
if (rom == NULL)
ram = pci_rom_load(dev, rom);
if (ram == NULL)
run_bios(dev, (unsigned long)ram);
Is this OK?
More information about the coreboot