2008年7月4日 星期五

eCos Building Note

http://ecos.sourceware.org/build-toolchain.html
Building a toolchain for use with eCos

  1. wget --passive-ftp ftp://ecos.sourceware.org/pub/ecos/ecos-install.tcl
  2. sh ecos-install.tcl


Anonymous CVS Access
http://ecos.sourceware.org/anoncvs.html


TOPDIR=`pwd`
ECOS_REPOSITORY=${TOPDIR}/ecos/packages ; export ECOS_REPOSITORY;
  1. Preparation
    apt-get install automake autoconf2.13 texinfo cvs tcl tcl-dev tk tk-dev

  2. Checkout eCos base repository
    1. mkdir -p ${TOPDIR};cd ${TOPDIR};
    2. cvs -z3 -d :pserver:anoncvs@ecos.sourceware.org/cvs/ecos co -P ecos ecos-host;
      Checkout
      cvs -z3 -d :pserver:anoncvs@ecos.sourceware.org:/cvs/ecos co -P ecos
      cvs -z3 -d :pserver:anoncvs@ecos.sourceware.org:/cvs/ecos co -r last-rhepl -P ecos
      Update
      cvs -z3 update -d -P
      cvs -z3 update -r last-rhepl -d -P
  3. Build ecosconfig
    1. mkdir -p ${TOPDIR}/ecos-host;cd ${TOPDIR}/ecos-host;
    2. ../ecos/configure --host=i686-linux-gnu -with-tcl-version=8.4;
      if failed(Ubuntu), try:
      TCL_INC_DIR=/usr/include/tcl8.4 ../ecos/configure --host=i686-linux-gnu --with-tcl-version=8.4;
    3. make CFLAGS="-march=i686" CXXFLAGS="-march=i686";
  4. Check eCos support list
    1. cd ${TOPDIR}/ecos
    2. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig list
  5. Install Toolchain
    1. cd ${TOPDIR};
    2. wget ftp://ecos.sourceware.org/pub/ecos/gnutools/i386linux/ecoscentric-gnutools-arm-elf-1.4-2.i386linux.tar.bz2
    3. tar xf ecoscentric-gnutools-arm-elf-1.4-2.i386linux.tar.bz2
    4. export PATH=${TOPDIR}/gnutools/arm-elf/bin/:${PATH}
  6. Build RedBoot
    1. mkdir -p ${TOPDIR}/ecos-build-redboot; cd ${TOPDIR}/ecos-build-redboot;
    2. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig new excalibur_arm9 redboot;
      an file named ecos.ecc is generated.
    3. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig import ${TOPDIR}/ecos/packages/hal/arm/arm9/excalibur/current/misc/redboot_RAM.ecm;
    4. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig tree;
    5. make;
      ${TOPDIR}/ecos-build-redboot/install/bin/redboot.elf
      ${TOPDIR}/ecos-build-redboot/install/bin/redboot.bin
  7. Build kernel core
    1. mkdir -p ${TOPDIR}/ecos-build-kernel; cd ${TOPDIR}/ecos-build-kernel;
    2. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig new excalibur_arm9 kernel;
      an file named ecos.ecc is generated.
    3. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig resolve;
    4. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig tree;
    5. make;
      ${TOPDIR}/ecos-build-kernel/install/lib/target.ld
      ${TOPDIR}/ecos/packages/hal/arm/arch/current/src/arm.ld
  8. Build network stack
    1. mkdir -p ${TOPDIR}/ecos-build-net; cd ${TOPDIR}/ecos-build-net;
    2. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig new excalibur_arm9 net;
      an file named ecos.ecc is generated.
    3. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig resolve;
    4. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig tree;
    5. make;
      ${TOPDIR}/ecos-build-network/install/lib/target.ld
      ${TOPDIR}/ecos/packages/hal/arm/arch/current/src/arm.ld
  9. Building eCos hello Application
    1. rm ${TOPDIR}/hello-app;mkdir -p ${TOPDIR}/hello-app; cd ${TOPDIR}/hello-app;
    2. cp ${TOPDIR}/ecos/examples/hello.c ${TOPDIR}/ecos/examples/build_Makefile
    3. ${TOPDIR}/ecos/examples/build_Make.params . -v;
    4. chmod +x build_Makefile build_Make.params ;
    5. SRCS=hello.c DST=hello ./build_Makefile ../ecos-build-net;
    6. make && arm-elf-objcopy -O srec hello hello.srec -v && arm-elf-objcopy -O binary hello hello.bin -v;
  10. Building eCos httpd Application
        KERN_TARGET=httpd-kernel;\
    APP_TARGET=httpd-app;\
    IMG_TARGET=httpd;\
    ADD_PKG=" HTTPD ";\
    CP_LIST=" ${TOPDIR}/ecos/packages/net/httpd/current/tests/httpd1.c ${TOPDIR}/ecos/examples/build_Makefile ${TOPDIR}/ecos/examples/build_Make.params";\
    SRCS=httpd1.c;\
    rm ${TOPDIR}/$${KERN_TARGET} ${TOPDIR}/$${APP_TARGET} -rf;\
    mkdir -p ${TOPDIR}/$${KERN_TARGET}; cd ${TOPDIR}/$${KERN_TARGET};\
    ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig new excalibur_arm9 net ${FAILEXIT};\
    for a in $${ADD_PKG} ; do ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig add CYGPKG_$$a ${FAILEXIT};done;\
    ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig resolve ${FAILEXIT};\
    ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig check ${FAILEXIT};\
    ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig tree ${FAILEXIT};\
    make ${FAILEXIT};\
    mkdir -p ${TOPDIR}/$${APP_TARGET}; cd ${TOPDIR}/$${APP_TARGET};\
    cp $${CP_LIST} ${TOPDIR}/$${APP_TARGET} -v ${FAILEXIT};\
    chmod +x build_Makefile build_Make.params ${FAILEXIT};\
    SRCS=$${SRCS} DST=$${IMG_TARGET} ./build_Makefile ${TOPDIR}/$${KERN_TARGET} ${FAILEXIT};\
    make && arm-elf-objcopy -O srec $${IMG_TARGET} $${IMG_TARGET}.srec -v && arm-elf-objcopy -O binary $${IMG_TARGET} $${IMG_TARGET}.bin -v ${FAILEXIT};\
    echo ================;\
    ls ${TOPDIR}/$${APP_TARGET}/$${IMG_TARGET} ${TOPDIR}/$${APP_TARGET}/$${IMG_TARGET}.srec ${TOPDIR}/$${APP_TARGET}/$${IMG_TARGET}.bin -al;\
    echo ================;










