[SeaBIOS] [PATCH 0/7] vgabios improvements

Kevin O'Connor kevin at koconnor.net
Thu Apr 17 00:47:14 CEST 2014

On Wed, Apr 16, 2014 at 06:56:57PM +0200, Gerd Hoffmann wrote:
> Emulating attributes would be great so you can actually navigate
> bootloader menus.

I took a look a closer look at this.  Some things I found:

- it looks like the syslinux menu on recent Fedora versions doesn't
  work correctly at all in text mode.  This can be most easily seen by
  disabling CONFIG_VGA_VBE on one of the standard qemu seavgabios
  builds - without vbe syslinux wont go into graphics mode and the
  same broken text menu is shown.  So, this isn't a seavgabios issue
  but a fedora and/or syslinux issue.

- I took a quick look at what happens with the ati vgabios on my
  e350m1 if it is forced into a graphics mode (eg, mode 0x12).  I see
  similar results to what I see with coreboot native seavgabios.  So,
  it looks like most of our troubles are with the standard vgabios
  interface in graphics vs text mode and not something specific to

- The patch below seems to help a little with older Fedora versions
  using syslinux.  The idea is to try and treat the attr in graphics
  mode more like a text mode attr.  (The patch is broken for non
  native coreboot builds, but it demonstrates the idea.)
  Unfortunately, this patch doesn't help for the freedos menu - as
  that uses a different mechanism for setting the attributes (it fills
  areas of the screen with an attr and then separately writes text to
  the screen with the assumption that the existing text attr will
  remain in place).


--- a/vgasrc/vgafb.c
+++ b/vgasrc/vgafb.c
@@ -400,7 +400,7 @@ gfx_write_char(struct vgamode_s *vmode_g
         } else {
             int j;
             for (j = 0; j < 8; j++)
-                op.pixels[j] = (fontline & (0x80>>j)) ? ca.attr : 0x00;
+                op.pixels[j] = (fontline & (0x80>>j)) ? (ca.attr & 0x0f) : (ca.attr >> 4);
         op.op = GO_WRITE8;

More information about the SeaBIOS mailing list