493: Undecipherable

-Blog-

-Projects-

-About me-

-RSS-

SeaBIOS on Libreboot via Grub2

Dennis Guse

Libreboot mainly offers Grub2 as payload (at least for Lenovo X60). That’s quite nice and often sufficient as one can start Linux.

The default startup procedure of Libreboot is first start a deblobbed coreboot, which then loads Grub2. Coreboot, Grub2, and all configuration are flashed to the bios chip. This ROM is actually a large binary blob, which includes the Coreboot File System (CBFS). During the boot process, coreboot loads the CBFS from the bios chip into the RAM. So, every subsequent bootloader can access this file system to load configuration files or even load subsequent bootloaders.

On my Lenovo X60, I now wanted to have the following start procedure: coreboot -> Grub2 -> SeaBIOS. The simplest solution would be to just add the SeaBIOS ROM to the CBFS and flash the new CBFS (e.g., here). However, I don’t like the risky procedure of flashing my hardware and potentially bricking it (Lenovo X60 with 64bit C2D are really rare).

This can be easily solved by using Grub2’s capability to access harddrives. Thus, SeaBIOS can be loaded from Grub2 (using a USB thumbdrive):

chainloader (usb0,msdos1)/bios.bin.elf
boot

This works, but as the VGA-rom is not available only debug output via serial port if configured will be shown (e.g., screen /dev/ttyUSB0 115200). For VGA support, the SeaVGABIOS needs to be findable by SeaBIOS. If SeaBIOS was compiled with CBFS support, it could be put into the CBFS and flash it - not an option for me.

I asked on the SeaBIOS mailing list, and Kevin O’Connor told me that SeaBIOS supports multiboot (recently implemented by Vladimir Serbinenko).

multiboot (usb0,msdos1)/bios.elf.bin
module (usb0,msdos1)/vgabios.bin name=vgaroms/seavgabios.bin
boot

This works like charm and configuration files for SeaBIOS can be provided using this approach.

How I build SeaBIOS with VGA support for the Lenovo X60:

  1. git clone git://git.seabios.org/seabios.git (commit-id: d7adf6044a4c772b497e97272adf97426b34a249)
  2. make menuconfig (all other options default)
  3. General Features -> Build target: coreboot
  4. General Features -> coreboot CBFS support: disabled
  5. VGA ROM -> VGA Hardware Type: coreboot linear framebuffer
  6. make

Please note that CBFS support should be disabled, because coreboot loaded a CBFS. Thus, SeaBIOS might also use CBFS provided ROMs and also other bootloaders (such as the provided Grub2).

This works like charm: even a Windows 10 installer start loading (but is not functional).

Tiny issue as of today: the keyboard of my X60 works in Grub2, but for SeaBIOS I needed to use a external USB keyboard.