-kernel does not work for multiboot ELF kernels

Bug #1044727 reported by Henning Schild
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

The multiboot header of a kernel image can contain the entry point and memory segment information. If it does not the kernel should have an ELF header that describes the memory segments and contains the entry point.

http://www.gnu.org/software/grub/manual/multiboot/multiboot.html#Header-layout

I have such a multiboot ELF kernel that can be loaded fine with grub and grub2 but not with the qemu -kernel flag. According to the ELF spec the entry field in the ELF header should contain the virtual address of the multiboot entry code. Qemu sets up the memory regions using the paddr fields from the ELF sections and then tries to start the kernel using the virtual entry address. This will fail with

>> qemu: fatal: Trying to execute code outside RAM or ROM

I wrote a simple kernel that can be used to reproduce this bug. Get this archive

http://os.inf.tu-dresden.de/~hschild/asmkernel.tar.gz

It contains the simple kernel, its source, plus grub and grub2 binaries to boot the kernel in qemu. The HOWTO file contains the command lines you should be using to rebuild the kernel and boot it an bare qemu or with one of the two bootloaders.

Find a patch that will fix this issue here:
http://os.inf.tu-dresden.de/~hschild/qemu-fix-elf-entry.patch

Revision history for this message
Kevin Wolf (kwolf-redhat) wrote :

Henning, please submit your patch to the qemu-devel mailing list. See http://wiki.qemu.org/Contribute/SubmitAPatch for more details on how patch submission works for qemu.

Aurelien Jarno (aurel32)
Changed in qemu:
status: New → Fix Committed
Aurelien Jarno (aurel32)
Changed in qemu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.