On Tue, Sep 13, 2022 at 4:57 PM Clément Chigot <chi...@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 >