[coreboot] mkelfimage with CBFS?

Cristi Magherusan Cristi.Magherusan at net.utcluj.ro
Sun Aug 9 22:57:22 CEST 2009


On Sun, 2009-08-09 at 22:33 +0200, Peter Stuge wrote:
> Cristi Magherusan wrote:
> > if mkelfimage is still needed
> 
> I don't know.
> 
> 
> > ELF vmlinux binary with initramfs
> 
> Yes, it's a good idea. Please try it and report if it works. Also see
> http://www.coreboot.org/Initramfs

I have a similar image generated using buildroot(for the
userland/initramfs), and the kernel's initramfs option that allows it to
use a designated directory.

It seems to fail with both approaches when using CBFS (qemu with LAB kernel).
With mkelfimage qemu crashes, while without it freezes while trying to
load the kernel.
The same kernel boots in qemu when compiled as bzImage, and the
userspace is loaded fine.

> 
> > Does it have anything to do with the multiboot specification,
> 
> No, multiboot is a separate topic.
> 
> > or why does coreboot need the ELF to be modified using the
> > mkelfImage tool?
> 
> I am not sure that it does need that. Did you try using the plain
> vmlinux?
Yes, still fails.

> Can you compare the vmlinux entry point with the entrypoint of an
> mkelfImaged ELF image?
It differs, I suppose mkelfimage adds its own binary glue that will run
before calling the real kernel image. Here's the "readelf -h" output for
both(first is with mkelfImage).

File: ./buildroot-payload.elf
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           Intel 80386
  Version:                           0x1
  Entry point address:               0x10000
  Start of program headers:          52 (bytes into file)
  Start of section headers:          0 (bytes into file)
  Flags:                             0x0
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         5
  Size of section headers:           0 (bytes)
  Number of section headers:         0
  Section header string table index: 0

File: ./vmlinux
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           Intel 80386
  Version:                           0x1
  Entry point address:               0x100000
  Start of program headers:          52 (bytes into file)
  Start of section headers:          4995368 (bytes into file)
  Flags:                             0x0
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         3
  Size of section headers:           40 (bytes)
  Number of section headers:         30
  Section header string table index: 29

I'll try to make the kernel entry point the same as mkelfimage, but I
doubt it will work. Any other ideas?

If anyone decides to give it a try, the kernel images are available
here: http://panzer.utcluj.ro/~alien/coreboot/elfs.tar.bz2

Thanks,
Cristi

-- 
Ing. Cristi Măgherușan, System/Network Engineer
Technical University of Cluj-Napoca, Romania
http://cc.utcluj.ro  +40264 401247
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20090809/6bc80a9c/attachment.sig>


More information about the coreboot mailing list