Hi On Mon, Oct 16, 2017 at 1:27 AM, Kevin Wolf <kw...@redhat.com> wrote: > Am 14.10.2017 um 15:41 hat Peter Maydell geschrieben: >> On 14 October 2017 at 00:21, Eduardo Habkost <ehabk...@redhat.com> wrote: >> > I don't believe the spec restricts that, but I don't see why it >> > would be useful to load an ELF file that doesn't match the target >> > architecture (e.g. loading non-x86 ELF files on a x86 machine >> > like PC).
I see what do you mean Eduardo. Yes it makes sense to restrict ELF to the currently emulated platform. On a second thought adding multiboot support for non x86 needs to go with other changes, e.g. multiboot.c should be moved out of hw/i386 to some platform-independent location. It probably worth to postpone this change until after Qemu gets multiboot2 support that explicitly states MIPS support, thus it will be easier to test this codepath on multiple platforms. So if you don't mind I'll remove this patch from the current patch series and put it into later one. >> >> Agreed. If we have non i386 boards that want to use multiboot >> we should probably move the common code out of hw/i386... > > Impossible with Multiboot 1, it's a spec that is really made for i386. > > The spec isn't really explicit about it being a requirement, but it does > say that its target are 32-bit OSes on PCs, and it defines the boot > state in terms of i386 registers, so it doesn't make sense for non-x86. > > From my interpretation of the spec, even support for 64-bit ELFs seems > to be (implicitly) out of spec (there is one place where it even says > "refer to the i386 ELF documentation for details"), but if GRUB > implements it... Yes GRUB has support for ELF64 multiboot loading and it successfully used by many projects in osdev community. This functionality has been added to GRUB 12 years ago https://github.com/coreos/grub/commit/ea4097134fbd834d2f688363f9a8208bf6a49ecd