On Mon, Apr 14, 2014 at 02:22:51PM +0200, Gerd Hoffmann wrote:
So you can try this:
qemu -vga std -bios /usr/share/coreboot.git/coreboot-i440fx-seabios.rom
to see it live in action.
Two problems spotted so far:
(1) ipxe hangs at rom load time. can be worked around by adding '-net none' to the qemu cmd line.
I've reproduced this. It only fails for me with -enable-kvm. It was (as I feared) the result of segment limits getting trashed from the int 1587 call. (Presumably, qemu tcg doesn't fail because it doesn't implement segment limits?) The (incorrect) patch below enables the boot to proceed past the ipxe prompt.
This is unfortunate. I can put a hack into seabios (not seavgabios) to use bigreal mode for int 1587 calls during option rom execution. But, it does raise the question of how many other callers expect the bios to not mess with the segment limits. (Though, to be honest, the only goal I have with coreboot native seavgabios is support for grub, lilo, syslinux, and maybe ntldr.)
--- a/src/system.c +++ b/src/system.c @@ -115,11 +115,11 @@ handle_1587(struct bregs *regs) SET_FARVAR(gdt_seg, gdt_far, GDT_DATA | GDT_LIMIT((6*sizeof(u64))-1) | GDT_BASE(loc)); // Initialize CS descriptor - SET_FARVAR(gdt_seg, gdt_far, GDT_CODE | GDT_LIMIT(BUILD_BIOS_SIZE-1) + SET_FARVAR(gdt_seg, gdt_far, GDT_CODE | GDT_GRANLIMIT(0xffffffff) | GDT_BASE(BUILD_BIOS_ADDR)); // Initialize SS descriptor loc = (u32)MAKE_FLATPTR(GET_SEG(SS), 0); - SET_FARVAR(gdt_seg, gdt_far, GDT_DATA | GDT_LIMIT(0x0ffff) + SET_FARVAR(gdt_seg, gdt_far, GDT_DATA | GDT_GRANLIMIT(0xffffffff) | GDT_BASE(loc));
u16 count = regs->cx;