Chinaunix首页 | 论坛 | 博客
  • 博客访问: 248671
  • 博文数量: 38
  • 博客积分: 2093
  • 博客等级: 大尉
  • 技术积分: 432
  • 用 户 组: 普通用户
  • 注册时间: 2010-04-01 10:29
文章分类

全部博文(38)

文章存档

2011年(10)

2010年(28)

我的朋友

分类: 嵌入式

2010-06-24 10:42:51

1 挂载目录

 #mkdir /mnt/cdrom

#mount -t iso9660 /dev/cdrom /mnt/cdrom

2 更改权限 #chmod /mnt/cdrom

 3 进入/mnt/cdrom,执行

 #cd /mnt/cdrom

 #./install -d /home/hhg/PowerPc/ELDK ppc_4xx

注:/home/hhg/PowerPc/ELDK 为安装目录

 ppc_4xx是与目标板的CPU相对应的

4 设置环境变量

进入目录/home/hhg

#cd /home/hhg

#vi .bashrc

添加以下内容

CROSS_COMPILE=ppc_4xx

PATH=$PATH:/home/hhg/PowerPc/ELDK/usr/bin:/home/hhg/PowerPc/ELDK/bin

export CROSS_COMPILE PATH

#source .bashrc

使更改立即执行

5 创建一个.c文件

如 hello.c

 #include

int main()

{

printf("hello world\n");

 }

#ppc-linux-gcc -o hello hello.c

在Linux系统下执行

 #./hello

bash:./hello:cannot execute binary file

 6 将可执行文件导入目标板执行

显示hello world 成功!

 

 注:本人的Linux系统为federa 11,当以普通用户hhg登录时,

在执行./install ......时,

显示 failed to stat /home/hhg/.gvfs:Pemission denied

当换用root账户登录时,没有在显示以上错误,成功安装。

阅读(1962) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~