qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <andreas.faerber@web.de>
To: Julio Guerra <guerr@julio.in>
Cc: "Hervé Poussineau" <hpoussin@reactos.org>,
	qemu-ppc <qemu-ppc@nongnu.org>,
	qemu-devel@nongnu.org, "Fabien Chouteau" <chouteau@adacore.com>,
	"Alexander Graf" <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH prep for-1.5 v2] prep: Add ELF support for -bios
Date: Tue, 02 Jul 2013 15:53:46 +0200	[thread overview]
Message-ID: <51D2DB6A.2020406@web.de> (raw)
In-Reply-To: <CAFAwnGNSY3sV6L9R+0-bgqMe7D3EpN2S2gz6LqKhbptF8625EA@mail.gmail.com>

Am 02.07.2013 15:39, schrieb Julio Guerra:
> 2013/5/5 Andreas Färber <andreas.faerber@web.de>:
>> This prepares for switching from OpenHack'Ware to OpenBIOS.
>>
>> While touching the error handling code, switch from aborting hw_error()
>> to fprintf()+exit() and suppress failing without -bios for qtest.
>>
> 
> I still can't run bare-metal elf programs from -bios option. Where is
> the instruction pointer set to the elf program entry address ?

By definition, bare-metal programs run on real hardware and thus need to
have their entry point where the hardware expects it - either 0xfffffffc
or 0xfff00100 depending on -cpu model.

Note that when you run a -bios, no other firmware is loaded before, so
you need to populate the exception vectors yourself, such as 0xfff00700
below. You can peek at how OpenBIOS handles this for an example.

Magically changing the CPU's reset vector would be a clear deviation
from the hardware we're modelling. But if you spot differences between
real hardware and QEMU please do report that.

If you want to load a kernel on top of firmware (i.e., not bare-metal),
use -kernel instead.
On PReP that currently uses OpenHack'Ware; my latest attempts to switch
to OpenBIOS exited unexpectedly from the Forth runtime - any help with
debugging appreciated.

Andreas

> E.g. trying to run a bare-metal infinite loop linked at 0x4XXX. adresses :
> ./qemu-system-ppc -M prep -m 256M -bios loop.elf -nographic -d in_asm
> QEMU 1.5.50 monitor - type 'help' for more information
> (qemu)
> invalid/unsupported opcode: 00 - 00 - 00 (00000000) fffffffc 0
> IN:
> 0xfffffffc:  .long 0x0
> 
> invalid/unsupported opcode: 00 - 00 - 00 (00000000) fff00700 0
> IN:
> 0xfff00700:  .long 0x0
> 
> --
> Julio Guerra
> 

      reply	other threads:[~2013-07-02 13:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-05 17:45 [Qemu-devel] [PATCH prep for-1.5 v2] prep: Add ELF support for -bios Andreas Färber
2013-05-05 18:40 ` Alexander Graf
2013-05-05 19:00   ` Andreas Färber
2013-05-06  7:55     ` Fabien Chouteau
2013-05-06 16:10       ` Andreas Färber
2013-07-02 13:39 ` Julio Guerra
2013-07-02 13:53   ` Andreas Färber [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51D2DB6A.2020406@web.de \
    --to=andreas.faerber@web.de \
    --cc=agraf@suse.de \
    --cc=chouteau@adacore.com \
    --cc=guerr@julio.in \
    --cc=hpoussin@reactos.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).