(3)通过串口传送文件到开发板通过前面的章节我们学会了如何通过串口传送文件到开发板,你也可以通过相同的方法传送hello可执行程序,具体步骤在此不再详细描述,记得传送完毕把文件的属性改为可执行才能正常运行。#chmod +x hello 说明:有些用户使用USB转串口线,因为有些转接器性能是不太好的,所以有时会出现“传输超时”或者根本无法传输到开发板的现象,因此我们建议使用ftp传送到开发板。(4)通过网络文件系统NFS执行Linux中最常用的方法就是采用NFS来执行各种程序,这样可以不必花费很多时间下载程序,虽然在此下载hello程序用不了多久,一旦您的应用程序变得越来越大,您就会发现使用NFS运行的方便所在。如同前面所讲述的那样,请先按照1.3.4一节搭建好NFS服务器系统,然后在命令行输入以下命令(假定服务器的IP地址为192.168.1.111): #mount –t nfs –o nolock 192.168.1.111:/opt/FriendlyARM/mini6410/linux/rootfs_qtopia_qt4 /mnt 挂接成功,您就可以进入/mnt目录进行操作了,在您的PC Linux终端把hello复制到opt/FriendlyARM/mini6410/linux/rootfs_qtopia_qt4目录,然后在开发板的串口终端执行#cd /mnt #./hello
[root@tom exer_mine]# export PATH=/opt/FriendlyARM/toolschain/4.5.1/bin/:$PATH
[root@tom exer_mine]# vi hello.c
[root@tom exer_mine]# arm-linux-gcc -o hello hello.c
[root@tom exer_mine]# ./hello
-bash: ./hello: cannot execute binary file
[root@tom exer_mine]# chmod +x hello
[root@tom exer_mine]# ./hello
-bash: ./hello: cannot execute binary file
[root@tom exer_mine]# pwd
/opt/exer_mine