qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Rob Landley <rob@landley.net>
To: Alexander Graf <agraf@suse.de>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Andreas Färber" <andreas.faerber@web.de>,
	qemu-devel@nongnu.org, "Ben Leslie" <benno@benno.id.au>
Subject: Re: [Qemu-devel] Allow ARMv7M to be started without a kernel
Date: Mon, 09 May 2011 23:58:35 -0500	[thread overview]
Message-ID: <4DC8C5FB.3010500@landley.net> (raw)
In-Reply-To: <4DC7F62C.7030103@suse.de>

On 05/09/2011 09:11 AM, Alexander Graf wrote:
>> C) requires more research, because I have to make sure the entry point
>> is either doing the 16->32 (or 64) bit startup dance or that it's being
>> launched in the right mode (which the bios isn't doing), but vmlinux
>> doesn't need to be decompressed and copied so it's just making sure
>> we're expecting the right layer of stuff.  Which means reading through
>> arch/x86/boot to see what the vmlinux->bzImage packaging is adding, I
>> suppose.
> 
> The issue is that this is not how it works on real hardware.

Real hardware doesn't have the -kernel option.  On x86 that option is
currently patching the rdev area after loading the blob into DRAM.

> Grub won't just load a vmlinux file and boot it.

The -kernel option doesn't load grub, it loads a _kernel_.  -kernel is a
linux-specific bootloader.  It doesn't chainload other bootloaders.

> I'm not even sure how much exactly
> the early entry code handles in Linux before it jumps to the ELF entry
> point.
> 
> Either way, if you get something rolling that also ensures that it fails
> when it's an ELF file that's not Linux, I'd be very open to it :).

If it's an ELF file that's not Linux, I can ensure the result won't boot
Linux.  It's guaranteed to fail without me doing anything.

I don't understand your objection.  (The option is called -kernel.  It
does what it says on the tin.  If you feed it something that isn't a
kernel, which you can do now, this is pilot error.)

By the way, I just did "qemu -kernel qemu-img" an the emulated vga
screen was very colorful.  Feeding it qemu-io gave a different pattern
of vga text mode garbage.  It's happily loading an elf file _now_, and
spinning its little CPU on the resulting garbage...

>> But "-kernel vmlinux" is not currently at the top of my todo list, lemme
>> finish studying the v9fs code first...
>>
>>> Point being, the handling of -bios is board-specific (not even
>>> architecture-specific) and thus inconsistent.
>> So, currently, is -kernel.  Having it accept vmlinux on more platforms
>> would make it more consistent.  (Having -bios accept that too sounds
>> great, but is orthogonal to what I'm trying to do.)
>>
>>> Your points above - page
>>> tables, TLB entries etc. - only apply to -kernel but not to -bios, that
>>> should give us a bare-metal machine.
>> In 16 bit mode.
> 
> Depends on the machine. On PPC e500 for example, even with -bios we have
> to set up TLB entries, but those are at least defined by the spec :).

Yes, -kernel has to do setup work before starting the kernel.  This is
true now, it remains true if the kernel is in a different file format.
-kernel is a linux bootloader, which is not the same thing as the -bios
option.

Rob

  parent reply	other threads:[~2011-05-10  4:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-05  8:23 [Qemu-devel] Allow ARMv7M to be started without a kernel Ben Leslie
2011-05-05  9:56 ` Peter Maydell
2011-05-05 12:03   ` Ben Leslie
2011-05-05 13:20     ` Peter Maydell
2011-05-05 23:26   ` Alexander Graf
2011-05-05 23:50     ` Rob Landley
2011-05-06 12:48       ` Alexander Graf
2011-05-08 14:10         ` Andreas Färber
2011-05-08 18:25           ` Rob Landley
2011-05-09 14:11             ` Alexander Graf
2011-05-09 15:50               ` Peter Maydell
2011-05-10  5:36                 ` Rob Landley
2011-05-10  4:58               ` Rob Landley [this message]
2011-05-10  5:13                 ` Alexander Graf
2011-05-10 23:29                   ` Rob Landley

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=4DC8C5FB.3010500@landley.net \
    --to=rob@landley.net \
    --cc=agraf@suse.de \
    --cc=andreas.faerber@web.de \
    --cc=benno@benno.id.au \
    --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).