三、在内核中增加对网卡DM9000的配置
在内核目录下执行“make menuconfig”命令进行如下的配置:
Device Drivers--->
[*]Network device support--->
[*]Ethernet(10 or 100Mbit)--->
<*>DM9000 support
[*]Networking support--->
Networking options--->
<*>TCP/IP networking
<*>IP:kernel leel autoconfiguration
//增加对nfs的支持
File systems--->
[*]Networking File Systems--->
<*>NFS client support
[*]NFS client support for NFS version 3
[*]NFS client support for the NFSv3 ACL protocol extension
[*]Boot file system on NFS
[*]NFS server support
四、修改根文件系统启动脚本rcS
在根文件etc/init.d/rcS文件中添加如下:
echo "network interface"
/sbin/ifconfig lo 127.0.0.1
/sbin/ifconfig eth0 192.168.1.230 up
route add default gw 192.168.1.1
五、测试和修改
至此,将修改过的内核和根文件系统下载到mini2440开发板,启动时出现如下信息:
----------munt all----------------
network interface
dm9000 dm9000.0: WARNING: no IRQ resource flags set.
eth0: link up, 10Mbps, half-duplex, lpa 0x0021
***********************************************
****************Studying ARM*********************
Kernel version:linux-2.6.29.1
Student:Feng dong rui
Date:2009.07.15
***********************************************
Please press Enter to activate this console.
[MrFeng]#
1、测试
Please press Enter to activate this console.
[MrFeng]#ifconfig -a
eth0 Link encap:Ethernet HWaddr 10:23:45:67:89:AB
inet addr:192.168.1.230 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1506 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:101460 (99.0 KiB) TX bytes:0 (0.0 B)
Interrupt:51 Base address:0x8000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:6 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:504 (504.0 B) TX bytes:504 (504.0 B)
[MrFeng]#ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: seq="0" ttl="64" time="1".004 ms
64 bytes from 127.0.0.1: seq="1" ttl="64" time="0".518 ms
64 bytes from 127.0.0.1: seq="2" ttl="64" time="0".436 ms
^C
--- 127.0.0.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.436/0.652/1.004 ms
[MrFeng]#ping 192.168.1.103
PING 192.168.1.103 (192.168.1.103): 56 data bytes
64 bytes from 192.168.1.103: seq="0" ttl="64" time="2".098 ms
64 bytes from 192.168.1.103: seq="1" ttl="64" time="1".342 ms
64 bytes from 192.168.1.103: seq="2" ttl="64" time="0".823 ms
^C
--- 192.168.1.103 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.823/1.421/2.098 ms
//挂载网络文件系统
[MrFeng]#mount -t nfs -o nolock 192.168.1.103:/opt/nfs /mnt
[MrFeng]#ls /mnt
pic.jpg
[MrFeng]#umount /mnt
[MrFeng]#ls /mnt
[MrFeng]#
注:在挂载网络文件系统时先要在Linux系统下设置共享目录才能在从开发板挂载该目录,这里已经在虚拟机下RedHat9.0系统中的/opt下设置了共享目录nfs,虚拟机的ip为192.168.1.103,故通过mount -t nfs -o nolock 192.168.1.103:/opt/nfs /mnt命令挂载。
S3C2440嵌入式Linux下网卡DM9000E移植(2)
内容版权声明:除非注明,否则皆为本站原创文章。