一、参考资料
二、实验环境
board :FL2440
bootloader:u-boot-1.1.6
kernel :linux-2.6.22.6
rootfs :busybox-1.9.1 + tinylogin
交叉编译工具:gcc version 4.3.2 (crosstool-NG-1.9.3-hyh)
三、hang 前的输出
- Starting kernel ...
- Uncompressing Linux..................................................................................................... done, booting the kernel.
- Linux version 2.6.22.6-gd3c0d8aa-dirty (chenbing@chenbing-laptop) (gcc version 4.3.2 (crosstool-NG-1.9.3-hyh) ) #7 Tue Jun 19 23:51:27 CST 2012
- CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
- Machine: SMDK2440
- Memory policy: ECC disabled, Data cache writeback
- CPU S3C2440A (id 0x32440001)
- S3C244X: core 400.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz
- S3C24XX Clocks, (c) 2004 Simtec Electronics
- CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
- CPU0: D VIVT write-back cache
- CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
- CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
- Built 1 zonelists. Total pages: 16256
- Kernel command line: console=ttySAC0,115200 root=nfs rw nfsroot=192.168.1.6:/home/chenbing/control-project/fl2440/rootfs ip=192.168.1.7:192.168.1.6:255.255.255.0::eth0 init=/linuxrc
- irq: clearing pending ext status 00080800
- irq: clearing subpending status 00000003
- irq: clearing subpending status 00000002
- PID hash table entries: 256 (order: 8, 1024 bytes)
- timer tcon=00500000, tcnt a2c1, tcfg 00000200,00000000, usec 00001eb8
- Console: colour dummy device 80x30
- Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
- Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
- Memory: 64MB = 64MB total
- Memory: 61568KB available (2900K code, 303K data, 112K init)
- Mount-cache hash table entries: 512
- CPU: Testing write buffer coherency: ok
- NET: Registered protocol family 16
- S3C2410 Power Management, (c) 2004 Simtec Electronics
- S3C2440: Initialising architecture
- S3C2440: IRQ Support
- S3C2440: Clock Support, DVS off
- S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
- DMA channel 0 at c4800000, irq 33
- DMA channel 1 at c4800040, irq 34
- DMA channel 2 at c4800080, irq 35
- DMA channel 3 at c48000c0, irq 36
- usbcore: registered new interface driver usbfs
- usbcore: registered new interface driver hub
- usbcore: registered new device driver usb
- NET: Registered protocol family 2
- IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
- TCP established hash table entries: 2048 (order: 2, 16384 bytes)
- TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
- TCP: Hash tables configured (established 2048 bind 2048)
- TCP reno registered
- NetWinder Floating Point Emulator V0.97 (double precision)
- JFFS2 version 2.2. (NAND) 2001-2006 Red Hat, Inc.
- fuse init (API version 7.8)
- io scheduler noop registered
- io scheduler anticipatory registered (default)
- io scheduler deadline registered
- io scheduler cfq registered
- s3c2410-lcd s3c2410-lcd: invalid bpp 16
- Console: switching to colour frame buffer device 30x40
- fb0: s3c2410fb frame buffer device
- S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
- Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
- s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
- s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
- s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
- RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
- loop: module loaded
- dm9000 Ethernet Driver
- eth0: dm9000 at c485e000,c4860004 IRQ 51 MAC: 08:00:3e:26:0a:5b
- usbcore: registered new interface driver asix
- usbcore: registered new interface driver cdc_ether
- usbcore: registered new interface driver net1080
- usbcore: registered new interface driver cdc_subset
- usbcore: registered new interface driver zaurus
- Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
- ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
- S3C24XX NAND Driver, (c) 2004 Simtec Electronics
- s3c2440-nand s3c2440-nand: Tacls=3, 30ns Twrph0=7 70ns, Twrph1=3 30ns
- NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
- Scanning device for bad blocks
- Bad eraseblock 213 at 0x01aa0000
- ......
- Bad eraseblock 1995 at 0x0f960000
- Creating 6 MTD partitions on "NAND 256MiB 3,3V 8-bit":
- 0x00000000-0x00080000 : "U-Boot-1.1.6"
- 0x00080000-0x000a0000 : "U-Boot-1.1.6 Parameter"
- 0x000a0000-0x00500000 : "Linux-2.6.22.6 Kernel"
- 0x00500000-0x00a00000 : "Root-JFFS2"
- 0x00a00000-0x01400000 : "Boot-Root(cramfs)"
- 0x01400000-0x10000000 : "YAFFS"
- usbmon: debugfs is not available
- s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
- s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
- s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
- usb usb1: configuration #1 chosen from 1 choice
- hub 1-0:1.0: USB hub found
- hub 1-0:1.0: 2 ports detected
- mice: PS/2 mouse device common for all mice
- S3C24XX RTC, (c) 2004,2006 Simtec Electronics
- s3c2440-i2c s3c2440-i2c: slave address 0x10
- s3c2440-i2c s3c2440-i2c: bus frequency set to 390 KHz
- s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
- TCP cubic registered
- NET: Registered protocol family 1
- NET: Registered protocol family 17
- usb 1-1: new full speed USB device using s3c2410-ohci and address 2
- usb 1-1: configuration #1 chosen from 1 choice
- hub 1-1:1.0: USB hub found
- hub 1-1:1.0: 4 ports detected
- eth0: link down
- IP-Config: Guessing netmask 255.255.255.0
- IP-Config: Gateway not on directly connected network.
- Looking up port of RPC 100003/2 on 192.168.1.6
- eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
- Looking up port of RPC 100005/1 on 192.168.1.6
- VFS: Mounted root (nfs filesystem).
- Freeing init memory: 112K
修改内核配置,内核加上EABI 和OABI的支持
Kernel Features --->
[*] Use the ARM EABI to compile the kernel
[*] Allow old ABI binaries to run with this kernel (EXPERIMENTA
输出为:
- Uncompressing Linux...................................................................................................... done, booting the kernel.
- Linux version 2.6.22.6-gd3c0d8aa-dirty (chenbing@chenbing-laptop) (gcc version 4.3.2 (crosstool-NG-1.9.3-hyh) ) #8 Thu Jun 21 00:06:38 CST 2012
- CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
- Machine: SMDK2440
- Memory policy: ECC disabled, Data cache writeback
- CPU S3C2440A (id 0x32440001)
- S3C244X: core 400.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz
- S3C24XX Clocks, (c) 2004 Simtec Electronics
- CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
- CPU0: D VIVT write-back cache
- CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
- CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
- Built 1 zonelists. Total pages: 16256
- Kernel command line: console=ttySAC0,115200 root=nfs rw nfsroot=192.168.1.6:/home/chenbing/control-project/fl2440/rootfs ip=192.168.1.7:192.168.1.6:255.255.255.0::eth0 init=/linuxrc
- irq: clearing pending ext status 00080800
- irq: clearing subpending status 00000003
- irq: clearing subpending status 00000002
- PID hash table entries: 256 (order: 8, 1024 bytes)
- timer tcon=00500000, tcnt a2c1, tcfg 00000200,00000000, usec 00001eb8
- Console: colour dummy device 80x30
- Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
- Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
- Memory: 64MB = 64MB total
- Memory: 61568KB available (2920K code, 302K data, 112K init)
- Mount-cache hash table entries: 512
- CPU: Testing write buffer coherency: ok
- NET: Registered protocol family 16
- S3C2410 Power Management, (c) 2004 Simtec Electronics
- S3C2440: Initialising architecture
- S3C2440: IRQ Support
- S3C2440: Clock Support, DVS off
- S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
- DMA channel 0 at c4800000, irq 33
- DMA channel 1 at c4800040, irq 34
- DMA channel 2 at c4800080, irq 35
- DMA channel 3 at c48000c0, irq 36
- usbcore: registered new interface driver usbfs
- usbcore: registered new interface driver hub
- usbcore: registered new device driver usb
- NET: Registered protocol family 2
- IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
- TCP established hash table entries: 2048 (order: 2, 16384 bytes)
- TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
- TCP: Hash tables configured (established 2048 bind 2048)
- TCP reno registered
- NetWinder Floating Point Emulator V0.97 (double precision)
- JFFS2 version 2.2. (NAND) 2001-2006 Red Hat, Inc.
- fuse init (API version 7.8)
- io scheduler noop registered
- io scheduler anticipatory registered (default)
- io scheduler deadline registered
- io scheduler cfq registered
- s3c2410-lcd s3c2410-lcd: invalid bpp 16
- Console: switching to colour frame buffer device 30x40
- fb0: s3c2410fb frame buffer device
- S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
- Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
- s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
- s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
- s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
- RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
- loop: module loaded
- dm9000 Ethernet Driver
- eth0: dm9000 at c485e000,c4860004 IRQ 51 MAC: 08:00:3e:26:0a:5b
- usbcore: registered new interface driver asix
- usbcore: registered new interface driver cdc_ether
- usbcore: registered new interface driver net1080
- usbcore: registered new interface driver cdc_subset
- usbcore: registered new interface driver zaurus
- Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
- ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
- S3C24XX NAND Driver, (c) 2004 Simtec Electronics
- s3c2440-nand s3c2440-nand: Tacls=3, 30ns Twrph0=7 70ns, Twrph1=3 30ns
- NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
- Scanning device for bad blocks
- Bad eraseblock 213 at 0x01aa0000
- ......
- Bad eraseblock 1995 at 0x0f960000
- Creating 6 MTD partitions on "NAND 256MiB 3,3V 8-bit":
- 0x00000000-0x00080000 : "U-Boot-1.1.6"
- 0x00080000-0x000a0000 : "U-Boot-1.1.6 Parameter"
- 0x000a0000-0x00500000 : "Linux-2.6.22.6 Kernel"
- 0x00500000-0x00a00000 : "Root-JFFS2"
- 0x00a00000-0x01400000 : "Boot-Root(cramfs)"
- 0x01400000-0x10000000 : "YAFFS"
- usbmon: debugfs is not available
- s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
- s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
- s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
- usb usb1: configuration #1 chosen from 1 choice
- hub 1-0:1.0: USB hub found
- hub 1-0:1.0: 2 ports detected
- mice: PS/2 mouse device common for all mice
- S3C24XX RTC, (c) 2004,2006 Simtec Electronics
- s3c2440-i2c s3c2440-i2c: slave address 0x10
- s3c2440-i2c s3c2440-i2c: bus frequency set to 390 KHz
- s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
- TCP cubic registered
- NET: Registered protocol family 1
- NET: Registered protocol family 17
- usb 1-1: new full speed USB device using s3c2410-ohci and address 2
- usb 1-1: configuration #1 chosen from 1 choice
- hub 1-1:1.0: USB hub found
- hub 1-1:1.0: 4 ports detected
- eth0: link down
- IP-Config: Guessing netmask 255.255.255.0
- IP-Config: Gateway not on directly connected network.
- Looking up port of RPC 100003/2 on 192.168.1.6
- eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
- Looking up port of RPC 100005/1 on 192.168.1.6
- VFS: Mounted root (nfs filesystem).
- Freeing init memory: 112K
- FATAL: kernel too old
- Kernel panic - not syncing: Attempted to kill init!
四、原因分析
内核版本低于交叉编译器的要求,具体查看方法如下(即用file命令检查将要拷贝到rootfs/lib的libc-2.9.so):
- $ file libc-2.9.so
- libc-2.9.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, not stripped
意即出现上面错误的一个必然原因是根文件系统中的 C 运行时库(libc-2.9.so)的内核版本最低要求高于当前的内核版本。
五、解决方法
1.编译工具和根文件系统不变,采用更高的内核版本进行移植(version > 2.6.32);
2.内核不变且内核采用当前的编译工具(4.3.2),根文件系统移植时采用低版本的编译工具(以便编译工具提供的libc-x.x.so兼容所移植内核版本)。
阅读(4831) | 评论(0) | 转发(0) |