[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-discuss] qemu -kernel u-boot.bin
From: |
Matwey V. Kornilov |
Subject: |
Re: [Qemu-discuss] qemu -kernel u-boot.bin |
Date: |
Fri, 13 Jun 2014 12:50:01 +0400 |
2014-06-13 2:43 GMT+04:00 Peter Maydell <address@hidden>:
> You said that u-boot.bin was a Linux kernel (that's what "-kernel"
> means for non-ELF files), so we load your binary in accordance
> with the documented requirements for booting a Linux kernel:
> * load kernel at offset 0x10000 in RAM
> * run a little stub code fragment to set r0 to 0, r1 to the board
> ID, r2 to the address of device tree / kernel ATAGS list, and
> then jump to the kernel start at offset 0x10000 into RAM
Thanks, I've started to realize that. Initially, I googled lots of
howto-s saying that I have to pass u-boot through -kernel.
> What you're seeing here is that we execute those four instructions
> which are the stub code loader and then jump to where your
> "kernel" starts.
>
> If you don't want to be started like a kernel, don't use -kernel :-)
>
> You could either (a) use an ELF file and take advantage of the
> fact we just load ELF files at the address they're linked at and
> then start at the ELF entrypoint or
Yes, this works, see my mail above.
(b) If you're really trying to be
> a boot rom you probably want to provide a complete 64MB flash
> image via the "-pflash flash.bin" command line argument
> (then don't use -kernel at all, and we'll start at address 0, which
> is the flash, just as the real hardware does).
What I am really want to do is to make u-boot to load the
kernel/initrd/dtb from the partition on sd image attached.
I am stuck here. I've put u-boot binary on the 0 of flash.bin (which
is 67108864 bytes long), and run following
qemu-system-arm -M vexpress-a9 -pflash pflash.bin -S -s
I have no warnings, but when I attach with gdb I either don't see my
code, and nothing happens again, execution just goes successively
until 0x04000000 reached.
--
With best regards,
Matwey V. Kornilov
http://blog.matwey.name
xmpp:address@hidden
Re: [Qemu-discuss] qemu -kernel u-boot.bin, Matwey V. Kornilov, 2014/06/10