qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel]  i386: don't require elf64 for multiboot kernel
@ 2018-12-04 16:55 Gonzo FWS
  2018-12-05  5:35 ` Thomas Huth
  0 siblings, 1 reply; 4+ messages in thread
From: Gonzo FWS @ 2018-12-04 16:55 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel@nongnu.org

Right now IncludeOS on x86_64 must use a chainloader for multiboot support. The chainloader is an ELF32 kernel that loads the real ELF64 kernel and jumps to it. As long as the ELF has the .multiboot section and conforms to the spec, meaning _start is be a 32-bit entry, it should be fine.

By removing the extra check in multiboot.c, we can also boot ELF64 files. As can be seen here:
https://cloud.fwsnet.net/index.php/s/XrkBkC8zy7MLa9p

Signed-off-by: Alf-André Walla <fwsgonzo@hotmail.com>
---
 hw/i386/multiboot.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c
index 1a4344f5fc..d07ebf3361 100644
--- a/hw/i386/multiboot.c
+++ b/hw/i386/multiboot.c
@@ -194,11 +194,6 @@ int load_multiboot(FWCfgState *fw_cfg,
         int kernel_size;
         fclose(f);

-        if (((struct elf64_hdr*)header)->e_machine == EM_X86_64) {
-            error_report("Cannot load x86-64 image, give a 32bit one.");
-            exit(1);
-        }
-
         kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
                                &elf_low, &elf_high, 0, I386_ELF_MACHINE,
                                0, 0);
--
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-05 13:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-04 16:55 [Qemu-devel] i386: don't require elf64 for multiboot kernel Gonzo FWS
2018-12-05  5:35 ` Thomas Huth
2018-12-05 12:20   ` Paolo Bonzini
2018-12-05 13:03     ` Gonzo FWS

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).