[1] ftp://mirrors.rcn.net/pub/sourceware/ecos
[2] http://mirrors.rcn.net/pub/sourceware/ecos
[3] ftp://mirror.ac.uk/sites/sources.redhat.com/ftp/ecos
[4] http://www.mirror.ac.uk/sites/sources.redhat.com/ftp/ecos
[5] ftp://sources-redhat.mirror.redwire.net/pub/sources.redhat.com/ecos
[6] http://sources-redhat.mirror.redwire.net/ecos
[7] ftp://mirrors.kernel.org/sources.redhat.com/ecos
[8] http://mirrors.kernel.org/sources.redhat.com/ecos
[9] ftp://planetmirror.com/pub/sourceware/ecos
[10] http://planetmirror.com/pub/sourceware/ecos
[11] ftp://gd.tuwien.ac.at/opsys/ecos
[12] http://gd.tuwien.ac.at/opsys/ecos
[13] ftp://sunsite.ms.mff.cuni.cz/MIRRORS/sources.redhat.com/pub/ecos
[14] ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/ecos
[15] ftp://ftp.gwdg.de/pub/misc/sources.redhat.com/ecos
[16] http://ftp.gwdg.de/pub/misc/sources.redhat.com/ecos
[17] ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/sources.redhat.com/ecos
[18] http://ftp-stud.fht-esslingen.de/pub/Mirrors/sources.redhat.com/ecos
[19] http://www.carfield.com.hk/mirror/sources.redhat.com/ecos
[20] ftp://ftp.unina.it/pub/Unix/cygnus/ecos
[21] http://ftp.unina.it/pub/Unix/cygnus/ecos
[22] ftp://ftp.chg.ru/pub/sourceware/ecos
[23] ftp://ftp.sun.ac.za/mirrorsites/sourceware.cygnus.com/pub/ecos
[24] http://ftp.sun.ac.za/ftp/mirrorsites/sourceware.cygnus.com/pub/ecos
[25] ftp://ftp1.sinica.edu.tw/pub3/GNU/CYGNUS/ecos
[26] ftp://ecos.sourceware.org/pub/ecos



