2008/7/16 Stefan Reinauer <[EMAIL PROTECTED]>:
> 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
> vga_enable_console()
> (around line 233) helps?
to use SeaBIOS to initialize vga, refer to
http://www.coreboot.org/pipermail/coreboot/2008-July/036593.html
to return to coreboot from SeaBIOS, refer to
http://www.coreboot.org/pipermail/coreboot/2008-July/036620.html

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");
                call16_int(0x19, &br);
                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)
                return;
        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");
        #if 0
        #ifdef CONFIG_PCI_OPTION_ROM_RUN
                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)
                        return;
                ram = pci_rom_load(dev, rom);
                if (ram == NULL)
                        return;
                run_bios(dev, (unsigned long)ram);
        #endif
        #else
        #ifdef CONFIG_PCI_OPTION_ROM_RUN
                //zhang rui
                void run_seabios();
                run_seabios();
        #endif
        #endif
        }

Is this OK?


Zhang Rui

--
coreboot mailing list
[email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to