[coreboot] [PATCH] Free VGA BIOS for K8M890

Kevin O'Connor kevin at koconnor.net
Sat Apr 25 16:46:43 CEST 2009


On Sat, Apr 25, 2009 at 04:01:09PM +0200, Rudolf Marek wrote:
> I managed to catch all I/O for init of K8M890 IGP. Attached patch is for
> http://www.nongnu.org/vgabios/. With a patch one can have a console and some VGA
> resolutions also might work.
> 
> It is just a interesting result.

So, you got the open source vgabios to boot on real hardware.  Very nice!

> I used libx86 library to catch all IO. It was quite painful until I
> realize that the emulator cannot handle properly opcodes like
> 
> 0x66 0xe8 .. .. 0xff 0xff and also mov al,cs:[ebx] which I get
> caught in Sebios int 15 routine.

Most of SeaBIOS is compiled with gcc.  gcc generates regular 32bit
code.  Then a gnu assembler (gas) hack is used to make that 32bit code
run while the processor is in 16bit mode.

As such, I can't think of any way to stop the 0x66/0x67 prefixes -
they are inherent to the process.

> Those were just directly transformed with bash script to IO calls in
> patch. The BIOS works, it even sets the memory speed grade, but not
> the mem size to scratch registers (it uses SeaBIOS VIA vga hooks for
> this)

It would be nice to port the open source vgabios from bcc to gcc.
(Much like what was done with bochs bios/SeaBIOS.)  Doing so will make
understanding and manipulating the code much easier.

I actually started this 5 months ago - I ported all the assembler to
pseudo C code.  I realized it was more work than I originally
anticipated, and so it stalled.

> +mov al, #0x1
> +mov dx, #0x3c3
> +out dx,al
> +mov ax, #0x32
> +mov dx, #0x3c4
> +out dx,ax
> +mov al, #0x10
> +mov dx, #0x3c4
> +out dx,al
[...]

I suspect some of these IO accesses would be done by the vgabios
anyway - some things like screen clearing and palette selection are
standard.  Which parts are standard and which parts are via specific
is an open question though.

-Kevin




More information about the coreboot mailing list