移植uClinux2.6 到IX425DP
早年写的笔记,压箱底了,翻出来晒晒
目 录
实验环境
u IXP425DP(P720板) 266Mhz 64M ram16M flash
u Vmware6.5, 2CPU.
u FC4: kernel 2.6.11-1.1369_FC4smp(FC6也行),安装在虚拟机上
u arm-linux-tools-20051123.tar.gz:gcc 3.4.4编译器
u snapgear-3.5.0.tar.gz: snapgear发布的uClinux包
u snapgear-modules-20071004.sh: snapgear发布的uClinux包
u BSD_ixp400AccessLibrary-2_4.zip: IXP网卡驱动
u IPL_ixp400NpeLibrary-2_4.zip: IXP网卡驱动补丁
u files in /home/linuxuser/snapgear
配置,编译,安装相关文件
文件的配置和安装的方法已经在移植uClinux2.4到IXP425DP清楚的讲述过了,包括以下几个方面
u 解压snapgear-3.5.0.tar.gz
u 安装arm-linux-tools-20051123
u 准备snapgear 补丁文件
u 安装patch snapgear
u 集成IXP 驱动
下面开始将2.6内核的配置,编译。一定要先make clean,保证去掉所有的以前的文件。
内核的配置
首先设置PATH,输入以下命令
#cd /home/linuxuser/snapgear/
#export PATH=$PATH:/home/linuxuser/usr/local/bin
#make menuconfig
1. 选中intel/ix425DP
2. 选中linux-2.6.x / Customize Kernel Settings (NEW) /Customize Module Settings (NEW)
3. 选择boot options
修改consoleoption
这个是原始语句:
console=ttyS0,115200root=/dev/ram0 initrd=0x00800000,8Mmem=64M@0x00000000
修改ttyS0 为 ttyS1, 下面是修改完的语句
console=ttyS1,115200root=/dev/ram0 initrd=0x00800000,8Mmem=64M@0x00000000
另外选中Force default kernel commandstring。
4. 选择Networking ---> Networkingoptions ---> QoS and/or fair queueing.选中一个queue的方法。
5. 所有的选好之后保存退出。之后会出现一个新的菜单
选择XSCALE/IXP400 Modules --->,取消[ ] Names network interfaces as eth, not ixp
选完以后,保存退出。
编译内核
执行如下命令
#make
编译完成之后会在/home/linuxuser/snapgear/images下形成ramdisk和zImage,使用tftp将这个文件load到IX425DP上,
load -r -v -b 0x00800000 ramdisk.gz
load -r -v -b 0x01600000 zImage
exec
成功运行就可以运行看到如下画面
mice: PS/2 mouse device commonfor all mice
TCP cubic registered
NET: Registered protocol family1
NET: Registered protocol family17
RAMDISK: Compressed image foundat block 0
Time: OSTS clocksource has beeninstalled.
VFS: Mounted root (ext2filesystem).
Freeing init memory: 108K
Welcome to
S N A P G E A R L I N U X
For further information check:
http://www.snapgear.org/
启动IXP网卡
在IX425DP的串口终端上依次执行以下命令
#cd /lib/modules/2.6.19-uc1/kernel/ixp425/ixp400-2.4
#insmod ixp400.ko
#cat /etc/IxNpeMicrocode.dat > /dev/ixNpe
#modprobe ixp400_eth
#ifconfig ixp0 up
#ifconfig ixp0 10.0.0.203
#ping 10.0.0.101
实际上的执行会在串口终端显示如下:
# pwd
/lib/modules/2.6.19-uc1/kernel/ixp425/ixp400-2.4
# insmod ixp400.ko
Using ixp400.ko
ixp400: module license 'unspecified' taints kernel.
# lsmod
Module Size Used by
ixp400 652876 0 - Live 0xbf000000 (P)
# cat /etc/IxNpeMicrocode.dat > /dev/ixNpe
# modprobe ixp400_eth
Using /lib/modules/2.6.19-uc1/kernel/ixp425/net-2.4/ixp400_eth.ko
ixp400_eth: Initializing IXP400 NPE Ethernet driver software v. 1.7SG
ixp400_eth: CPU clock speed (approx) = 266 MHz
[error] ixEthMiiPhyScan : unexpected Mii PHY ID 00221619
ixp400_eth: ixp0 is using NPEB and the PHY at address 0
ixp400_eth: ixp1 is using NPEC and the PHY at address 1
ixp400_eth: Use default MAC address 00:02:b3:01:01:01 for port 0
ixp400_eth: Use default MAC address 00:02:b3:02:02:02 for port 1
# ifconfig ixp0 up
ixp400_eth: ixEthMiiLinkStatus failed on PHY0.
Can't determine
the auto negotiated parameters. Using default values.
# ifconfig ixp0 10.0.0.203
# ping 10.0.0.101
PING 10.0.0.101 (10.0.0.101): 56 data bytes
64 bytes from 10.0.0.101: icmp_seq=0 ttl=128time=10.2 ms
64 bytes from 10.0.0.101: icmp_seq=1 ttl=128time=1.3 ms
64 bytes from 10.0.0.101: icmp_seq=2 ttl=128time=1.9 ms
其中10.0.0.203是设定的IXP的IP地址,10.0.0.101是局域网内另外一台机器,可以从此判断网卡的连通情况。
可能出现的错误
错误的ttys
如果在kernel command line中使用ttys0,会出现如下现象,redboot启动完之后就没有任何打印信息
RedBoot(tm)bootstrap and debug environment [ROM]
Red Hatcertified release, version 1.94 - built 10:21:53, Jun 10 2005
Platform:IXDP425 Development Platform (XScale) BE
Copyright (C)2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
RAM:0x00000000-0x04000000, 0x0001f228-0x03fd0000available
FLASH:0x50000000 - 0x51000000, 128 blocks of 0x00020000 bytes each.
== Executingboot script in 1.000 seconds - enter ^C to abort
^C
RedBoot> load-r -v -b 0x00800000 ramdisk26.gz
Using defaultprotocol (TFTP)
|
Raw file loaded0x00800000-0x0092660b, assumed entry at 0x00800000
RedBoot> load-r -v -b 0x01600000 zImage26
Using defaultprotocol (TFTP)
-
Raw file loaded0x01600000-0x0173021b, assumed entry at 0x01600000
RedBoot> exec
Using baseaddress 0x01600000 and length 0x0013021c
串口打印乱码:
Bootloader阶段串口能够正常打印,到了kernel 开始打印乱码。这个是因为串口速率不对,需要正确选择boot option,并且选中Force default kernel command string