This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: Hello? World?
- To: Nick Clarey <nclarey at 3glab dot com>
- Subject: RE: [ECOS] Hello? World?
- From: Gary Thomas <gthomas at cambridge dot redhat dot com>
- Date: Tue, 19 Jun 2001 09:22:47 -0600 (MDT)
- Cc: ecos-discuss at sources dot redhat dot com
- Organization: Red Hat, Inc.
On 19-Jun-2001 Nick Clarey wrote:
> Howdy all,
>
> I'm having some wierdness with my attempts to build a hello world program.
>
This, of course, worked perfectly for me :-)
[gthomas@hermes hello-arm]$ make
arm-elf-gcc -mcpu=strongarm1100 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef
-Woverloaded-virtual -g -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc
-finit-priority -D__ECOS -fsigned-char -I/work/iPAQ/ecos/install/include -I. -c hello.c -o
hello.o
arm-elf-gcc -Wl,--gc-sections -Wl,-static -Wl,-N -g -L/work/iPAQ/ecos/install/lib -nostdlib
-nostartfiles -Ttarget.ld hello.o -o hello
[gthomas@hermes hello-arm]$ arm-elf-gdb -nw hello
GNU gdb 4.18-ecos-99r1-991015
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions. This version of GDB is supported
for customers of Cygnus Solutions. Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-elf"...
(gdb) arem
0x50046f54 in ?? ()
(gdb) lo
Loading section .rom_vectors, size 0x40 lma 0x20000
Loading section .text, size 0x2a410 lma 0x20040
Loading section .rodata, size 0xc24 lma 0x4a450
Loading section .data, size 0xc0c lma 0x4b074
Start address 0x20040 , load size 179328
Transfer rate: 25618 bits/sec.
(gdb) c
Continuing.
Hello, ecos world!
Program received signal SIGINT, Interrupt.
0x22ab0 in hal_idle_thread_action (count=32235364) at
/work2/ecc/ecc/hal/arm/arch/current/src/hal_misc.c:205
205 {
(gdb) q
The program is running. Exit anyway? (y or n) y
How did you configure your eCos kernel?
What vintage/version of eCos? RedBoot?
Note: I also tried running it directly from RedBoot which worked fine.
>
> -----
>
> [nclarey@nclarey hello-arm]$ make
> arm-elf-gcc -mcpu=strongarm1100 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef
> -Woverloaded-virtual -g -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc
> -finit-priority -D__ECOS -fsigned-char
> -I/home/nclarey/src/ecos-devel/kernel-build/install/include -I.
> -c hello.c -o hello.o
> hello.c: In function `main':
> hello.c:5: warning: implicit declaration of function `printf'
> arm-elf-gcc -Wl,--gc-sections -Wl,-static -Wl,-N -g
> -L/home/nclarey/src/ecos-devel/kernel-build/install/lib -nostdlib -nostartfiles -Ttarget.ld
> hello.o -o
> hello
> [nclarey@nclarey hello-arm]$ ls -al
> total 659
> drwxr-x--- 2 nclarey nclarey 1024 Jun 19 10:27 .
> drwxr-x--- 8 nclarey nclarey 1024 Jun 18 13:01 ..
> -rw-r----- 1 nclarey nclarey 979 Jun 18 13:40 Makefile
> -rwxr-x--- 1 nclarey nclarey 663741 Jun 19 10:27 hello
> -rw-r----- 1 nclarey nclarey 123 Jun 18 15:01 hello.c
> -rw-r----- 1 nclarey nclarey 1992 Jun 19 10:27 hello.o
> [nclarey@nclarey hello-arm]$ arm-elf-gdb hello
> GNU gdb 5.0
> Copyright 2000 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-elf"...
> (gdb) tar rem /dev/ttyS0
> Remote debugging using /dev/ttyS0
> 0x50046f84 in ?? ()
> (gdb) load
> Loading section .rom_vectors, size 0x40 lma 0xc0000000
> Loading section .text, size 0x5d08 lma 0xc0000040
> Loading section .rodata, size 0x374 lma 0xc0005d48
> Loading section .data, size 0x488 lma 0xc00060bc
> Start address 0xc0000040 , load size 25924
> Transfer rate: 25924 bits/sec, 294 bytes/write.
> (gdb) cont
> Continuing.
>
>
>
> Interrupted while waiting for the program.
> Give up (and stop debugging it)? (y or n) y
> (gdb) quit
>
> -----
>
> Attached is the makefile and the .c file. You'll obviously have to adjust
> it to suit your environment, but is there something obvious I'm doing wrong?
> The test programs (bin_sem0, for instance) seem to work fine.
>
> See ya,
>
> Nick
>
> --
> Nick Clarey, System Architect | "Sometimes when you fill a vacuum,
> 3G LAB | it still sucks." - Rob Pike
> ph 44-1223-478900 fax 44-1223-478901 |