|
我现在把遇到问题整理出来,希望得到指点:
skyeye模拟开发板上网卡的思想是在主机上模拟一个网卡10.0.0.1
在模拟的开发板上模拟一个网卡10.0.0.2
然后是10.0.0.2与10.0.0.1之间进行模拟的数据交换。
现在遇到的问题具体如下:
1:进入skyeye环境后提示:
Command: /bin/ifconfig eth0 up 10.0.0.2
SIOCGIFFLAGS: No such device
SIOCSIFADDR: No such device
pid 12: failed 512
说明模拟的开发板上的网卡有问题。
2:在skyeye环境下ping不通主机的IP地址10.0.0.1
3:在skyeye环境下ping不通模拟开发板上的模拟网卡的IP地址10.0.0.2
4:在主机环境下可以ping通与模拟的开发板通讯的主机的网卡IP地址10.0.0.1
我买了陈渝所编《源码开放的嵌入式系统软件分析与实践--基于SkyEye和ARM开发平台》的书及光盘
假设已经把光盘里的内容copy到/opt/skyeye-cdrom/目录下
因为光盘里没有uClinux-dist-20030522-tar.gz文件,我是从
http://www.uclinux.org/pub/uclinux/d...gz下载的。
copy文件uClinux-dist-20030522-tar.gz到/opt/skyeye-cdrom/uClinux/目录下.
第0步:#cd /opt/skyeye-cdrom/SkyEye/testsuit/
#tar jxfv skyeye-binary-testutils-1.0.7.1.tar.bz2
第一步:建立交叉编译环境
(1)为编译uclinux建立交叉编译环境
#cd /opt/skyeye-cdrom/DevelopTools/uClinux_gnutools/arm/
#sh arm-elf-tools-20030314.sh
#ls /usr/local/bin/arm-elf-* (可以看到arm-elf-gcc等编译工具已经安装到您的机器上)
(2)为编译armlinux建立交叉编译环境
1)安装3.3.2版本
#cd /opt/skyeye-cdrom/DevelopTools/ARMlinux_gnutools/arm/
#cp arm-linux-gcc-3.3.2.tar.bz2 /
#cd /
#tar jxfv arm-linux-gcc-3.3.2.tar.bz2
#ls /usr/local/arm/3.3.2/bin/arm-linux-* (可以看到3.3.2版本的arm-linux-gcc等编译工具已经到您的机器上)
1)安装2.95.3版本
#cd /opt/skyeye-cdrom/DevelopTools/ARMlinux_gnutools/arm/
#cp cross-2.95.3.tar.bz2 /usr/local/arm/
#cd /usr/local/arm/
#tar jxfv cross-2.95.3.tar.bz2
#ls /usr/local/arm/2.95.3/bin/arm-linux-* (可以看到2.95.3版本的arm-linux-gcc等编译工具已经到您的机器上)
第二步:编译安装skyeye
#cd /opt/skyeye-cdrom/SkyEye/skyeye/
#tar jxfv skyeye-0.8.0.tar.bz2
#cd skyeye
#./configure --target=arm-elf --prefix=/usr/local
#make
#make install
#skyeye(现在就可以在任何路径下运行skyeye了,键入quit退出skyeye)
第三步:编译带有网络支持的嵌入式操作系统--uclinux
#cd /opt/skyeye-cdrom/uClinux
#tar zxf uClinux-dist-20030522.tar.gz
#cp /opt/skyeye-cdrom/SkyEye/uclinux4skyeye/uclinux4skyeye-v0.2.3.tgz .
#tar zxf uclinux4skyeye-v0.2.3.tgz
#cd uclinux4skyeye
#cp example/uclinux-dist-20030522/vendors__GDB__ARMulator/* ../uClinux-dist/vendors/GDB/ARMulator/
#cd /opt/skyeye-cdrom/uClinux/uClinux-dist
#mkdir drivers
#cd drivers
#mkdir net
#cd /opt/skyeye-cdrom/uClinux/uclinux4skyeye
#cp example/uclinux-dist-20030522/linux-2.4.x__drivers__net/* ../uClinux-dist/drivers/net/
#cd ..
#cd uClinux-dist
#make menuconfig(若是在X window上,终端窗口的尺寸必须大于19行80列,否则Menuconfig无法正常运行)
Target Platform Selection --->
--- Choose a Vendor/Product combination.
(GDB/ARMulator) Vendor/Product
(linux-2.4.x) Kernel Version
(uClibc) Libc Version
[ ] Default all settings (lose changes)
[ ] Customize Kernel Settings (NEW)
[ ] Customize Vendor/User Settings (NEW)
[ ] Update Default Vendor Settings (NEW)
#make dep
#make
#ls linux-2.4.x/linux
#cd ..
#ln -s uClinux-dist/linux-2.4.x/linux linux
#cp /opt/skyeye-cdrom/SkyEye/testsuit/skyeye-binary-testutils-1.0.7/at91/uclinux3/boot.rom .
#cp /opt/skyeye-cdrom/SkyEye/testsuit/skyeye-binary-testutils-1.0.7/at91/uclinux3/skyeye.conf .
#skyeye linux
(SkyEye)target sim
(SkyEye)load
(SkyEye)run
(uCLinux内核开始启动... ...)
Starting program: /opt/skyeye-cdrom/uClinux/linux
Linux version 2.4.20-uc0 (root@wen) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #1 二 5月 8 10:34:21 CST 2007
Processor: Atmel AT91M40xxx revision 0
Architecture: EB01
On node 0 totalpages: 1024
zone(0): 0 pages.
zone(1): 1024 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/rom0
Calibrating delay loop... 12.97 BogoMIPS
Memory: 4MB = 4MB total
Memory: 3020KB available (801K code, 176K data, 40K init)
Dentry cache hash table entries: 512 (order: 0, 4096 bytes)
Inode cache hash table entries: 512 (order: 0, 4096 bytes)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 1024 (order: 0, 4096 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Atmel USART driver version 0.99
ttyS0 at 0xfffd0000 (irq = 2) is a builtin Atmel APB USART
ttyS1 at 0xfffcc000 (irq = 3) is a builtin Atmel APB USART
Blkmem copyright 1998,1999 D. Jeff Dionne
Blkmem copyright 1998 Kenneth Albanowski
Blkmem 1 disk images:
0: 1400000-14DDFFF [VIRTUAL 1400000-14DDFFF] (RO)
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 512 bind 512)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
VFS: Mounted root (romfs filesystem) readonly.
Shell invoked to run file: /etc/rc
Command: hostname GDB-ARMulator
Command: /bin/expand /etc/ramfs.img /dev/ram0
Command: mount -t proc proc /proc
mount: /etc/mtab: Read-only file system
Command: mount -t ext2 /dev/ram0 /var
mount: /etc/mtab: Read-only file system
Command: mkdir /var/tmp
Command: mkdir /var/log
Command: mkdir /var/run
Command: mkdir /var/lock
Command: cat /etc/motd
Welcome to
____ _ _
/ __| ||_|
_ _| | | | _ ____ _ _ _ _
| | | | | | || | _ \| | | |\ \/ /
| |_| | |__| || | | | | |_| |/ \
| ___\____|_||_|_| |_|\____|\_/\_/
| |
|_|
GDB/ARMulator support by <[email protected]>
For further information check:
http://www.uclinux.org/
Command: /bin/ifconfig eth0 up 10.0.0.2
SIOCGIFFLAGS: No such device
SIOCSIFADDR: No such device
pid 12: failed 512
Execution Finished, Exiting
init: Booting to single user mode
Sash command shell (version 1.1.1)
/> cd bin
/bin> ifconfig
/bin> ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1): 56 data bytes
ping: sendto: Network is unreachable
ping: wrote 10.0.0.1 64 chars, ret=-1
ping: sendto: Network is unreachable
ping: wrote 10.0.0.1 64 chars, ret=-1
在主机上再开一个终端
Red Hat Linux release 9 (Shrike)
Kernel 2.4.20-8 on an i686
login: root
Password:
Last login: Tue May 8 09:05:36 from 192.168.1.117
You have new mail.
[root@wen root]# cd /
[root@wen /]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:14:78:44:F5:1B
inet addr:192.168.1.222 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2795400 errors:6528 dropped:6976 overruns:6528 frame:0
TX packets:2826551 errors:0 dropped:0 overruns:3 carrier:0
collisions:0 txqueuelen:100
RX bytes:1315374988 (1254.4 Mb) TX bytes:1512935833 (1442.8 Mb)
Interrupt:10 Base address:0xe800
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:8577754 errors:0 dropped:0 overruns:0 frame:0
TX packets:8577754 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:586542348 (559.3 Mb) TX bytes:586542348 (559.3 Mb)
tap0 Link encap:Ethernet HWaddr 00:FF:04:3E:1B:27
inet addr:10.0.0.1 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
[root@wen /]# ping 10.0.0.1 -c 4
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=0.042 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=0.026 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=0.029 ms
64 bytes from 10.0.0.1: icmp_seq=4 ttl=64 time=0.017 ms
--- 10.0.0.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3087ms
rtt min/avg/max/mdev = 0.017/0.028/0.042/0.010 ms
[root@wen /]# ping 10.0.0.2 -c 4
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
From 10.0.0.1 icmp_seq=4 Destination Host Unreachable
--- 10.0.0.2 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3023ms
, pipe 3
[root@wen /]# |
|