网上找来找去,安装和使用ecos3.0的文档很少,也本着让自己记住和熟练的目 的,记下本文。

(系统环境:Ubuntu 8.10)

1.首先安装Tcl解释器和libstdc++5:

myz@ubuntu:~/work$sudo apt-get install tcl8.5 libstdc++5

2.然后按照ecos官网提示,下载文件ecos-install.tcl:

myz@ubuntu:~/work$wget --passive-ftp ftp://ecos.sourceware.org/pub/ecos-install.tcl

3.运行这个文件:

myz@ubuntu:~/work$ sh ecos-install.tcl
eCos installer v2.0.1 starting...
Written and maintained by Jonathan Larmour <jifl@eCosCentric.com>
Retrieving installer metadata information...
**************************************************
---------------------------------------------------------
Available distribution sites:
[1]    ftp://mirrors.kernel.org/sources.redhat.com/ecos
[2]    http://mirrors.kernel.org/sources.redhat.com/ecos
[3]    ftp://mirror.aarnet.edu.au/pub/sourceware/ecos
[4]    http://mirror.aarnet.edu.au/pub/sourceware/ecos
[5]    ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/ecos
[6]    http://www.mirrorservice.org/sites/sources.redhat.com/pub/ecos
[7]    ftp://gd.tuwien.ac.at/opsys/ecos
[8]    http://gd.tuwien.ac.at/opsys/ecos
[9]    ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/ecos
[10]    ftp://ftp.gwdg.de/pub/misc/sources.redhat.com/ecos
[11]    http://ftp.gwdg.de/pub/misc/sources.redhat.com/ecos
[12]    ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/sources.redhat.com/ecos
[13]    http://ftp-stud.fht-esslingen.de/pub/Mirrors/sources.redhat.com/ecos
[14]    ftp://bo.mirror.garr.it/mirrors/sourceware.org/ecos
[15]    http://bo.mirror.garr.it/mirrors/sourceware.org/ecos
[16]    ftp://ftp.u-aizu.ac.jp/pub/gnu/cygnus/ecos
[17]    ftp://ftp.chg.ru/pub/sourceware/ecos
[18]    ftp://ftp.sun.ac.za/pub/mirrorsites/sourceware.org/pub/ecos
[19]    http://ftp.sun.ac.za/ftp/pub/mirrorsites/sourceware.org/pub/ecos
[20]    ftp://ftp.twaren.net/Unix/Sourceware/ecos
[21]    http://ftp.twaren.net/Unix/Sourceware/ecos
[22]    ftp://mirror.facebook.com/sourceware/ecos
[23]    http://mirror.facebook.com/sourceware/ecos
[24]    http://sources-redhat.mirrors.airband.net/ecos
[25]    ftp://ecos.sourceware.org/pub/ecos
Please select a distribution site: 18
---------------------------------------------------------
Please select a directory for installation
[Default /home/myz/ecos]:
---------------------------------------------------------
Available prebuilt GNU tools:
[1]    arm-eabi
[2]    arm-elf (old)
[3]    i386-elf
[4]    m68k-elf
[5]    mipsisa32-elf
[6]    powerpc-eabi
[7]    sh-elf
[q]    Finish selecting GNU tools
("*" indicates tools already selected)
Please select GNU tools to download and install: 1
[*]    arm-eabi
[2]    arm-elf (old)
[3]    i386-elf
[4]    m68k-elf
[5]    mipsisa32-elf
[6]    powerpc-eabi
[7]    sh-elf
[q]    Finish selecting GNU tools
("*" indicates tools already selected)
Please select GNU tools to download and install: q
Directory /home/myz/ecos does not exist... creating.
Entering /home/myz/ecos
Retrieving GNU tools for arm-eabi
**************************************************
Retrieving eCos version 3.0
**************************************************
Downloads complete.
If you wish to disconnect from the internet you may do so now.
Unpacking ecoscentric-gnutools-arm-eabi-20081213-sw.i386linux.tar.bz2...
Unpacking ecos-3.0.i386linux.tar.bz2...
Generating /home/myz/ecos/ecosenv.sh
Generating /home/myz/ecos/ecosenv.csh
---------------------------------------------------------
In future, to establish the correct environment for eCos,
run one of the following commands:
   . /home/myz/ecos/ecosenv.sh         (for sh/bash users); or
   source /home/myz/ecos/ecosenv.csh     (for csh/tcsh users)
