qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: John Williams <john.williams@petalogix.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	monstr@monstr.eu, duyl@xilinx.com, "Stefan Weil" <sw@weilnetz.de>,
	qemu-devel@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
	"Peter Crosthwaite" <peter.crosthwaite@petalogix.com>,
	linnj@xilinx.com, edgar.iglesias@petalogix.com,
	"Scott Wood" <scottwood@freescale.com>,
	"Eric Blake" <eblake@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [RFC PATCH 5/7] vl.c: added -kerndtb option
Date: Sun, 29 Jan 2012 20:28:30 -0600	[thread overview]
Message-ID: <4F26004E.4000507@codemonkey.ws> (raw)
In-Reply-To: <CACPZLaVw2Nz36k+qE8Cn0SG8sAfCpCtCA8+edjvmT9z=MN-0=w@mail.gmail.com>

On 01/29/2012 08:19 PM, John Williams wrote:
> On Mon, Jan 30, 2012 at 12:11 PM, Anthony Liguori<anthony@codemonkey.ws>  wrote:
>> On 01/29/2012 06:28 PM, John Williams wrote:
>>>
>>> On Sun, Jan 29, 2012 at 4:51 PM, Peter Crosthwaite
>>> <peter.crosthwaite@petalogix.com>    wrote:
>>>>
>>>> Hi All,
>>>>
>>>> So on the topic of these command line arguments for initrd, dtb and
>>>> friends,
>>>> another related issue we have encountered (and have hacked around in our
>>>> tree) is not being able to relocate the initrd or kernel. Currently these
>>>> memory locations are hardcoded in arm_boot.c:
>>>>
>>>> #define KERNEL_ARGS_ADDR 0x100
>>>> #define KERNEL_LOAD_ADDR 0x00010000
>>>> #define INITRD_LOAD_ADDR 0x00d00000
>>>>
>>>> If you see patch 6/7 in this same series I put in place a hack to
>>>> override
>>>> the initrd location in memory, but I wonder if instead this should go up
>>>> to
>>>> the command line interface as a parameter. Currently the machine model
>>>> (or
>>>> arm_boot.c) defines exactly where kernels/initrds/command-line-args line
>>>> in
>>>> memory, but since these are software properties should perhaps they go up
>>>> to
>>>> the command line as -kernel,foo=bar options? E.G:
>>>>
>>>> qemu-system-arm
>>>>
>>>> -kernel,kernel-image=/foo/zImage,kernel-addr=0x00010000,initrd=/foo/initrd,initrd_addr=0x00d00000
>>>
>>>
>>> There's an opportunity here - QEMU needs the cmdline ability to load
>>> random binaries/elfs anyway, such as
>>>
>>> --load file@address
>>
>>
>> Make an elf loader device if you desire this ability but I'm skeptical that
>> it really is all that useful.
>
> It is useful for non-Linux use-cases, of which there are many!

It's not just a matter of loading an elf binary in memory.  You probably need to 
have a specific register state set in order to run non-Linux elf binaries which 
means you'll need binary specific logic.

If all of these binaries you want to run have a well known register state, they 
you can just use fw_cfg and a piece of firmware to read the binary (which is 
basically how -kernel works on target-i386).

>
> Can you explain how you'd see such a 'loader device' in practice?  How
> does it get bound into the machine model?  How do we pass arguments to
> it?

You create a device via qdev (now QOM) that takes whatever properties you need. 
  You then do:

-device elf-loader,base=0xa00000,file=my-elf-binary

No different than adding a network card.

As I mentioned in the previous note, we probably should short cut unknown 
options as just assume they're meant for -device such that you could also do:

-elf-loader base=0xa00000,file=my-elf-binary

Regards,

Anthony Liguori

>
> Thanks,
>
> John

  reply	other threads:[~2012-01-30  2:28 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-23  7:20 [Qemu-devel] [RFC PATCH 0/7] Zynq-7000 EPP platform model Peter A. G. Crosthwaite
     [not found] ` <cover.1327302677.git.peter.crosthwaite@petalogix.com>
2012-01-23  7:20   ` [Qemu-devel] [RFC PATCH 1/7] cadence_uart: first revision Peter A. G. Crosthwaite
2012-01-24  2:02     ` John Linn
2012-01-24  8:07     ` Andreas Färber
2012-01-23  7:20   ` [Qemu-devel] [RFC PATCH 2/7] cadence ttc: " Peter A. G. Crosthwaite
2012-01-24  2:03     ` John Linn
2012-01-23  7:20   ` [Qemu-devel] [RFC PATCH 3/7] cadence_wdt: " Peter A. G. Crosthwaite
2012-01-24  2:03     ` John Linn
2012-01-23  7:20   ` [Qemu-devel] [RFC PATCH 4/7] cadence_gem: " Peter A. G. Crosthwaite
2012-01-24  2:05     ` John Linn
2012-01-23  7:20   ` [Qemu-devel] [RFC PATCH 5/7] vl.c: added -kerndtb option Peter A. G. Crosthwaite
2012-01-24  7:22     ` Andreas Färber
2012-01-24  7:35       ` Peter Crosthwaite
2012-01-24  7:50         ` Andreas Färber
2012-01-24 18:23       ` Stefan Weil
2012-01-26 19:34         ` Scott Wood
2012-01-26 21:27           ` Eric Blake
2012-01-27  8:25             ` Markus Armbruster
2012-01-29  6:51               ` Peter Crosthwaite
2012-01-30  0:28                 ` John Williams
2012-01-30  0:33                   ` John Williams
2012-01-30  2:11                   ` Anthony Liguori
2012-01-30  2:19                     ` John Williams
2012-01-30  2:28                       ` Anthony Liguori [this message]
2012-01-30  2:41                         ` John Williams
2012-01-30  2:48                           ` Anthony Liguori
2012-02-01  2:06                             ` John Williams
2012-01-30  2:10         ` Anthony Liguori
2012-01-26 19:40     ` Peter Maydell
2012-01-23  7:20   ` [Qemu-devel] [RFC PATCH 6/7] arm_boot: added initrd address override Peter A. G. Crosthwaite
2012-01-23  7:20   ` [Qemu-devel] [RFC PATCH 7/7] xilinx_zynq: machine model first revision Peter A. G. Crosthwaite
2012-01-23  8:00     ` Michal Simek
2012-01-23  8:22       ` Peter Crosthwaite

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=4F26004E.4000507@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=afaerber@suse.de \
    --cc=armbru@redhat.com \
    --cc=duyl@xilinx.com \
    --cc=eblake@redhat.com \
    --cc=edgar.iglesias@petalogix.com \
    --cc=john.williams@petalogix.com \
    --cc=linnj@xilinx.com \
    --cc=monstr@monstr.eu \
    --cc=peter.crosthwaite@petalogix.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=scottwood@freescale.com \
    --cc=sw@weilnetz.de \
    /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).