[coreboot] SeaBIOS, serial output, and grub

Kevin O'Connor kevin at koconnor.net
Thu May 14 03:07:46 CEST 2009

On Wed, May 13, 2009 at 10:46:11AM -0400, Ward Vandewege wrote:
> On Tue, May 12, 2009 at 11:04:07PM -0400, Kevin O'Connor wrote:
> > This looks to be an issue with SeaBIOS serial port detection.  Can you
> > retry with the latest seabios git?  Make sure CONFIG_SERIAL is enabled
> > in SeaBIOS as grub relies on the serial ports being detected by the
> > bios.
> But - I just tried on both h8dme and m57sli with Seabios head as of today,
> and the bug appears to be gone! Did you change something?

Yes - I committed a fix on Tuesday just prior to sending my email.

On Wed, May 13, 2009 at 04:29:27PM -0400, Ward Vandewege wrote:
> If CONFIG_DEBUG_SERIAL is set to 1, the bug persists, but sgabios works.
> Boot log:
>   http://ward.vandewege.net/coreboot/seabios/20090513-seabios-serial-debug-grub-serial-slowness.cap
> Thoughts?

The problem is related to this log report:

 Found 0 serial ports

SeaBIOS still isn't properly detecting your serial port.  Can you
apply the patch below, up the debugging level to 6, and retry?

Also, unless I'm missing something, sgabios does not appear to be
working.  If it was working, I'd expect to see double characters - one
report from seabios and one report from sgabios - for example, I have
a log with:

B^MBoooott  ffaaiilleedd::  CCoouulldd  nnoott  rreeaadd  ffrroomm  CCDDRROOMM  ((cco
oddee  00000033))

It looks like the problem is related to the log report:

 Found option rom with bad checksum: loc=0x000cd000 len=3584 sum=76

which definitely looks wrong.  Can you grab the latest seabios git and
run "tools/checksum.py < sgabios.bin" and report the results?  I get:

$ l sgabios.bin
-rwxr-xr-x 1 kevin 3153 2009-04-29 21:15 sgabios.bin
$ tools/checksum.py < sgabios.bin

which is correct (the last two digits are 00).


--- a/src/serial.c
+++ b/src/serial.c
@@ -19,11 +19,15 @@ detect_serial(u16 port, u8 timeout, u8 count)
     outb(0x02, port+SEROFF_IER);
     u8 ier = inb(port+SEROFF_IER);
-    if (ier != 0x02)
+    if (ier != 0x02) {
+        dprintf(1, "ier=%x lcr=%x\n", ier, inb(port+SEROFF_LCR));
         return 0;
+    }
     u8 iir = inb(port+SEROFF_IIR);
-    if ((iir & 0x3f) != 0x02)
+    if ((iir & 0x3f) != 0x02) {
+        dprintf(1, "iir=%x lcr=%x\n", iir, inb(port+SEROFF_LCR));
         return 0;
+    }
     outb(0x00, port+SEROFF_IER);
     SET_BDA(port_com[count], port);

More information about the coreboot mailing list