Chinaunix首页 | 论坛 | 博客
  • 博客访问: 109168
  • 博文数量: 17
  • 博客积分: 2288
  • 博客等级: 大尉
  • 技术积分: 410
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-20 09:04
文章分类

全部博文(17)

文章存档

2010年(8)

2008年(9)

分类:

2008-05-16 11:18:08

执行ecos的configtool工具(在centos5-vmware上)
1.缺少libgtk-1.2.0.so  libgdk-1.2.0.so
   yum install gtk+
2.缺少libpng.so.2
   yum install libpng10
 
RPM下载
文件: libpng10-1.0.26-1.el5.kb.i386.rpm
大小: 118KB
下载: 下载
3.缺少libgmodule
   yum install glib
 
设置ECOS_REPOSITORY=/ecos源代码/pakeages
设置PATH=$PATH:/ecos源代码/tools/bin:/交叉编译工具/bin
 
1.ecosconfig new pc redboot
2.ecosconfig check
3.ecosconfig tree
4.make
  此时会出现错误如下:
 
 

make -r -C hal/i386/arch/v2_0 /root/install/lib/vectors.o
make[1]: Entering directory `/root/hal/i386/arch/v2_0'
i386-elf-gcc -Wp,-MD,vectors.tmp -I/root/install/include -I/home/zhhuang/ecos/ecos-2.0/packages/hal/i386/arch/v2_0 -I/home/zhhuang/ecos/ecos-2.0/packages/hal/i386/arch/v2_0/src -I/home/zhhuang/ecos/ecos-2.0/packages/hal/i386/arch/v2_0/tests -I. -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority -c -o /root/install/lib/vectors.o /home/zhhuang/ecos/ecos-2.0/packages/hal/i386/arch/v2_0/src/vectors.S
tail: 无法打开 “+2” 读取数据: 没有那个文件或目录
make[1]: *** [/root/install/lib/vectors.o] 错误 1
make[1]: Leaving directory `/root/hal/i386/arch/v2_0'

make: *** [build] 错误 2

修改当前build目录下的hal/i386/arch/v2_0/makfile中的@tail +2 ...的2行为@tail -n +2 ...

$(PREFIX)/lib/vectors.o: $(wildcard $(REPOSITORY)/$(PACKAGE)/src/vectors.S)
        $(CC) -Wp,-MD,vectors.tmp $(INCLUDE_PATH) $(CFLAGS) -c -o $@ $<
        @echo $@ ": \\" > $(notdir

         +2 vectors.tmp >> $(notdir 改为
        @tail -n +2 vectors.tmp >> $(notdir $@).deps
        @echo >> $(notdir $@).deps
        @rm vectors.tmp
        

$(PREFIX)/lib/target.ld: $(wildcard $(REPOSITORY)/$(PACKAGE)/src/i386.ld)
        $(CC) -E -P -Wp,-MD,target.tmp -DEXTRAS=1 -xc $(INCLUDE_PATH) $(CFLAGS) -o $@ $<
        @echo $@ ": \\" > $(notdir $@).deps
        @tail -n +2 target.tmp >> $(notdir

 

 

论坛中找到的一个文章(http://www.mcuos.com/viewthread.php?tid=420&extra=page%3D1

在vmware上跑ecos,给你一篇文章你看看吧。

在vmware上跑ecos
下载ecos2.0
设置好工具链,x86的编译工具链带有 i386-elf- 前缀
解开ecos2.0代码,设置环境变量ECOS_REPOSITORY和交叉编译工具的PATH
我是写了一个脚本ecos.env内容如下
export ECOS_REPOSITORY=/home/wang_libo/opensource/ecos-2.0/packages/
export PATH=$PATH:/home/share/iros-tools/ecos/gnutools/i386-elf/bin/:/home/wang_libo/opensource/ecos-2.0/tools/bin/
其中/home/share/iros-tools/ecos/gnutools/i386-elf/bin/ 是i386-elf-工具链的路径
/home/wang_libo/opensource/ecos-2.0/tools/bin/          是 ecosconfig的路径
运行 source ecos.env设置好环境变量
step 1
在build目录下运行 ecosconfig new pc redboot ;生成了 ecos.ecc
U CYGSEM_HAL_USE_ROM_MONITOR, new inferred value 0
之后修改
cdl_component CYG_HAL_STARTUP {
   ...
#   line 2781 modified form
#   "# user_value RAM"
#   to
   user_value FLOPPY
   ...
};
cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT {
  ...
#   line 2914    modified form
#  "# user_value 0"
#   to
   user_value 2
  ...
};
step 2
运行 ecosconfig check
Target: pc
Template: redboot
No conflicts
这里ecosconfig check的作用是因为ecos的各个组件互相有依赖关系,我们step1修改了两个独立变量,依赖于这两个变量的其他变量值需要重
新计算。it's very important
step3
ecosconfig tree
生成hal  infra  install  io  isoinfra  language  makefile  net  redboot  services这一堆build tree
step4
make
生成目标文件./install/bin/redboot.bin
把这个redboot.bin作为vmware的软盘镜像,poweron
就可以看到redboot的提示了,如附件中的右图

////////////////////////////////////////////////////////////////////////////////////////////////////////
///
///                           Hello world!!!
///
////////////////////////////////////////////////////////////////////////////////////////////////////////
接下来我们来跑个hello world,程序员最浪漫的约会.
step1 运行 ecosconfig new pc
同上修改 cdl_component CYG_HAL_STARTUP {user_value FlOPPY}
  cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT {user_value 2}
step2 运行 ecosconfig check
step3 运行 ecosconfig tree
这里生成生成hal  infra  install  io  isoinfra  language  makefile  net  redboot  services等相关文件加
step4 运行 make
这里生成的目标文件是 ./install/lib/libextras.a 和 ./install/lib/libtarget.a(主要是这个)
step5 在ecos的example目录下copy一个hello.c到当前目录
i386-elf-gcc -g -D_ECOS -I./install/include hello.c -L./install/lib -Ttarget.ld -nostdlib
i386-elf-objcopy -O binary a.out hello.bin
生成了目标文件hello.bin
同样把hello.bin作为vmware的虚拟软驱启动,可以看到hello .ecos world! 如附件中的右图

说明一下运行ecos的虚拟机把ide硬盘去掉,就是不要挂ide硬盘.否则会处错.
阅读(2146) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~