Chinaunix首页 | 论坛 | 博客
  • 博客访问: 62907
  • 博文数量: 10
  • 博客积分: 728
  • 博客等级: 下士
  • 技术积分: 235
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-13 13:17
文章存档

2012年(10)

分类: LINUX

2012-06-21 00:21:15

一、参考资料
二、实验环境
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 前的输出

  1. Starting kernel ...
  2. Uncompressing Linux..................................................................................................... done, booting the kernel.
  3. 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
  4. CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
  5. Machine: SMDK2440
  6. Memory policy: ECC disabled, Data cache writeback
  7. CPU S3C2440A (id 0x32440001)
  8. S3C244X: core 400.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz
  9. S3C24XX Clocks, (c) 2004 Simtec Electronics
  10. CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
  11. CPU0: D VIVT write-back cache
  12. CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
  13. CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
  14. Built 1 zonelists. Total pages: 16256
  15. 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
  16. irq: clearing pending ext status 00080800
  17. irq: clearing subpending status 00000003
  18. irq: clearing subpending status 00000002
  19. PID hash table entries: 256 (order: 8, 1024 bytes)
  20. timer tcon=00500000, tcnt a2c1, tcfg 00000200,00000000, usec 00001eb8
  21. Console: colour dummy device 80x30
  22. Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
  23. Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
  24. Memory: 64MB = 64MB total
  25. Memory: 61568KB available (2900K code, 303K data, 112K init)
  26. Mount-cache hash table entries: 512
  27. CPU: Testing write buffer coherency: ok
  28. NET: Registered protocol family 16
  29. S3C2410 Power Management, (c) 2004 Simtec Electronics
  30. S3C2440: Initialising architecture
  31. S3C2440: IRQ Support
  32. S3C2440: Clock Support, DVS off
  33. S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
  34. DMA channel 0 at c4800000, irq 33
  35. DMA channel 1 at c4800040, irq 34
  36. DMA channel 2 at c4800080, irq 35
  37. DMA channel 3 at c48000c0, irq 36
  38. usbcore: registered new interface driver usbfs
  39. usbcore: registered new interface driver hub
  40. usbcore: registered new device driver usb
  41. NET: Registered protocol family 2
  42. IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
  43. TCP established hash table entries: 2048 (order: 2, 16384 bytes)
  44. TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
  45. TCP: Hash tables configured (established 2048 bind 2048)
  46. TCP reno registered
  47. NetWinder Floating Point Emulator V0.97 (double precision)
  48. JFFS2 version 2.2. (NAND) 2001-2006 Red Hat, Inc.
  49. fuse init (API version 7.8)
  50. io scheduler noop registered
  51. io scheduler anticipatory registered (default)
  52. io scheduler deadline registered
  53. io scheduler cfq registered
  54. s3c2410-lcd s3c2410-lcd: invalid bpp 16
  55. Console: switching to colour frame buffer device 30x40
  56. fb0: s3c2410fb frame buffer device
  57. S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
  58. Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
  59. s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
  60. s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
  61. s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
  62. RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
  63. loop: module loaded
  64. dm9000 Ethernet Driver
  65. eth0: dm9000 at c485e000,c4860004 IRQ 51 MAC: 08:00:3e:26:0a:5b
  66. usbcore: registered new interface driver asix
  67. usbcore: registered new interface driver cdc_ether
  68. usbcore: registered new interface driver net1080
  69. usbcore: registered new interface driver cdc_subset
  70. usbcore: registered new interface driver zaurus
  71. Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
  72. ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
  73. S3C24XX NAND Driver, (c) 2004 Simtec Electronics
  74. s3c2440-nand s3c2440-nand: Tacls=3, 30ns Twrph0=7 70ns, Twrph1=3 30ns
  75. NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
  76. Scanning device for bad blocks
  77. Bad eraseblock 213 at 0x01aa0000
  78. ......
  79. Bad eraseblock 1995 at 0x0f960000
  80. Creating 6 MTD partitions on "NAND 256MiB 3,3V 8-bit":
  81. 0x00000000-0x00080000 : "U-Boot-1.1.6"
  82. 0x00080000-0x000a0000 : "U-Boot-1.1.6 Parameter"
  83. 0x000a0000-0x00500000 : "Linux-2.6.22.6 Kernel"
  84. 0x00500000-0x00a00000 : "Root-JFFS2"
  85. 0x00a00000-0x01400000 : "Boot-Root(cramfs)"
  86. 0x01400000-0x10000000 : "YAFFS"
  87. usbmon: debugfs is not available
  88. s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
  89. s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
  90. s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
  91. usb usb1: configuration #1 chosen from 1 choice
  92. hub 1-0:1.0: USB hub found
  93. hub 1-0:1.0: 2 ports detected
  94. mice: PS/2 mouse device common for all mice
  95. S3C24XX RTC, (c) 2004,2006 Simtec Electronics
  96. s3c2440-i2c s3c2440-i2c: slave address 0x10
  97. s3c2440-i2c s3c2440-i2c: bus frequency set to 390 KHz
  98. s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
  99. TCP cubic registered
  100. NET: Registered protocol family 1
  101. NET: Registered protocol family 17
  102. usb 1-1: new full speed USB device using s3c2410-ohci and address 2
  103. usb 1-1: configuration #1 chosen from 1 choice
  104. hub 1-1:1.0: USB hub found
  105. hub 1-1:1.0: 4 ports detected
  106. eth0: link down
  107. IP-Config: Guessing netmask 255.255.255.0
  108. IP-Config: Gateway not on directly connected network.
  109. Looking up port of RPC 100003/2 on 192.168.1.6
  110. eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
  111. Looking up port of RPC 100005/1 on 192.168.1.6
  112. VFS: Mounted root (nfs filesystem).
  113. 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
