Date: Thu, 7 Jul 2011 15:41:13 +0200
From: =?iso-8859-1?Q?Lo=EFc?= Minier <lool@dooz.org>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Subject: Re: Qemu OMAP
Message-ID: <20110707134113.GB7613@bee.dooz.org>
References: <20110707123444.GD26643@game.jcrosoft.org>
 <20110707132316.GA7613@bee.dooz.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
In-Reply-To: <20110707132316.GA7613@bee.dooz.org>
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 07, 2011, Lo=EFc Minier wrote:
>  I just tried creating an image manually myself minutes ago after
>  building barebox for beagle and beagle_xload, but failed miserably, I'=
m
>  not sure why yet; I just get "qemu: hardware error: no boot device
>  found".  I will dig into this, as I need this for the UEFI research
>  too.

 Ok; QEMU seems to be picky about the FAT for some reason; will dig into
 this later, but here is how I got some of it working (and then breaking
 badly):

 * Create blank SD card (sparse) image, sufficiently big to allow FAT32 p=
arts (here: 256 MiB)
{{{
    % dd if=3D/dev/zero of=3Dsd.img bs=3D1M seek=3D256 count=3D0
}}}

 * Partition with a bootable FAT32 partition starting at +63s
{{{
    % parted sd.img
    (parted) unit s
    (parted) mklabel msdos
    (parted) mkpartfs primary fat32 63 -1
    (parted) toggle 1 boot
    (parted) quit
    % sudo mount -o loop,offset=3D$((63*512)) sd.img /mnt
    % sudo cp barebox/obj-omap3530_beagle_xload/barebox.bin.ift /mnt/MLO
    % sudo cp barebox/obj-omap3530_beagle/barebox.bin /mnt/barebox.bin
    % sudo cp barebox/obj-omap3530_beagle/barebox.bin /mnt/barebox
    % sudo umount /mnt
}}}
 * Boot in QEMU
{{{
    % qemu-system-arm -sd sd.img -nographic -M beagle
}}}

 You should get:
{{{


barebox 2011.07.0-00043-gd757dd4 (Jul  7 2011 - 15:06:10)

Board: Texas Instrument's Beagle
NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba ( )
Malloc space: 0x87bfff10 -> 0x87ffff10 (size  4 MB)
Stack space : 0x87bf7f10 -> 0x87bfff10 (size 32 kB)
unknown boot source. Fall back to nand
booting from NAND
qemu: fatal: Trying to execute code outside RAM or ROM at 0x402145f4

R00=3D40200000 R01=3D4020f800 R02=3D00000000 R03=3D00000030
R04=3D87c054b8 R05=3D87bfff10 R06=3D78500100 R07=3Dffffffff
R08=3D87bfff00 R09=3Dffffffff R10=3D00000000 R11=3D00000002
R12=3D40209ac4 R13=3D87bfff00 R14=3D4020f858 R15=3D402145f4
PSR=3D200001db --C- A und32
}}}

 to debug, you can use Ubuntu's gdb-multiarch (which allows debugging
 ARM binaries) and connecting to QEMU's gdb connection.

--=20
Lo=EFc Minier