On Ubuntu 8.04
checking for Tcl installation... configure: error: unable to locate Tcl header file tcl.h
configure: error: ../../../ecos/host/libcdl/configure failed for libcdl
configure: error: ../../ecos/host/configure failed for host

there is no such error in Debian

Re: [ECOS] Tcl install problem with current CVS
http://www.mail-archive.com/ecos-discuss@ecos.sourceware.org/msg07684.html

The issue exists for modern Tcl distributions. eCos's configure system
(look at acsupport/acinclude.m4) belives in that a TCL_INC_DIR variable
presents in tclConfig.sh. But, a new one: TCL_INCLUDE_SPEC had been
entered in modern tclConfig.sh and nowadays it replaces old variable.
So, try to build ecosconfig as
TCL_INC_DIR=/usr/include/tcl8.4 ../host/configure --with-tcl-version=8.4
or add TCL_INC_DIR variable in your site's tclConfig.sh.
Sergei



080706
Debian+VBox
I installed a Debian 4.0 r0 i3 on VirtualBox, and also the share folder support, and trying to access the shared folder on my Ubuntu /home, but some error occurred. I was root in Debian, but I was like normal user on the shared folder. Even if I I can create file, I failed whenever I try to checkout the eCos source with cvs
# cvs -z3 -d :pserver:anoncvs@ecos.sourceware.org/cvs/ecos co -P ecos ecos-host;
cvs [checkout aborted]: cannot open CVS/Entries.Log: Invalid argument
And ls -al ecos/CVS:
# ls ecos/CVS -al
drwxr-xr-x 1 root root 4096 2008-07-05 13:40 .
drwxr-xr-x 1 root root 4096 2008-07-05 13:40 ..
-rw------- 1 root root 0 2008-07-05 13:40 Entries
-rw------- 1 root root 3753948160 2008-07-05 13:40 Entries.Log
-rw------- 1 root root 5 2008-07-05 13:40 Repository
-rw------- 1 root root 47 2008-07-05 13:40 Root
Even if I checkout code from host, I failed at configuration:
# ../ecos/configure --host=i686-linux-gnu --with-tcl-version=8.4
(.........................................................)
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... yes
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for c++... c++
checking whether the C++ compiler (c++ ) works... yes
checking whether the C++ compiler (c++ ) is a cross-compiler... yes
checking whether we are using GNU C++... yes
(.........................................................)
checking for a 64 bit data type... long long
checking size of int *... configure: error: can not run test program while cross compiling
configure: error: ../../../ecos/host/infra/configure failed for infra
configure: error: ../../ecos/host/configure failed for host
while it is OK on Debian+PC.


080708
I tried again in a samba shared folder.
  • checkout eCos: No error occurred, just slooooooooow....
  • eCos configuration can be ran successfully. Neither the cross-compiler identification error has occurred.

I already stop trying to build eCos on virtual machine, because I finally fixed the building problem on Ubuntu. Refer to the above steps.


cat > x.ecm << __eof
cdl_component CYG_HAL_STARTUP {
user_value ROMRAM
};
cdl_option CYGBLD_GLOBAL_CFLAGS {
user_value "-mcpu=arm9 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O1 -gdwarf-2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority"
};

cdl_option CYGBLD_GLOBAL_LDFLAGS {
user_value "--no-target-default-spec -Wl,--gc-sections -Wl,-static -g -O1 -nostdlib"
};

__eof
${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig import x.ecm;
rm x.ecm -fv;


沒有留言: