Hi!
I am quite novis to uClinux and would like some explainations why it did not
work as expected.
My plan is to run uClinux on an M5282EVB. But right now I just want to see
if the jump from CoLilo is done properly to my test-prog by writing a tiny
test program to just turn the display on.
I can managed to compile and run CoLilo from flash on my bord. My test-prog
looks like below:
#define MCF_MBAR 0x40000000
#define MCF_GPTPORT 0x1a001d
#define MCF_GPTDDR 0x1a001e
#define mbar_writeByte(x,y) *((volatile unsigned char *) (MCF_MBAR + x)) =
y
int main()
{
volatile unsigned char *mbar;
mbar = (volatile unsigned char *) MCF_MBAR;
// Turn the display on
mbar_writeByte(MCF_GPTDDR, 0x1);
mbar_writeByte(MCF_GPTPORT, 0x1);
return 0;
}
When compiling my test-prog for the first time I got errors below:
$ /usr/local/m68k-uclinux/bin/gcc -o test testMain.c
/usr/local/lib/gcc/m68k-uclinux/4.1.1/libgcc.a(__main.o): In function
`__do_global_ctors':
/home/gerg/src/gnu/m68k-elf/autobuild/gcc-4.1.1/gcc/libgcc2.c:1955:
undefined reference to `__CTOR_LIST__'
/home/gerg/src/gnu/m68k-elf/autobuild/gcc-4.1.1/gcc/libgcc2.c:1955:
undefined reference to `__CTOR_LIST__'
/home/gerg/src/gnu/m68k-elf/autobuild/gcc-4.1.1/gcc/libgcc2.c:1955:
undefined reference to `__CTOR_LIST__'
/usr/local/lib/gcc/m68k-uclinux/4.1.1/libgcc.a(__main.o):(.data+0x0):
undefined reference to `__DTOR_LIST__'
collect2: ld returned 1 exit status
After some search on the net I did add -elf2flt as the compile option:
$ /usr/local/m68k-uclinux/bin/gcc -o test -elf2flt testMain.c
And I did get test.o and test.gdb files. Then I'm combining my test-prog to
the end of CoLilo at 0x10008000 by commands below:
$ dd if=colilo.bin of=img
$ dd if=../test/test.gdb of=img bs=1024 seek=32 conv=sync
$ /usr/local/bin/m68k-uclinux-objcopy --input-target=binary
--output-target=srec --adjust-vma 0x10000000 img img.s19
When flashed down the img.s19 to my board with Lauterbach, I was able to run
the CoLilo as expected but when jumping to the test-prog it did not looks
like as what I've expected. Those two lines of code in main had been verify
to turn display on as expected when running directly in CoLilo. So something
is terribly wrong here, but where and why? Is there somebody who can
explains it for me?
Thanks in advanced,
Chatsuda
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev