qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Re: [PATCH 2/2][RFC] Load an OpenBios ELF image instead of OpenHackware binary object if found
       [not found]   ` <1229635267-16897-3-git-send-email-Laurent@lvivier.info>
@ 2008-12-19  8:45     ` Aurelien Jarno
  2008-12-19 12:12       ` Paul Brook
  0 siblings, 1 reply; 4+ messages in thread
From: Aurelien Jarno @ 2008-12-19  8:45 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: Blue Swirl, qemu-devel

Laurent Vivier a écrit :
> This patch try to load an OpenBIOS ELF image instead of
> OpenHackware binary. Default behavior is used if the OpenBIOS (openbios-ppc32)
> file is not found

Actually, I wonder if it won't be simpler to just remove OpenHackware
and always use the OpenBIOS image.

> Signed-off-by: Laurent Vivier <Laurent@lvivier.info>
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
> ---
>  hw/ppc_mac.h      |    2 ++
>  hw/ppc_oldworld.c |   32 ++++++++++++++++++++++----------
>  2 files changed, 24 insertions(+), 10 deletions(-)
> 
> diff --git a/hw/ppc_mac.h b/hw/ppc_mac.h
> index 3a26cde..c833d17 100644
> --- a/hw/ppc_mac.h
> +++ b/hw/ppc_mac.h
> @@ -31,6 +31,8 @@
>  #define BIOS_FILENAME "ppc_rom.bin"
>  #define VGABIOS_FILENAME "video.x"
>  #define NVRAM_SIZE        0x2000
> +#define PROM_FILENAME    "openbios-ppc32"
> +#define PROM_ADDR         0xfff00000
>  
>  #define KERNEL_LOAD_ADDR 0x01000000
>  #define INITRD_LOAD_ADDR 0x01800000
> diff --git a/hw/ppc_oldworld.c b/hw/ppc_oldworld.c
> index 696add2..73cf4ab 100644
> --- a/hw/ppc_oldworld.c
> +++ b/hw/ppc_oldworld.c
> @@ -164,19 +164,31 @@ static void ppc_heathrow_init (ram_addr_t ram_size, int vga_ram_size,
>      /* allocate and load BIOS */
>      bios_offset = qemu_ram_alloc(BIOS_SIZE);
>      if (bios_name == NULL)
> -        bios_name = BIOS_FILENAME;
> +        bios_name = PROM_FILENAME;
>      snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name);
> -    bios_size = load_image(buf, phys_ram_base + bios_offset);
> +    cpu_register_physical_memory(PROM_ADDR, BIOS_SIZE, bios_offset | IO_MEM_ROM);
> +    /* First try OpenBIOS (ELF) */
> +    bios_size = load_elf(buf, 0, NULL, NULL, NULL);
>      if (bios_size < 0 || bios_size > BIOS_SIZE) {
> -        cpu_abort(env, "qemu: could not load PowerPC bios '%s'\n", buf);
> -        exit(1);
> -    }
> -    if (bios_size > 0x00080000) {
> -        /* As the NVRAM is located at 0xFFF04000, we cannot use 1 MB BIOSes */
> -        cpu_abort(env, "G3BW Mac hardware can not handle 1 MB BIOS\n");
> +
> +        /* OpenHackWare */
> +
> +        bios_name = BIOS_FILENAME;
> +        snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name);
> +        bios_size =  get_image_size(buf);
> +        bios_size = load_image_targphys(buf, (uint32_t)(-bios_size), bios_size);
> +        if (bios_size < 0 || bios_size > BIOS_SIZE) {
> +            cpu_abort(env, "qemu: could not load PowerPC bios '%s'\n", buf);
> +            exit(1);
> +        }
> +        bios_size = (bios_size + 0xfff) & ~0xffff;
> +        if (bios_size > 0x00080000) {
> +          /* As the NVRAM is located at 0xFFF04000,
> +           * we cannot use 1 MB BIOSes
> +           */
> +            cpu_abort(env, "G3BW Mac hardware can not handle 1 MB BIOS\n");
> +        }
>      }
> -    cpu_register_physical_memory((uint32_t)(-bios_size),
> -                                 bios_size, bios_offset | IO_MEM_ROM);
>  
>      /* allocate and load VGA BIOS */
>      vga_bios_offset = qemu_ram_alloc(VGA_BIOS_SIZE);


-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

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

* [Qemu-devel] Re: [PATCH 2/2][RFC] Load an OpenBios ELF image instead of OpenHackware binary object if found
@ 2008-12-19  8:56 laurent
  0 siblings, 0 replies; 4+ messages in thread
From: laurent @ 2008-12-19  8:56 UTC (permalink / raw)
  To: aurelien; +Cc: blauwirbel, qemu-devel

>Laurent Vivier a écrit :
>> This patch try to load an OpenBIOS ELF image instead of
>> OpenHackware binary. Default behavior is used if the OpenBIOS 
>(openbios-ppc32)
>> file is not found
>
>Actually, I wonder if it won't be simpler to just remove OpenHackware
>and always use the OpenBIOS image.

While OpenBIOS is not fully functional, I think we should allow to load OpenHackware.

Regards,
Laurent

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

* Re: [Qemu-devel] Re: [PATCH 2/2][RFC] Load an OpenBios ELF image instead of OpenHackware binary object if found
  2008-12-19  8:45     ` Aurelien Jarno