It is recommended you append these commands to the end of your
shell startup files such as $HOME/.profile or $HOME/.login
---------------------------------------------------------
Installation complete!

4.安装过程中,我选择了(1)arm-eabi 用于ARM (ARM7TDMI, ARM9, XScale)开发。

在我的安装目录~/ecos中,目录和主要文件为:

ecos3.0 ===> ecos3.0源文件

gnutools ===> arm-eabi交叉编译工具

ecosenv.csh ===> csh下环境变量设定脚本

ecosenv.sh ===> bash下环境变量设定脚本

5. 运行环境变量设定脚本文件,使系统可以找到arm-eabi工具:

myz@ubuntu:~/ecos$source ecosenv.sh

检查一下:

myz@ubuntu:~/ecos$echo $PATH

/home/myz/ecos/gnutools/arm-eabi/bin:/home/myz/ecos/ecos-3.0/tools/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:/usr/games:/usr/local/real:.
6. 试用arm-eabi:

新建一个hello.c:

int main()  {  return 0;  }

myz@ubuntu:~/work$arm-eabi-gcc -o hello hello.c

出现如下错误信息:/home/myz/ecos/gnutools/arm- eabi/bin/../lib/gcc/arm-eabi/4.3.2/../../../../arm-eabi/bin/ld: crt0.o: No such file: No such file or directory collect2: ld returned 1 exit status
出了什么事呢?Go google......

Hello World C program using Android Toolchain

一文中,对用arm-eabi编译andriod代码,做了详细的分析。

参考该文,加上-nostdlib选项:

myz@ubuntu:~/work$arm-eabi-gcc - nostdlib -o hello hello.c

编译有成功,但出现一个warning:

/home/myz/ecos/gnutools/arm-eabi/bin/../lib/gcc/arm-eabi/4.3.2/../../../../arm-eabi/bin/ld: warning: cannot find entry symbol _start; defaulting to 00008000
先放 着,以后解决它。

myz@ubuntu:~/work$file hello

hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV ), statically linked , not stripped
对比一下用arm-linux-3.4.1编译出来的:

myz@ubuntu:~/work$arm-linux-gcc -o hello hello.c

hello: ELF 32-bit LSB executable, ARM, version 1, for GNU/Linux 2.4.3, dynamically linked (uses shared libs), not stripped

最后总结:

安装基本上完成,但没有完全成功,中间出了点warning事件。察觉到arm- eabi 的代码是 statically linked 的,没有调用arm-eabi的库,并且找不 到 _start的符号地址。这个问题,在学习(2)中试着解决。

