qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/4] multiboot: load any machine type of ELF


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH 2/4] multiboot: load any machine type of ELF
Date: Fri, 13 Oct 2017 16:25:50 -0300
User-agent: Mutt/1.9.0 (2017-09-02)

On Thu, Oct 12, 2017 at 04:54:37PM -0700, Anatol Pomozov wrote:
> x86 is not the only architecture supported by multiboot.
> For example GRUB supports MIPS architecture as well.
> 
> Signed-off-by: Anatol Pomozov <address@hidden>
> ---
>  hw/i386/multiboot.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c
> index c9254f313e..7dacd6d827 100644
> --- a/hw/i386/multiboot.c
> +++ b/hw/i386/multiboot.c
> @@ -173,7 +173,7 @@ int load_multiboot(FWCfgState *fw_cfg,
>          }
>  
>          kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
> -                               &elf_low, &elf_high, 0, I386_ELF_MACHINE,
> +                               &elf_low, &elf_high, 0, EM_NONE,
>                                 0, 0);

I assume we still want PC to reject non-x86 ELF files.  Isn't it
better to add a elf_machine argument to load_multiboot() so each
load_multiboot() caller can specify what's the expected
architecture?


>          if (kernel_size < 0) {
>              fprintf(stderr, "Error while loading elf kernel\n");
> -- 
> 2.15.0.rc0.271.g36b669edcc-goog
> 

-- 
Eduardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]