[Top][All Lists]

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

Re: [Qemu-arm] Booting Cortex-M3 Linux kernels in qemu

From: Guenter Roeck
Subject: Re: [Qemu-arm] Booting Cortex-M3 Linux kernels in qemu
Date: Tue, 19 Jun 2018 10:43:45 -0700
User-agent: Mutt/1.5.24 (2015-08-30)

On Tue, Jun 19, 2018 at 01:41:06PM +0100, Peter Maydell wrote:
> On 16 June 2018 at 19:53, Guenter Roeck <address@hidden> wrote:
> > On 06/16/2018 11:08 AM, Peter Maydell wrote:
> >> My general view is that where QEMU takes the path of "do what
> >> the hardware does", that is straightforward and doesn't lead
> >> us into future annoying deadends or misdesigns. Where QEMU
> >> does things that are not what the hardware does, that is where
> >> it's easy to go wrong. Real MPS2 hardware doesn't magically
> >> load Linux kernels and DTBs (it boots whatever the firmware
> >> image is).
> >
> > ... while mine is that I have no trouble running Linux test images
> > in qemu when it supports options such as -dtb and -initrd, while it
> > is a pain to run and maintain if I have to have a secondary loader
> > that isn't part of qemu. Guess we just have different perspectives.
> Well, somebody has to write and maintain the code that deals
> with the mismatch between how hardware starts up and how
> the kernel wants to be started. The question seems to me
> to be whether that should be in QEMU, in the kernel or a
> standalone bit of code... I don't think the overall effort
> required changes much. (Personally I'd put the code in the
> kernel, since it's about a dozen lines of asm and a linker
> script or two.)
> You need a boot-wrapper bit of code to run the kernel on the
> real hardware too. I haven't actually tested it but
> I think it ought to work in QEMU too (and if it doesn't
> that's a bug I'd like to fix):
>  https://github.com/ARM-software/bootwrapper/tree/cortex-m-linux

Thanks a lot for the link; that gave me enough information to find
a solution that is not too invasive and works for me.

I need to be able to run a single kernel image against multiple
devicetree files and root file systems. This doesn't work with
above solution since it bundles everything together (or, rather,
it would break my workflow). However, it was easy enough to tweak the
boot wrapper and load it using "-bios". I added support for "-bios",
"-initrd", and "-dtb" to mps2_common_init(). That change is simple
enough to carry in my private qemu branch.


reply via email to

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