嵌入式开发第一天:
1.安装VMWare虚拟机
2.安装Linux操作系统(Redhat,ubuntu,fedora)
硬件(10%)+软件
处理器:ARM
操作系统:嵌入式Linux
编程语言:C/C++(汇编)
3.安装VMware Tools(reboot)
4.配置网络
系统 -> 管理 ->网络 静态IP 取消激活->激活
如果网络一直有问题,重启,重新激活,VM setting Connected 勾去掉,再勾上
service network restart
ifconfig
service iptables stop
setenforce 0
windows ping linux
linux ping windows
5.服务配置 挂载就是把光驱里的内容以文件的形式查看
1)tftp服务器(xinetd子服务)
rpm -qa | grep tftp
chkconfig --list
安装tftp服务器rpm -ivh xx.rpm
chkconfig --list tftp
chkconfig tftp on
service xinetd status|start
cd /tftpboot
echo test > ok.txt
gedit /etc/xinetd.d/tftp &
server_args = -s /tftpboot -c
service xinetd restart
chmod 777 /tftpboot
ls -ld /tftpboot
2)nfs服务器(网络文件系统)
rpm -qa | grep nfs
chkconfig --list nfs
gedit /etc/exports &
/embedded 192.168.1.*(rw,sync,no_root_squash)
service nfs restart
mount -t nfs 192.168.1.200:/embedded mymnt
6.搭建嵌入式开发环境
1)编辑源文件:gedit hello.c &
2)编译源文件:gcc hello.c -> a.out
3)运行 ./a.out(X86 PC 处理器)
嵌入式交叉开发(交叉编译):
1)编辑源文件:gedit hello.c &
2)编译源文件:arm-linux-gcc hello.c -> a.out
3)运行 ./a.out(ARM开发板)
安装arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz(解压加配置)
tar -xzvf arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz
opt是解压出来的目录
/etc/profile 对所有用户都生效
/root/.bashrc 只对root生效
export PATH=$PATH:/embedded/opt/FriendlyARM/toolschain/4.5.1/bin
source /root/.bashrc 重新加载
7.嵌入式Linux系统的启动过程:
1)bootloader(启动加载器) 现在业类使用最广泛的uboot 类似于PC机上的BIOS
2)kernel(操作系统内核) 嵌入式Linux相对Linux做了裁剪
3)rootfs(根文件系统,带GUI) Windows下有NTFS FAT32
8.连接开发板
1)连接电源线
2)连接串口线(若机器没有串口,买一根USB转串口线)
超级终端(windows 通讯下超级终端): Linux有minicom
笔记本com1
台式com2
115200
无
开电源:1或3秒内按下PC回车键进入uboot启动菜单
NAND: 256 MiB(磁盘),
RAM: 128 MiB(内存)
按下f格式