From: Grant Likely <grant.likely@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, "patches@linaro.org" <patches@linaro.org>
Subject: Re: [Qemu-devel] [PATCH] Make -kernel flag optional on ARM.
Date: Wed, 10 Jul 2013 09:17:48 +0100 [thread overview]
Message-ID: <CACxGe6tWpsYWa_ufrhKwRu1C_1VjQCYMAejvbKLp5ujuNe2DeA@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA9GMc6ruO69cvhUgRGeewNyTvfTh5TzW4Sgwph7rpom6A@mail.gmail.com>
On Wed, Jul 10, 2013 at 8:44 AM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 10 July 2013 08:33, Grant Likely <grant.likely@linaro.org> wrote:
>> Sometimes we want to boot the system via firmware instead of loading a
>> kernel into ram with the -kernel parameter. This patch makes the -kernel
>> parameter optional so that a bios image provided by the -pflash flag
>> will be executed.
>>
>> For example:
>> qemu-system-arm -M vexpress-a15 -pflash <filename>
>>
>> Note: Currently the file must be at least the size of the emulated flash
>> device (64M) otherwise QEMU will silently not use the data. This will be
>> fixed in a separate patch
>>
>> This is part of the larger solution. For this to work it requires the
>> platform to have flash mapped or aliased to address 0 so that there is
>> some code for the emulator to execute.
>
> That patch is already on list :-)
Heh, I wrote the above before grabbing and testing your patch.
>> diff --git a/hw/arm/boot.c b/hw/arm/boot.c
>> index 7c0090f..3b9e108 100644
>> --- a/hw/arm/boot.c
>> +++ b/hw/arm/boot.c
>> @@ -361,12 +361,6 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info)
>> int big_endian;
>> QemuOpts *machine_opts;
>>
>> - /* Load the kernel. */
>> - if (!info->kernel_filename) {
>> - fprintf(stderr, "Kernel image must be specified\n");
>> - exit(1);
>> - }
>
> Why can't we just return from the function here? If we don't
> have a kernel we can assume we don't have a dtb or an initrd
> either. I don't think we want to do any of the other weird
> stuff with setting up a reset handler or boot pen for the
> secondary CPUs either -- we should just assume the bootrom
> image in the flash handles this.
I've just tested this, and you're right. I assumed that some of the
other stuff would be necessary, but it does work just fine to return.
Second version of the patch posted now.
g.
prev parent reply other threads:[~2013-07-10 8:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-10 7:33 [Qemu-devel] [PATCH] Make -kernel flag optional on ARM Grant Likely
2013-07-10 7:44 ` Peter Maydell
2013-07-10 8:17 ` Grant Likely [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=CACxGe6tWpsYWa_ufrhKwRu1C_1VjQCYMAejvbKLp5ujuNe2DeA@mail.gmail.com \
--to=grant.likely@linaro.org \
--cc=patches@linaro.org \
--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).