返回信息流问题描述如下:移植的2.6.13的内核,使用的是nfs文件系统,CPU为ppc405ep,网卡型号是IBM 4XX EMAC。板子上有两个网卡分别为ema0和emac1,但只用emac0,emac1未使用(未接phy芯片)但是在启动时会出现两种情况(1)eth0 is up (2) eth1 is up只有出先第一种情况时内核启动正常并且能成功加载文件系统,但是出现(2)的情况的时候就无法加载文件系统了,而且启动eth0或者eth1看似是随机的。
请问:如何才能让系统只从eth0启动?
这是一条镜像帖。来源:北邮人论坛 / embedded-system / #2315同步于 2008/11/6
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Embedded_System机器人发帖
内核移植出现问题,求助!
zhaobo1023
2008/11/6镜像同步11 回复
订阅后,新回复会通过你的通知中心匿名送达。
9 条回复
再贴下出现这两种情况的打印信息
=> bootm 200000
## Booting image at 00200000 ...
Image Name: Linux-2.6.13
Created: 2008-11-04 19:25:50 UTC
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 940032 Bytes = 918 kB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
## cmdline at 0x007FFC00 ... 0x007FFC77
console=ttyS0,9600 root=/dev/nfs rw nfsroot=59.64.136.114:/rams ip=59.64.136.122:59.64.136.114::255.255.254.0::eth0:off
kbd->bi_intfreq= 0xFE502A8
kbd->bi_baudrate= 0x2580
Linux version 2.6.13 (root@localhost.localdomain) (gcc version 4.0.0 (DENX ELDK 4.1 4.0.0)) #73 Wed Nov 5 03:25:40 CST 2008
IBM Bubinga port (MontaVista Software, Inc. <source@mvista.com>)
Built 1 zonelists
Kernel command line: console=ttyS0,9600 root=/dev/nfs rw nfsroot=59.64.136.114:/rams ip=59.64.136.122:59.64.136.114::255.255.254.0::eth0:off
PID hash table entries: 1024 (order: 10, 16384 bytes)
Console: colour dummy device 80x25
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 127744k available (1452k kernel code, 452k data, 112k init, 0k highmem)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
PCI: Probing PCI hardware
Serial: 8250/16550 driver $Revision: 1.90 $ 32 ports, IRQ sharing disabled
ttyS0 at MMIO 0x0 (irq = 0) is a 16550A
ttyS1 at MMIO 0x0 (irq = 1) is a 16550A
io scheduler noop registered
RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
mal0: Initialized, 4 tx channels, 2 rx channels
emac: IBM EMAC Ethernet driver, version 2.0
Maintained by Benjamin Herrenschmidt <benh@kernel.crashing.org>
eth0: IBM emac, MAC 00:18:8b:12:cc:d0
eth0: Found Generic MII PHY (0x01)
eth1: IBM emac, MAC 00:00:00:00:00:00
eth1: Found Generic MII PHY (0x08)
mice: PS/2 mouse device common for all mice
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
eth0: Link is Up
eth0: Speed: 100, Full duplex.
IP-Config: Complete:
device=eth0, addr=59.64.136.122, mask=255.255.254.0, gw=255.255.255.255,
host=59.64.136.122, domain=, nis-domain=(none),
bootserver=59.64.136.114, rootserver=59.64.136.114, rootpath=
Looking up port of RPC 100003/2 on 59.64.136.114
Looking up port of RPC 100005/1 on 59.64.136.114
VFS: Mounted root (nfs filesystem).
Freeing unused kernel memory: 112k init
init started: BusyBox v1.5.1 (2008-11-04 16:03:23 CST) multi-call binary
starting pid 15, tty '': '/etc/init.d/rcS'
starting pid 17, tty '': '/bin/sh'
BusyBox v1.5.1 (2008-11-04 16:03:23 CST) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
Processing /etc/profile... Done
# eth0: Link is Down
eth0: Link is Up
eth0: Speed: 10, Half duplex.
eth0: Link is Down
eth0: Link is Up
eth0: Speed: 100, Full duplex.
# ls
bin etc linuxrc proc usr
dev lib mnt sbin
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:18:8B:12:CC:D0
inet addr:59.64.136.122 Bcast:59.64.137.255 Mask:255.255.254.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:18092 errors:0 dropped:0 overruns:0 frame:0
TX packets:577 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2353617 (2.2 MiB) TX bytes:57718 (56.3 KiB)
Interrupt:15
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:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:18:8B:12:CC:D0
inet addr:59.64.136.122 Bcast:59.64.137.255 Mask:255.255.254.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:18549 errors:0 dropped:0 overruns:0 frame:0
TX packets:584 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2396642 (2.2 MiB) TX bytes:58940 (57.5 KiB)
Interrupt:15
eth1 Link encap:Ethernet HWaddr 00:00:00:00:00:00
BROADCAST 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:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:17
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:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
#
=> bootm 200000
## Booting image at 00200000 ...
Image Name: Linux-2.6.13
Created: 2008-11-04 19:25:50 UTC
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 940032 Bytes = 918 kB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
## cmdline at 0x007FFC00 ... 0x007FFC77
console=ttyS0,9600 root=/dev/nfs rw nfsroot=59.64.136.114:/rams ip=59.64.136.122:59.64.136.114::255.255.254.0::eth0:off
kbd->bi_intfreq= 0xFE502A8
kbd->bi_baudrate= 0x2580
Linux version 2.6.13 (root@localhost.localdomain) (gcc version 4.0.0 (DENX ELDK 4.1 4.0.0)) #73 Wed Nov 5 03:25:40 CST 2008
IBM Bubinga port (MontaVista Software, Inc. <source@mvista.com>)
Built 1 zonelists
Kernel command line: console=ttyS0,9600 root=/dev/nfs rw nfsroot=59.64.136.114:/rams ip=59.64.136.122:59.64.136.114::255.255.254.0::eth0:off
PID hash table entries: 1024 (order: 10, 16384 bytes)
Console: colour dummy device 80x25
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 127744k available (1452k kernel code, 452k data, 112k init, 0k highmem)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
PCI: Probing PCI hardware
Serial: 8250/16550 driver $Revision: 1.90 $ 32 ports, IRQ sharing disabled
ttyS0 at MMIO 0x0 (irq = 0) is a 16550A
ttyS1 at MMIO 0x0 (irq = 1) is a 16550A
io scheduler noop registered
RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
mal0: Initialized, 4 tx channels, 2 rx channels
emac: IBM EMAC Ethernet driver, version 2.0
Maintained by Benjamin Herrenschmidt <benh@kernel.crashing.org>
eth0: IBM emac, MAC 00:18:8b:12:cc:d0
eth0: Found Generic MII PHY (0x08)
eth1: IBM emac, MAC 00:00:00:00:00:00
eth1: Found Generic MII PHY (0x06)
mice: PS/2 mouse device common for all mice
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
eth1: Link is Up
eth1: Cannot reset EMAC
IP-Config: Complete:
device=eth0, addr=59.64.136.122, mask=255.255.254.0, gw=255.255.255.255,
host=59.64.136.122, domain=, nis-domain=(none),
bootserver=59.64.136.114, rootserver=59.64.136.114, rootpath=
Looking up port of RPC 100003/2 on 59.64.136.114
eth1: Link is Down
eth1: Link is Up
eth1: Cannot reset EMAC
portmap: server 59.64.136.114 not responding, timed out
Root-NFS: Unable to get nfsd port number from server, using default
Looking up port of RPC 100005/1 on 59.64.136.114
portmap: server 59.64.136.114 not responding, timed out
Root-NFS: Unable to get mountd port number from server, using default
【 在 ccliu 的大作中提到: 】
: NFS服务设置正确了吗?可以在PC上测试一下!
应该没问题,测过了
貌似还是板子那边的问题,emac识别要是不正常的话大概就连不上了
nfs应该没问题啊,好像是网卡初始化和启动网卡设备出现的问题(网卡驱动是直接编译进内核的)
网上看到说:“如果驱动程序已经在内核中了,那么多网卡的设置已经有了。但是,
缺省的情况是自动检测一块网卡,这样可以防止在启动时不正常的挂起”
但是看启动信息只有两个网卡都检测到了,并且正确选择了从eth0启动才能正常加载文件系统,而打印出按道理上说应该正确的“EMAC1 can't find phy”的时候就根本启动不了网卡设备
把之前出现的问题也说下,之前内核移植出了好多问题,最后都归结到应该是U-BOOT在给内核传参数的时候出了错,因此往内核代码中将有些参数写成固定值了,写死的地方有(串口的波特率,以太网的MAC地址,内存的大小)现在在想是否因为之前的问题导致内核出现了什么异常,总之太诡异了,郁闷了