Author: Xiaoyong Wen, [email protected]
Data: 2012-6-16
Index |
Version |
Author |
Date |
Comment |
1 |
V1.0.0 |
Xiaoyong Wen |
2012-6-16 |
Draft |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
S3C6410移植linuxkernel 2.6.36步骤... 1
Version history. 1
目录... 2
1. 获取linux kernel 2.6.36. 3
2. 修改machineID.. 3
3. 复制linuxkernel配置文件.config. 4
4. 配置CPUtype. 4
5. 配置nfs引导rootfs. 4
5.1 先配置TCP/IP网络支持... 4
5.2 配置DM9000NIC driver5
5.3 配置nfsclient5
5.4 配置可抢占功能... 5
5.5 U-boot命令行配置... 5
6. 配置rootfs. 6
7. 未解决的问题... 7
URL:http://www.kernel.org/pub/linux/kernel/v2.6/
解压:
#tar jxvf linux-2.6.36.tar.bz2
如果machine ID不正确,U-boot的错误提示:
Now, Downloading[ADDRESS:0xc0008000,TOTAL:0x18e7ec]
Please waiting ........................Download Done!!
Download Address: 0xc0008000, DownloadFilesize:0x18e7ec
Checksum is being calculated..
Checksum O.K.
Boot with zImage
Starting kernel ...
Uncompressing Linux... done, booting thekernel.
Error: unrecognized/unsupported machine ID(r1 = 0x00000378).
Available machine support:
ID (hex) NAME
00000887 A&W6410
000004f6 SMDK6400
000022b1 SMDK6410
0000078d NCP
000008ce Airgoo-HMT
000009e6 SmartQ 5
000009af SmartQ 7
Please check your kernel config and/orbootloader.
由于TQ6410传入的ID是0x00000378,即888。
修改kernel 源代码目录树中的arch/arm/tools/mach-types文件:
注释掉smdk6410行
#smdk6410 MACH_SMDK6410 SMDK6410 1626
增加一行:
smdk6410 MACH_SMDK6410 SMDK6410 888
编译新内核:
# make zImage –j 2
进入linux kenel 2.6.36源代码目录树,复制s3c6410预定义文件
# cp arch/arm/configs/s3c6400_defconfig .config
配置内核:
#make menuconfig
然后保存退出,编译:
#make all –j 2
应当可以编译完成。
System Type --->
ARM system type --->
(X) Samsung S3C64XX
由于没有移植MTD驱动,所以直接用nfs来引导rootfs
[*] Networking support --->
Networking options --->
<*> Packet socket
[*] TCP/IP networking
[*] IP: multicasting
[*] IP: kernel level autoconfiguration
[*] IP: DHCP support
[*] IP: BOOTP support
[*] IP: RARP support
Device Drivers --->
[*] Network device support --->
[*] Ethernet (10 or 100Mbit) --->
再修改网卡平台驱动的资源,源代码省略。
File systems --->
[*] Network File Systems --->
<*> NFS client support
[*] NFS client support for NFS version 3
[*] Root file system on NFS
然后保存到.config文件,再make zImage –j 2编译。
Kernel Features --->
Preemption Model (Preemptible Kernel(Low-Latency Desktop) --->
(X) Preemptible Kernel (Low-LatencyDesktop)
#setenv bootargs 'root=/dev/nfs rw nfsroot=10.0.0.160:/home/wenxy/src/s3c6410/rootfs/opt/EmbedSky/root_nfsip=10.0.0.161:10.0.0.1::255.255.255.0 console=ttySAC0,115200 mem=128M'
#saveenv; bootm
即可启动成功。
Tips: 如果有kernelpanic消息,内核配置中去掉不必要的模块,以最小的内核配置启却,可以方便定位错误和消除错误。
修改TQ6410自带的rootfs中的inittab文件:
# /etc/inittab
::sysinit:/etc/init.d/rcS
#tq6410_serial0::askfirst:-/bin/sh
::askfirst:-/bin/sh
::once:/usr/sbin/telnetd -l /bin/login
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
把#tq6410_serial0::askfirst:-/bin/sh
改成
::askfirst:-/bin/sh
即可启动,并且有哪下日志:
…
VFP support v0.3: implementor 41architecture 1 part 20 variant b rev 5
s3c-rtcs3c64xx-rtc: setting systemclock to 2000-06-12 03:03:19 UTC (960778999)
s3c6400_setup_sdhci_cfg_card:CTRL 2=c0004120, 3=80808080
eth0: link down
dm9000 dm9000.0: eth0: link up, 100Mbps,full-duplex, no LPA
IP-Config: Complete:
device=eth0, addr=10.0.0.161,mask=255.255.255.0, gw=255.255.255.255,
host=10.0.0.161, domain=,nis-domain=(none),
bootserver=10.0.0.1,rootserver=10.0.0.160, rootpath=
Looking up port of RPC100003/2 on 10.0.0.160
Looking up port of RPC100005/1 on 10.0.0.160
VFS: Mounted root (nfs filesystem) ondevice 0:11.
Freeing init memory: 120K
/dev/watchdog: No such file or directory
[12/Jun/2000:03:03:24 +0000]
Please press Enter to activate thisconsole. boa: server version Boa/0.94.13
[12/Jun/2000:03:03:24 +0000] boa: serverbuilt Jul 29 2009 at 14:27:34.
[12/Jun/2000:03:03:24 +0000] boa: startingserver pid=943, port 80
[root@EmbedSky /]# uname -a
Linux EmbedSky 2.6.36-svn12#40 PREEMPT Sat Jun 16 17:01:41 CST 2012 armv6l GNU/Linux
(1). 有时候会有Ooopsmessage,Oops错误码为17等等。
(2). 偶尔会有kernelpannic情况。
由于
* error_code :
* bit 0== 0 means no page found, 1 means protection fault
* bit 1== 0 means read, 1 means write
* bit 2== 0 means kernel, 1 means user-mode
* bit 3== 0 means data, 1 means instruction
所以解决思路:
尝试重作rootfs:通过busybox做。
或者修改kernel源代码,跟踪调试。