Presentation is loading. Please wait.

Presentation is loading. Please wait.

National Chung Cheng University,Taiwan,R.O.C eCos demo using x86 PCs I-Hung Lin Date:2004/4/29.

Similar presentations


Presentation on theme: "National Chung Cheng University,Taiwan,R.O.C eCos demo using x86 PCs I-Hung Lin Date:2004/4/29."— Presentation transcript:

1 National Chung Cheng University,Taiwan,R.O.C eCos demo using x86 PCs I-Hung Lin Date:2004/4/29

2 Introduction of Redboot Redboot (Red Hat Embedded Debug and Bootstrap ) Support for connection to a host-based debugger : Serial (RS-232) Ethernet (BOOTP, DHCP,TFTP )

3 Scenario

4 Step by step install eCos on host Set configtools on host Start redboot on target by Floppy disk Connect via RS-232 Using gdb to remote debug Run “hello world” example

5 Toolchain binutils gcc ecosconfig configtool Good news is that you can use the prebuild toolchain of eCos and it works fine!

6 Choice a site Choice 2 for i386 pc

7 Building eCos Kernel cd /opt/ecos ; source ecosenv.sh cd /opt/ecos/ecos-2.0/work/ mkdir ecos-pc ecos-pc-redboot applications cd ecos-pc ecosconfig new pc configtool ecos.ecc

8 Choose Floppy set baudrate (Default) Default console channel 2

9 Building application cd /opt/ecos/ecos-2.0/work/ mkdir applications ; cd applications vi hello.c i386-elf-gcc -g -D__ECOS –I../ecos-pc/install/include \ hello.c –L../ecos-pc/install/lib -Ttarget.ld -nostdlib i386-elf-objcopy -O binary a.out dd conv=sync if=a.out of=/dev/fd0 #include int main(void) { printf(“hello world!\n”); return 0; }

10 See in target PC Insert the floppy disk and boot. You will directly see on the monitor. Hello world!

11 Host commands # cd / opt/ecos/red_install/bin # ls -ial 509699 -rwxr-xr-x 1 root root 52160 Apr 28 10:15 redboot.bin 509698 -rwxr-xr-x 1 root root 269765 Apr 27 18:29 redboot.elf # dd conv=sync if=redboot.bin of=/dev/fd0 # cd /opt/ecos/ecos-2.0/example # i386-elf-gcc -g -I/opt/ecos/work_install/include hello.c - L/opt/ecos/work_install/lib -Ttarget.ld –nostdlib (Note that work is another template which packages type “default”!) # i386-elf-gdb –nw a.out (continued in next page)

12 #GNU gdb 5.3 (eCosCentric) Copyright 2002 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=i386-elf"... (gdb) set remotebaud 38400 (gdb) target remote /dev/ttyS0 (gdb) load Gdb remote debug setting

13 Reference http://sources.redhat.com/ecos/ http://sources.redhat.com/redboot/ http://sources.redhat.com/ml/ecos-discuss/ http://www.sfc.wide.ad.jp/~kei/ecos.html http://www.mlbassoc.com/examples/build_hello.html Especially Thank Mohasin for his useful advice. mohasin.zaki@wipro.com


Download ppt "National Chung Cheng University,Taiwan,R.O.C eCos demo using x86 PCs I-Hung Lin Date:2004/4/29."

Similar presentations


Ads by Google