qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH 5/7] vl.c: added -kerndtb option


From: John Williams
Subject: Re: [Qemu-devel] [RFC PATCH 5/7] vl.c: added -kerndtb option
Date: Mon, 30 Jan 2012 10:33:17 +1000

On Mon, Jan 30, 2012 at 10:28 AM, John Williams
<address@hidden> wrote:
> On Sun, Jan 29, 2012 at 4:51 PM, Peter Crosthwaite
> <address@hidden> 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 address@hidden
>
> e.g. --load address@hidden

And while we're at it how about overriding arbitrary boot PC addresses as well?

--boot-addr 0xdeadbeef

It should be possible to boot random bootrom code in QEMU without
hacking on the machine model.

qemu-system-arm -M foo --file address@hidden --boot-addr 0x00001000

We bumped into this recently - we need a cleaner way of telling QEMU
if it's pretending to be just the machine with some minimal initial
state as above(for running bootloaders, baremetal etc), or it's being
the machine *plus* a bootloader (booting vmlinux/zimage).

Currently it's pretty hacky.

John






>
> -- load file.elf
>
> (no address required)
>
> This option or one like it would make it much easier and less
> hard-coded to assemble any sort of initial memory state.
>
> Extending this, kernels, initrds and DTBs all can have
> machine-specific preferred addresses but can be overriden in the same
> way:
>
> --kernel address@hidden --initrd address@hidden
>
> and so on
>
> The '@' symbol will need to be escaped by it's a pretty natural syntax.
>
> John
> --
> John Williams, PhD, B. Eng, B. IT
> PetaLogix - Linux Solutions for a Reconfigurable World
> w: www.petalogix.com  p: +61-7-30090663  f: +61-7-30090663



-- 
John Williams, PhD, B. Eng, B. IT
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com  p: +61-7-30090663  f: +61-7-30090663



reply via email to

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