4

This question has been asked before, but not answered.

I am trying to boot an uncompressed RTEMS ELF file

> qemu-system-x86_64 -kernel ./rtems-elf.exe

Results in

qemu-system-x86_64: Error loading uncompressed kernel without PVH ELF Note

I have built many kernels for rtems RTOS, however, for a sanity check, I tried booting an example from rtems, so there should ideally be no problem with the code. I've also tried booting an uncompressed linux kernel (real time and regular) and I get the same error.

Some useful information:

> file rtems-elf.exe
hello.exe: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, with debug_info, not stripped
> qemu-system-x86_64 --version
QEMU emulator version 4.0.0
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers

Host - Arch linux x86_64

Some other attempts:

This example is a realtime linux kernel with the PREEMPT_RT linux patch, I have bzImage, but I just tested qemu's ability to boot a non compressed kernel

> file vmlinux
vmlinux: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=fd95cdeb00595f6742b0a41eda4f0c33172588fe, not stripped

> qemu-system-x86_64 -kernel ./vmlinux -append "--console=/dev/com1" -serial stdio -vga cirrus
qemu-system-x86_64: Error loading uncompressed kernel without PVH ELF Note

Thanks and please let me know if I missed anything

Another thread of the same topic is found here https://stackoverflow.com/questions/55688241/qemu-error-loading-uncompressed-kernel-without-pvh-elfnote but this is a broken link

And here QEMU: Error loading uncompressed kernel But this has not been answered and I figured I'd bring it up again

1

1 Answer 1

5

QEMU >= 4.0 is able to boot x86_64 ELF image with the PVH header. Linux >= 4.21 provides a configuration flag (CONFIG_PVH=y must be enabled in the Linux config file) to enable that header in the vmlinux ELF image.

QEMU requires PVH entry point defined in the x86/HVM direct boot ABI to boot x86_64 ELF image. The x86/HVM direct boot ABI was initially developed for Xen guests, but with latest changes in both QEMU and Linux, QEMU is able to use that same entry point for booting KVM guests.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .