- 论坛徽章:
- 0
|
准备工作:EUxLinux联盟
一台装有REDHAT9.0的PC机,一套LJD2410-I开发板,PC机上装有LJD2410的软件包,假如我EUxLinux联盟
们通过NFS要加载的文件系统为/LJD2410/root_dir/root_china,EUxLinux联盟
Ifconfig eth0 192.168.1.100 //设置PC机linux的IP:192.168.1.100,EUxLinux联盟
Ifconfig eth0 192.168.1.10 //开发板IP:192.168.1.10EUxLinux联盟
EUxLinux联盟
我们需要重新配置编译内核,开启开发板NFS文件系统功能,具体步骤如下:EUxLinux联盟
1、 修改kernel/arch/arm/def-configs/smdk2410配置文件EUxLinux联盟
把CONFIG_CMDLINE="root=/dev/mtdblock2 noinitrd init=/linuxrc EUxLinux联盟
console=ttyS0"这一行改为CONFIG_CMDLINE="root=/dev/nfs rw EUxLinux联盟
nfsroot=192.168.1.100:/LJD2410/root_dir/root_china noinitrd EUxLinux联盟
init=linuxrc console=ttys0 ip=192.168.1.10"EUxLinux联盟
运行make menuconfig进入配置菜单,装载配置文件SMDK2410EUxLinux联盟
选择Load an Alternate Configuration File输入配置文件的路径和文件名EUxLinux联盟
添加内核对NFS的支持:EUxLinux联盟
选中networking options-》IP:kernel level auloconfiguralion项EUxLinux联盟
选中file systems-》network file systems-》下的root file system on nfsEUxLinux联盟
和nfs file system supportEUxLinux联盟
重新编译内核下载bootloader和kernel到开发板上,至此,开发板设置已经完成。EUxLinux联盟
PC机设置:我们必须开启PC机的NFS服务,具体设置如下:1、 在LINUX命令EUxLinux联盟
符下运行setup,在system services里面选中nfs服务,然后保存退出。EUxLinux联盟
EUxLinux联盟
2、 设置PC机上的共享目录执行vi /etc/exports,在里面添加一EUxLinux联盟
行:/LJD2410/root_dir/root_china (rw),然后保存退出,/和rw要有空格EUxLinux联盟
(/LJD2410/root_dir/root_china为共享目录,rw为读写权限)。EUxLinux联盟
3、 执行/etc/rc.d/init.d/nfs restart重启nfs服务。EUxLinux联盟
4、为了不必每次开机都要启动nfs服务,我们把/etc/rc.d/init.d/nfs restart EUxLinux联盟
添加到/etc/rc.d/rc.local中,以后PC启动的时候就会执行此文件开启nfs服务。EUxLinux联盟
5、 测试NFS服务:设置完成后可以在本机上进行测试,如果本机IP为192.168.1.100,EUxLinux联盟
则可以用EUxLinux联盟
mount 192.168.1.100:/LJD2410/root_dir/root_china /mnt,如果mount成功,则在/mntEUxLinux联盟
的目录就可以看到root_china下面的东西了。EUxLinux联盟
6、 修改root_china/usr/etc/rc.local文件,设置开发板IP地址为192.168.1.10EUxLinux联盟
至此,开发板和PC机的设置都已经基本完成,假如我们在PC机上调试好的应用程序已EUxLinux联盟
经放到/root_china这个嵌入式的文件系统下面,我们则可以用网络连接好开发板和PC机,EUxLinux联盟
开发板上电,系统开始运行并且通过运行nfs网络文件系统就可以进入熟悉的linux界面EUxLinux联盟
了。EUxLinux联盟
以后调试程序只需要把编译好的程序放到root_china的目录下面就可以了,开发板不EUxLinux联盟
再需要烧写。 EUxLinux联盟
EUxLinux联盟
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1573231
原文地址
http://blog.csdn.net/zht_sir/archive/2007/04/20/1573231.aspx
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/54976/showart_431097.html |
|