@ 2008-12-19 12:12       ` Paul Brook
  2008-12-19 18:13         ` Blue Swirl
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Brook @ 2008-12-19 12:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: Blue Swirl, Laurent Vivier, Aurelien Jarno

On Friday 19 December 2008, Aurelien Jarno wrote:
> Laurent Vivier a écrit :
> > This patch try to load an OpenBIOS ELF image instead of
> > OpenHackware binary. Default behavior is used if the OpenBIOS
> > (openbios-ppc32) file is not found
>
> Actually, I wonder if it won't be simpler to just remove OpenHackware
> and always use the OpenBIOS image.

I'm inclined to agree.
Supporting two different bios just adds confusion, especially when they're 
both broken.

Paul

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

* Re: [Qemu-devel] Re: [PATCH 2/2][RFC] Load an OpenBios ELF image instead of OpenHackware binary object if found
  2008-12-19 12:12       ` Paul Brook
@ 2008-12-19 18:13         ` Blue Swirl
  0 siblings, 0 replies; 4+ messages in thread
From: Blue Swirl @ 2008-12-19 18:13 UTC (permalink / raw)
  To: Paul Brook; +Cc: Laurent Vivier, qemu-devel, Aurelien Jarno

[-- Attachment #1: Type: text/plain, Size: 611 bytes --]

On 12/19/08, Paul Brook <paul@codesourcery.com> wrote:
> On Friday 19 December 2008, Aurelien Jarno wrote:
>  > Laurent Vivier a écrit :
>  > > This patch try to load an OpenBIOS ELF image instead of
>  > > OpenHackware binary. Default behavior is used if the OpenBIOS
>  > > (openbios-ppc32) file is not found
>  >
>  > Actually, I wonder if it won't be simpler to just remove OpenHackware
>  > and always use the OpenBIOS image.
>
>
> I'm inclined to agree.
>  Supporting two different bios just adds confusion, especially when they're
>  both broken.

This would make things easier. Updated patch attached.

[-- Attachment #2: ppc_openbios.diff --]
[-- Type: plain/text, Size: 2193 bytes --]

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

end of thread, other threads:[~2008-12-19 18:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-19  8:56 [Qemu-devel] Re: [PATCH 2/2][RFC] Load an OpenBios ELF image instead of OpenHackware binary object if found laurent
     [not found] <1229635267-16897-1-git-send-email-Laurent@lvivier.info>
     [not found] ` <1229635267-16897-2-git-send-email-Laurent@lvivier.info>
     [not found]   ` <1229635267-16897-3-git-send-email-Laurent@lvivier.info>
2008-12-19  8:45     ` Aurelien Jarno
2008-12-19 12:12       ` Paul Brook
2008-12-19 18:13         ` Blue Swirl

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).