ubuntu 下达建eCos开发环境相关推荐

  1. linux 下安装ecos开发环境,Linux(Fedora10)下建立ecos开发环境

    本文是原创,转载请注明出处 在装好后的Linux系统(此处使用的是Fedora 10)后,开始准备建立ecos的开发环境 1.下载安装tcl/tk工具(linux是fedora10的可以省略这一步,其 ...

  2. Linux(Ubuntu 16) 下Java开发环境的配置(二)------Tomcat的配置及常见问题

    前言 相比于java JDK的配置,Tomcat的配置简单的多,简直就相当于直接运行了,本文以Tomcat8.0为例进行配置 1.Tomcat的下载 地址:https://tomcat.apache. ...

  3. ubuntu下搭建android开发环境(转载)

    在ubuntu下搭建android开发环境,准备学习一下android开发. 1.安装JDK        首先到oracle的官网上下载linux版本的JDK(网址为:http://www.orac ...

  4. ubuntu下ZED相机开发环境安装

    ubuntu下ZED相机开发环境安装 安装设置ROS 安装NVIDIA显卡驱动 安装CUDA 安装ZED SDK(SDK和CUDA的版本需要对应) 安装ZED ROS包 前三步的话在我拿到的机子上已经 ...

  5. Ubuntu安装以太坊开发环境

    Ubuntu安装以太坊开发环境 摘要 版本说明 介绍 开发环境的搭建 搭建以太坊 安装Nodejs 安装Solidity 安装Truffle 示例程序的运行 以太坊运行 Truffle框架的使用 Tr ...

  6. ubuntu 16.04 php 开发环境搭建

    ubuntu 16.04 php 开发环境搭建 mysql sudo apt install -y mysql-server mysql-client php 5.6 sudo add-apt-rep ...

  7. ④ESP8266 开发学习笔记_By_GYC 【Ubuntu系统下ESP8266 开发环境搭建】

    目录 ④ESP8266 开发学习笔记_By_GYC [Ubuntu系统下ESP8266 开发环境搭建] 一.安装前准备 1.乐鑫官方的ESP-IDF 编程指南 2.ESP-IDF风格的ESP8266 ...

  8. ubuntu下搭建android开发环境(四)核心篇安装AndroidStudio、sdk、jdk

    [置顶] ubuntu下搭建android开发环境(四)核心篇安装AndroidStudio.sdk.jdk(by 星空武哥) <div class="article_manage c ...

  9. 使用cygwin建立eCos开发环境(验证通过)

    转至:http://velep.com/archives/750.html 本文主要介绍在cygwin中建立eCos开发环境.在开始之前,请先安装好cygwin,参考本博文章:cygwin介绍.安装及 ...

最新文章

  1. B00009 C语言分割字符串库函数strtok
  2. Leetcode 102.二叉树的层序遍历 (每日一题 20210628)
  3. 启动定时器t0的工作指令是_看门狗的工作原理、应用和设计思路
  4. NYOJ 123 士兵杀敌(四)
  5. Eclipse(STS) 初次搭建Spring Cloud项目之声明式REST调用+负载均衡实现Feign(四)
  6. OpenCV图像缩放resize各种插值方式的比较
  7. 超级简单:一步一步教你创建一小型的asp.net mvc 应用程序
  8. Angular如何响应DOM event
  9. oracle 10g db_file,oracle 10g的db_file_multiblock_read_count参数
  10. c java通讯_java与c通讯
  11. 第十三讲:软考中高项13_战略管理、业务流程管理、知识管理
  12. VS2017安装方法
  13. Aqua Data Studio分号无法识别无法批量执行和字号等配置
  14. DEM数据如何生成高程点
  15. 淘宝宝贝改关键词有影响吗?如何修改?
  16. 遗传算法原理,交叉、变异、适应度函数的设置
  17. Zotero及部分常用插件安装和使用教程
  18. python 学习笔记2
  19. 腾讯云图-一次性加载全部数据
  20. 学习matlab体会,matlab学习心得体会

热门文章

  1. 《哥斯拉2》迅雷BT高清下载[MP4/mkv/1.42GB/2.35GB]超高清系画质[HD720p/1080p]
  2. 复制幻灯片(包括格式、背景、图片等)到同/另一个PPT文档
  3. 人大金仓数据库备份应用sys_dump的使用
  4. python可以在多种平台运行、体现了_在Windows平台上编写的Python程序无法在Unix平台运行。...
  5. Linux驱动面试题集锦
  6. 使用 LSTM 对销售额预测(tf.keras)
  7. 除去虚拟目录中的旧版本文件(临时文件下载、归档文件下载)
  8. Notepad2 可以替换xp记事本Notepad
  9. 虚拟服务器日语,云服务器日语
  10. 计算机被改成游戏,我的电脑主页被修改