efiboot – An UEFI payload for coreboot

Screenshots

Because coreboot, efiload and the UEFI code produce console only output, the “screenshot” is presented in text-only format.

The first line printed by efiload is:

UEFI Loader started [0x100000-0x24c06f]

Everything printed before that line is emitted by coreboot.

Control is handed over to the DXE core after efiload printed the following line:

Handing control to DXE core...

All output after that comes from the EDK II code. As you can see, the DXE core starts up and eventually aborts due to a failed assertion. This is because the Firmware Volume (FV) used in the test cycle does not contain any other modules than the DXE core itself. Consequently, the DXE core aborts because modules that are mandatory in order to provide all boot services demanded by UEFI are missing.

There are a lot of messages from the elf_lookup_symbol() method like the one below. Those seem to be harmless. They disappear if the output ELF image isn’t stripped as part of the build. To do that, adjust Conf/build_rule.txt and remove the –strip-unneeded parameter from the objdump call.

elf_lookup_symbol(): Failed to look up symbol 1!

In the previous “screenshot” published below, output from the EDK II code was not shown. This was because a few variables controlling debug output weren’t set properly during the build.

A remote GDB session however revealed that the DXE core does in fact run to the point where it attempts to jump into the “Boot Device Selection” protocol:

(gdb) c 
Continuing. 
^C 
Program received signal SIGINT, Interrupt. 
0x003155fe in CpuDeadLoop () 
at MdePkg/Library/BaseLib/CpuDeadLoop.c:37 
37 for (Index = 0; Index == 0;); 
(gdb) bt 
#0 0x003155fe in CpuDeadLoop () 
at MdePkg/Library/BaseLib/CpuDeadLoop.c:37 
#1 0x00301077 in DxeMain (HobStart=0x3eb4010) 
at MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c:481 
#2 0x003005c8 in ProcessModuleEntryPointList (HobStart=0x207000) 
at Build/Coreboot/DEBUG_ELFGCC/IA32/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/AutoGen.c:380 
#3 0x00300019 in _ModuleEntryPoint () 
#4 0x00103e31 in ?? () 
#5 0x00100d73 in ?? () 
#6 0x00100051 in ?? () 
#7 0x820fd045 in ?? () 
#8 0x00000000 in ?? () 
(gdb)

To start QEMU in a way that lets you attach the debugger, use the following command (on Ubuntu 12.10) in the coreboot build directory:

$ qemu-system-i386 -L . -bios coreboot.rom -nographic -m 64 -S -s

The debugger can be attached like this:

$ gdb -ex "target remote localhost:1234"