输出为:

  1. Uncompressing Linux...................................................................................................... done, booting the kernel.
  2. 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
  3. CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
  4. Machine: SMDK2440
  5. Memory policy: ECC disabled, Data cache writeback
  6. CPU S3C2440A (id 0x32440001)
  7. S3C244X: core 400.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz
  8. S3C24XX Clocks, (c) 2004 Simtec Electronics
  9. CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
  10. CPU0: D VIVT write-back cache
  11. CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
  12. CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
  13. Built 1 zonelists. Total pages: 16256
  14. 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
  15. irq: clearing pending ext status 00080800
  16. irq: clearing subpending status 00000003
  17. irq: clearing subpending status 00000002
  18. PID hash table entries: 256 (order: 8, 1024 bytes)
  19. timer tcon=00500000, tcnt a2c1, tcfg 00000200,00000000, usec 00001eb8
  20. Console: colour dummy device 80x30
  21. Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
  22. Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
  23. Memory: 64MB = 64MB total
  24. Memory: 61568KB available (2920K code, 302K data, 112K init)
  25. Mount-cache hash table entries: 512
  26. CPU: Testing write buffer coherency: ok
  27. NET: Registered protocol family 16
  28. S3C2410 Power Management, (c) 2004 Simtec Electronics
  29. S3C2440: Initialising architecture
  30. S3C2440: IRQ Support
  31. S3C2440: Clock Support, DVS off
  32. S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
  33. DMA channel 0 at c4800000, irq 33
  34. DMA channel 1 at c4800040, irq 34
  35. DMA channel 2 at c4800080, irq 35
  36. DMA channel 3 at c48000c0, irq 36
  37. usbcore: registered new interface driver usbfs
  38. usbcore: registered new interface driver hub
  39. usbcore: registered new device driver usb
  40. NET: Registered protocol family 2
  41. IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
  42. TCP established hash table entries: 2048 (order: 2, 16384 bytes)
  43. TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
  44. TCP: Hash tables configured (established 2048 bind 2048)
  45. TCP reno registered
  46. NetWinder Floating Point Emulator V0.97 (double precision)
  47. JFFS2 version 2.2. (NAND) 2001-2006 Red Hat, Inc.
  48. fuse init (API version 7.8)
  49. io scheduler noop registered
  50. io scheduler anticipatory registered (default)
  51. io scheduler deadline registered
  52. io scheduler cfq registered
  53. s3c2410-lcd s3c2410-lcd: invalid bpp 16
  54. Console: switching to colour frame buffer device 30x40
  55. fb0: s3c2410fb frame buffer device
  56. S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
  57. Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
  58. s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
  59. s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
  60. s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
  61. RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
  62. loop: module loaded
  63. dm9000 Ethernet Driver
  64. eth0: dm9000 at c485e000,c4860004 IRQ 51 MAC: 08:00:3e:26:0a:5b
  65. usbcore: registered new interface driver asix
  66. usbcore: registered new interface driver cdc_ether
  67. usbcore: registered new interface driver net1080
  68. usbcore: registered new interface driver cdc_subset
  69. usbcore: registered new interface driver zaurus
  70. Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
  71. ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
  72. S3C24XX NAND Driver, (c) 2004 Simtec Electronics
  73. s3c2440-nand s3c2440-nand: Tacls=3, 30ns Twrph0=7 70ns, Twrph1=3 30ns
  74. NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
  75. Scanning device for bad blocks
  76. Bad eraseblock 213 at 0x01aa0000
  77. ......
  78. Bad eraseblock 1995 at 0x0f960000
  79. Creating 6 MTD partitions on "NAND 256MiB 3,3V 8-bit":
  80. 0x00000000-0x00080000 : "U-Boot-1.1.6"
  81. 0x00080000-0x000a0000 : "U-Boot-1.1.6 Parameter"
  82. 0x000a0000-0x00500000 : "Linux-2.6.22.6 Kernel"
  83. 0x00500000-0x00a00000 : "Root-JFFS2"
  84. 0x00a00000-0x01400000 : "Boot-Root(cramfs)"
  85. 0x01400000-0x10000000 : "YAFFS"
  86. usbmon: debugfs is not available
  87. s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
  88. s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
  89. s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
  90. usb usb1: configuration #1 chosen from 1 choice
  91. hub 1-0:1.0: USB hub found
  92. hub 1-0:1.0: 2 ports detected
  93. mice: PS/2 mouse device common for all mice
  94. S3C24XX RTC, (c) 2004,2006 Simtec Electronics
  95. s3c2440-i2c s3c2440-i2c: slave address 0x10
  96. s3c2440-i2c s3c2440-i2c: bus frequency set to 390 KHz
  97. s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
  98. TCP cubic registered
  99. NET: Registered protocol family 1
  100. NET: Registered protocol family 17
  101. usb 1-1: new full speed USB device using s3c2410-ohci and address 2
  102. usb 1-1: configuration #1 chosen from 1 choice
  103. hub 1-1:1.0: USB hub found
  104. hub 1-1:1.0: 4 ports detected
  105. eth0: link down
  106. IP-Config: Guessing netmask 255.255.255.0
  107. IP-Config: Gateway not on directly connected network.
  108. Looking up port of RPC 100003/2 on 192.168.1.6
  109. eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
  110. Looking up port of RPC 100005/1 on 192.168.1.6
  111. VFS: Mounted root (nfs filesystem).
  112. Freeing init memory: 112K
  113. FATAL: kernel too old
  114. Kernel panic - not syncing: Attempted to kill init!
四、原因分析
内核版本低于交叉编译器的要求,具体查看方法如下(即用file命令检查将要拷贝到rootfs/lib的libc-2.9.so):

  1. $ file libc-2.9.so
  2. 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兼容所移植内核版本)。
阅读(4783) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~