test app
Vanalme Filip
F.Vanalme at TELEVIC.com
Tue Mar 8 10:52:49 EST 2011
> -----Original Message-----
> From: Baruch Siach [mailto:baruch at tkos.co.il]
> Sent: dinsdag 8 maart 2011 12:22
> To: Vanalme Filip
> Cc: barebox at lists.infradead.org
> Subject: Re: test app
>
> Hi Vanalme,
>
> On Tue, Mar 08, 2011 at 11:09:57AM +0100, Vanalme Filip wrote:
> > As a start, I just took over your Makefile and a minimal source file :
> >
> > __asm__ (".text\n"
> > ".globl _start\n"
> > "_start:\n"
> > "ldr sp, =0xA7E00000\n"
> > "bl main\n"
> > "stop:\n"
> > "b stop\n"
> > );
> >
> > int main (int argc, char *argv[])
> > {
> > return 0;
> > }
> >
> > I think I might still miss something because the assembler part gives me errors
> e.g.
> > " Error: no such instruction: 'ldr sp,=0xA7E00000' "
> > " Error: no such instruction: 'bl main' "
> > " Error: no such instruction: 'b stop' "
> >
> > Maybe a tab/space related issue ?
>
> Works for me (using the CodeSourcery toolchain):
>
> $ cat baretest.c
> __asm__ (".text\n"
> ".globl _start\n"
> "_start:\n"
> "ldr sp, =0xA7E00000\n"
> "bl main\n"
> "stop:\n"
> "b stop\n"
> );
>
> int main (int argc, char *argv[])
> {
> return 0;
> }
> $ arm-none-linux-gnueabi-gcc -Wall -Os -nostdlib baretest.c -o baretest.elf -Wl,-
> Ttext=0x78000000
> $ arm-none-linux-gnueabi-objdump -S baretest.elf
>
> baretest.elf: file format elf32-littlearm
>
>
> Disassembly of section .text:
>
> 78000000 <_start>:
> 78000000: e59fd00c ldr sp, [pc, #12] ; 78000014 <main+0x8>
> 78000004: eb000000 bl 7800000c <main>
>
> 78000008 <stop>:
> 78000008: eafffffe b 78000008 <stop>
>
> 7800000c <main>:
> 7800000c: e3a00000 mov r0, #0
> 78000010: e12fff1e bx lr
> 78000014: a7e00000 .word 0xa7e00000
>
> baruch
>
[Filip]
Baruch,
Compiling and linking seems to work well now. When I dump the .elf, I see that the start address is 0xA7E00000. That's what I wanted.
However, when loading the app in ram and executing it, I see that it tries to start from 0xA0000000 (this is the base address of the RAM section) :
barebox:/test tftp testapp.bin
TFTP from server 10.0.48.80 ('testapp.bin' -> 'testapp.bin')
barebox:/test cp testapp.bin /dev/ram0
barebox:/test go /dev/ram0
## Starting application at 0xA0000000 ...
?¶/ÿ'.e¢Óøñ_
_øýàõÒÿ ïO
ÿOÿðzþðöàþ A'}®ÿ
ùý"õÿ?O¿PP¼@Y
}¸m
×´ï@ïðx`G-/
Should I specify an address when executing 'go' or 'cp' ? Isn't it loading the app always at the beginning of the RAM space, i.e. 0xA0000000 ?
Filip
> --
> ~. .~ Tk Open Systems
> =}------------------------------------------------ooO--U--Ooo------------{=
> - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
More information about the barebox
mailing list