CentOS 5.5 搭建 mini2440 开发环境
1. VMware-workstation-full-7.1.5
CentOS 5.5 512M内存
2. CentOS 5.5 yum软件源设置
2.1、备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2.2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
2.3、之后运行yum makecache生成缓存
yum makecache
2.4、FAQ
执行yum命令的时候可能有lock提示,那是因为有个yum更新的守护进程一直在跑着,使用ps -ef | grep yum查出来,然后kill -9 PID
把它杀掉,禁止yum更新开机自运行的命令为chkconfig yum-updatesd off。
2.5、参照
http://mirrors.aliyun.com/help/centos
3. 安装FriendlyARM光盘自带arm-linux-gcc-4.4.3.tar.gz
3.1、加压缩包
tar xvf ~/Desktop/arm-linux-gcc-4.4.3.tar.gz -C /
3.2、设置环境变量
vi ~/.bash_profile
PATH=$PATH:/sbin
PATH=$PATH:/opt/FriendlyARM/toolschain/4.4.3/bin/
source ~/.bash_profile
4. 建立开发专用目录测试环境
mkdir /development
vi led_on.S
@****************************** @ File: led_on.S @ Func: light on LED1 on mini2440 @****************************** .text .global _start _start: LDR R0, =0x56000010 MOV R1, #0x00000400 STR R1, [R0] LDR R0, =0x56000014 MOV R1, #0x00000000 STR R1, [R0] MAIN_LOOP: B MAIN_LOOP
vi Makefile
led_on.bin: led_on.S arm-linux-gcc -g -c -o led_on.o led_on.S arm-linux-ld -Ttext 0x30000000 -g led_on.o -o led_on.elf arm-linux-objcopy -O binary -S led_on.elf led_on.bin clean: rm -r led_on.bin led_on.elf led_on.o
执行make命令,报错如下
arm-linux-gcc -g -c -o led_on.o led_on.S /opt/FriendlyARM/toolschain/4.4.3/libexec/gcc/arm-none-linux-gnueabi/4.4.3/cc1: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /opt/FriendlyARM/toolschain/4.4.3/lib/libppl_c.so.2) /opt/FriendlyARM/toolschain/4.4.3/libexec/gcc/arm-none-linux-gnueabi/4.4.3/cc1: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /opt/FriendlyARM/toolschain/4.4.3/lib/libppl.so.7)
很遗憾经过使用命令yum update libstdc++,然后使用命令strings /usr/lib/libstdc++.so.6 | grep GLIBC查看到的最高版本信息是GLIBCXX_3.4.8,还差一点。从网络上找到解决方法,下载libstdc++.so.6.0.10,然后把它拷贝到/usr/lib/下,创建一个软连接ln -s /usr/lib/libstdc++.so.6.0.10 /usr/lib/libstdc++.so.6然后再执行命令make即可,创建新链接之前最好做个备份mv /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so.6.backup。
参照http://blog.csdn.net/jinlking/article/details/4476536中的led_on.S代码做测试
5. samba安装和配置,方便centos 5.5和win7之间数据传输
yum install samba samba-client
vi /etc/samba/smb.conf #使用最简单的配置
workgroup = WORKGROUP server string = Harvis Samba Server Version %v netbios name = HARVISSAMBA log file = /var/log/samba/%m.log security = share ; passdb backend = tdbsam ;[homes] ; comment = Home Directories ; browseable = no ; writable = yes ; valid users = %S ; valid users = MYDOMAIN\%S [public] comment = Public Stuff path = /development public = yes writable = yes
browseable = yes
chcon -t samba_share_t /development
testparm
service smb restart
参考:http://www.cnblogs.com/mchina/archive/2012/12/18/2816717.html
http://renxifeng.is-programmer.com/posts/39213.html
6. 编译u-boot
tar xvf ~/Desktop/bootloader.tgz rm -f ~/Desktop/bootloader.tgz make distclean make mini2440_config make
QQ群:113 148 289