qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alistair Francis <alistair23@gmail.com>
To: "Clément Chigot" <chigot@adacore.com>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
	"Bin Meng" <bmeng.cn@gmail.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: Question about loading bare metal firmware
Date: Wed, 14 Sep 2022 13:20:31 +0200	[thread overview]
Message-ID: <CAKmqyKNMtmNofT3utfAF-mf1__Ba1g1ErU3iscFaKa=sPYx9xQ@mail.gmail.com> (raw)
In-Reply-To: <CAJ307Ei=yXX_3jwhitUk7cEf=b70E2SuJEUDQTDRzszR=9wTHQ@mail.gmail.com>

On Tue, Sep 13, 2022 at 4:57 PM Clément Chigot <chigot@adacore.com> wrote:
>
> > > Hi all,
> > >
> > > I'm wondering if there is an official way to load bare metal software
> > > within qemu emulations.
> > > I've seen a lot of people (including us) using -kernel. However, the
> > > doc seems to imply that the generic loader would be a better approach
> > > (cf [1]). I know that the compatibility with older Qemus is one of the
> > > reasons why -kernel is still highly used. I've also seen that the
> > > reset vector can be initialized automatically by -kernel unlike with
> > > the generic loader (this is the case with RiscV AFAICT).
> > > But is there any kind of official recommendation on that topic ?
> >
> > The recommendation is in the document you linked. For bare metal use the
> > generic loader and make sure you put the blob in the right place so the
> > architectural reset vector will jump to it.
>
> Alright. I should have missed something when I tried with the generic loader.
> Thanks for the inputs and the confirmation that we were doing something wrong !

Just another note that for a few RISC-V machines we load OpenSBI by
default. So if you don't want OpenSBI you should also specify `-bios
none`. You should also be able to just use `-bios <my_elf>` to load
your bare metal application

Alistair

>
> Thanks,
> Clément
>


      reply	other threads:[~2022-09-14 11:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-13  9:38 Question about loading bare metal firmware Clément Chigot
2022-09-13 12:37 ` Peter Maydell
2022-09-13 13:53 ` Bin Meng
2022-09-13 14:35 ` Alex Bennée
2022-09-13 14:53   ` Clément Chigot
2022-09-14 11:20     ` Alistair Francis [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='CAKmqyKNMtmNofT3utfAF-mf1__Ba1g1ErU3iscFaKa=sPYx9xQ@mail.gmail.com' \
    --to=alistair23@gmail.com \
    --cc=alex.bennee@linaro.org \
    --cc=bmeng.cn@gmail.com \
    --cc=chigot@adacore.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@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).