On Sun, Jan 29, 2012 at 4:51 PM, Peter Crosthwaite
<peter.crosthwa...@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

e.g. --load image.bin@0xa4000000

-- 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 zImage@0x20000000 --initrd fs.img@0x40000000

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

Reply via email to