[coreboot] Building a Linux kernel payload of qemu

yajin zhouyajin at gmail.com
Mon Aug 11 15:12:13 CEST 2008

Hi everyone, I want to build coreboot and linux kernel as a payload. I
just followed this wiki article:
My host system is ubuntu 8.04 on dell vostro 1400 notebook.

1. checkout the coreboot v2 r2405
2. download qemu 0.90 and apply the three patches
3. make linux kernel elf
  mkelfImage --append="console=ttyS0"
--initrd=/boot/initrd.img /boot/vmlinuz linux.elf
4. building coreboot
4.1 Change payload in Confilg.lb to linux.elf
4.2 change option ROM_SIZE to 10*1024*1024 because linux.elf is about
9M. If ROM_SIZE is too small, coreboot will terminate with an error. So
I change ROM_SIZE to 10M.
4.3 copy qemu-bios.rom to qemu directory and rename it to bios.bin.
5. build qemu 0.9.0
6. run qemu

Because I just want to run coreboot and linux payload, So I do not
create hda img for qemu.

./qemu -L . -hda /dev/null -nographic -no-kqemu

Qemu exit with error message "qemu: could not load PC bios

I changed the BIOS_SIZE in vl.h to 11M and qemu did not work too.

#define BIOS_SIZE (10240+1024)*1024

But I download the coreboot and payload in
 http://www.coreboot.org/images/b/b9/Qemu_coreboot_filo.zip, it works.

I compare the bios.bin in Qemu_coreboot_filo.zip and the one I
created. The one I crated is ELF 32-bit LSB executable and the one in
Qemu_coreboot_filo.zip is data.

#file qemu-bios.rom
qemu-bios.rom: ELF 32-bit LSB executable, Intel 80386, version 1
(SYSV), statically linked, corrupted section header size

#file qemu_coreboot_filo.bin
qemu_coreboot_filo.bin: data

I think the qemu-bios.rom has wrong format and that is why qemu can not
load bios.bin I created. 
I use objcopy -O binary to get data file of qemu-bios.rom but it
outputs an empty file.

Any suggestions?  How can I build coreboot and linux kernel as payload
of qemu. Thanks.



More information about the coreboot mailing list