免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2620 | 回复: 0

自己写的一个简单bootloader, 启动kernel时崩了!!! [复制链接]

论坛徽章:
0
发表于 2010-06-19 01:06 |显示全部楼层
自己写的一个简单bootloader, 启动kernel时出错了。输出以下信息。
从输出信息看,问题出在kernel/timer.c文件的第317行BUG_ON(!timer->function);
其中找到BUG_ON()宏代码如下:
  1. #ifdef CONFIG_BUG
  2. #ifndef HAVE_ARCH_BUG
  3. #define BUG() do { \
  4.     printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
  5.     panic("BUG!"); \
  6. } while (0)
  7. #endif

  8. #ifndef HAVE_ARCH_BUG_ON
  9. #define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
  10. #endif
复制代码
似乎"timer->function == NULL"是故障原因,但这是刚启动的初始化阶段,还在swaper进程中啊,会不会是bootloader没有满足启动内核的要求,或tag list传入信息不够?渴望高人指点!!!


以下是输出信息:

  1. ------ hello myboot--------
  2. [myboot $] bootm
  3. read kernel image ok.
  4. Uncompressing Linux........................................................................................... done, booting the kernel.
  5. Linux version 2.6.13-Qt2440 (root@devil) (gcc version 3.4.1) #2 Wed Jun 16 00:01:45 CST 2010
  6. CPU: ARM920Tid(wb) [41129200] revision 0 (ARMv4T)
  7. Machine: QT-2440
  8. Memory policy: ECC disabled, Data cache writeback
  9. CPU S3C2440A (id 0x32440001)
  10. S3C2440: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
  11. S3C2410 Clocks, (c) 2004 Simtec Electronics
  12. CPU0: D VIVT write-back cache
  13. CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
  14. CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
  15. Built 1 zonelists
  16. Kernel command line: mem=64M console=ttySAC0
  17. irq: clearing subpending status 00000003
  18. PID hash table entries: 512 (order: 9, 8192 bytes)
  19. timer tcon=00000000, tcnt a4ca, tcfg 00000200,00000000, usec 00001e57
  20. Console: colour dummy device 80x30
  21. Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
  22. Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
  23. Memory: 64MB = 64MB total
  24. Memory: 61952KB available (2238K code, 542K data, 108K init)
  25. Mount-cache hash table entries: 512
  26. CPU: Testing write buffer coherency: ok
  27. NET: Registered protocol family 16
  28. USB Power Control, (c) 2004 Simtec Electronics
  29. S3C2440: Initialising architecture
  30. S3C2440: IRQ Support
  31. S3C2440: Clock Support, UPLL 204.000 MHz
  32. SCSI subsystem initialized
  33. usbcore: registered new driver hub
  34. S3C2410 DMA Driver, (c) 2003-2004 Simtec Electronics
  35. DMA channel 0 at c4800000, irq 33
  36. DMA channel 1 at c4800040, irq 34
  37. DMA channel 2 at c4800080, irq 35
  38. DMA channel 3 at c48000c0, irq 36
  39. NetWinder Floating Point Emulator V0.97 (double precision)
  40. yaffs Jun 16 2010 00:00:46 Installing.
  41. Initializing Cryptographic API
  42. Console: switching to colour frame buffer device 48x40
  43. S3C24X0 fb0: s3c2410fb frame buffer device initialize done
  44. GPIO L3 bus interface for S3C2440, installed
  45. S3C2410 RTC, (c) 2004 Simtec Electronics
  46. s3c2410-rtc s3c2410-rtc: rtc disabled, re-enabling
  47. Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
  48. s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
  49. s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
  50. s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
  51. io scheduler noop registered
  52. io scheduler anticipatory registered
  53. io scheduler deadline registered
  54. io scheduler cfq registered
  55. RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
  56. loop: loaded (max 8 devices)
  57. nbd: registered device at major 43
  58. Cirrus Logic CS8900A driver for Linux (Modified for SMDK2410)
  59. eth0: CS8900A rev D at 0xe0000300 irq=53, no eeprom , addr: 08: 0:3E:26:0A:5B
  60. S3C24XX NAND Driver, (c) 2004 Simtec Electronics
  61. s3c2440-nand: mapped registers at c4880000
  62. s3c2440-nand: timing: Tacls 9ns, Twrph0 39ns, Twrph1 9ns
  63. NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
  64. NAND_ECC_NONE selected by board driver. This is not recommended !!
  65. Scanning device for bad blocks
  66. Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
  67. 0x00000000-0x00100000 : "bootloader"
  68. 0x00100000-0x00300000 : "kernel"
  69. 0x00300000-0x03fcc000 : "root"
  70. usbmon: debugfs is not available
  71. s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
  72. s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
  73. s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
  74. hub 1-0:1.0: USB hub found
  75. hub 1-0:1.0: 2 ports detected
  76. Initializing USB Mass Storage driver...
  77. usbcore: registered new driver usb-storage
  78. USB Mass Storage support registered.
  79. hub 1-0:1.0: over-current change on port 1
  80. hub 1-0:1.0: over-current change on port 2
  81. usbcore: registered new driver usbhid
  82. drivers/usb/input/hid-core.c: v2.01:USB HID core driver
  83. mice: PS/2 mouse device common for all mice
  84. ts: Compaq touchscreen protocol output
  85. kernel BUG at kernel/timer.c:317!
  86. Unable to handle kernel NULL pointer dereference at virtual address 00000000
  87. pgd = c0004000
  88. [00000000] *pgd=00000000
  89. Internal error: Oops: 805 [#1]
  90. Modules linked in:
  91. CPU: 0
  92. PC is at __bug+0x40/0x54
  93. LR is at 0x1
  94. pc : [<c00290a4>]    lr : [<00000001>]    Not tainted
  95. sp : c03a5da4  ip : 60000093  fp : c03a5db4
  96. r10: c03a5e68  r9 : c02c1a64  r8 : 0000003f
  97. r7 : 00000000  r6 : 00000001  r5 : ffff16f1  r4 : 00000000
  98. r3 : 00000000  r2 : 00000000  r1 : c03a4000  r0 : 00000001
  99. Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  Segment kernel
  100. Control: C000717F  Table: 30004000  DAC: 00000017
  101. Process swapper (pid: 1, stack limit = 0xc03a4194)
  102. Stack: (0xc03a5da4 to 0xc03a6000)
  103. 5da0:          c028ba04 c03a5dcc c03a5db8 c0045834 c0029074 c02d3a08 c028b9ec
  104. 5dc0: c03a5de8 c03a5dd0 c0198b38 c004581c c3d0b640 c03a4000 00000000 c03a5e10
  105. 5de0: c03a5dec c0024ca0 c0198a04 c02c2730 0000003f c3d0b640 c03a5e68 00000002
  106. 5e00: c03a5e68 c03a5e30 c03a5e14 c0024e08 c0024c44 ffffffff c03a4000 00000000
  107. 5e20: 00000003 c03a5e64 c03a5e34 c0024f94 c0024d68 c038ede8 84c82b00 ffffffff
  108. 5e40: c03a5e9c 00000000 00000003 00000002 c03a4000 c028b9ec c03a5ed0 c03a5e68
  109. 5e60: c0023978 c0024f50 00000005 f0000008 00000001 6b773d9a c03a4000 c3d0b640
  110. 5e80: 40000013 0000003f 00000000 00000000 c028b9ec c03a5ed0 c03a5ea0 c03a5eb0
  111. 5ea0: c002e4fc c00254ec 20000013 ffffffff c3d0b640 0000003f 10000000 c01989f4
  112. 5ec0: c023a15c c03a5ef8 c03a5ed4 c00255cc c00253f0 0000009c c028b9ec c028b950
  113. 5ee0: 00000003 00000000 00000000 c03a5f1c c03a5efc c001a270 c0025520 c028b9ec
  114. 5f00: c025907c 00000000 c028b8cc c028b8cc c03a5f38 c03a5f20 c014eb84 c001a1bc
  115. 5f20: c0259124 c03a5f50 c014ec7c c03a5f4c c03a5f3c c014ecc8 c014eb38 00000000
  116. 5f40: c03a5f78 c03a5f50 c014e2a4 c014ec8c c02867c4 c02867c4 c02590bc c028b8e0
  117. 5f60: c028b8cc 00000001 c02866dc c03a5f88 c03a5f7c c014ed14 c014e264 c03a5fb0
  118. 5f80: c03a5f8c c014e718 c014ed04 c028b8cc c03a4000 00000001 c001e018 00000000
  119. 5fa0: 00000000 c03a5fc4 c03a5fb4 c014f120 c014e6bc c001dfc8 c03a5fd4 c03a5fc8
  120. 5fc0: c001a2f8 c014f0fc c03a5ff4 c03a5fd8 c0023100 c001a2f4 00000000 00000000
  121. 5fe0: 00000000 00000000 00000000 c03a5ff8 c003e3cc c0023080 74746573 0a676e69
  122. Backtrace:
  123. [<c0029064>] (__bug+0x0/0x54) from [<c0045834>] (mod_timer+0x28/0x78)
  124. r4 = C028BA04
  125. [<c004580c>] (mod_timer+0x0/0x78) from [<c0198b38>] (s3c2410but_keyevent+0x144/0x154)
  126. r5 = C028B9EC  r4 = C02D3A08
  127. [<c01989f4>] (s3c2410but_keyevent+0x0/0x154) from [<c0024ca0>] (__do_irq+0x6c/0xb4)
  128. r6 = 00000000  r5 = C03A4000  r4 = C3D0B640
  129. [<c0024c34>] (__do_irq+0x0/0xb4) from [<c0024e08>] (do_edge_IRQ+0xb0/0x12c)
  130. [<c0024d58>] (do_edge_IRQ+0x0/0x12c) from [<c0024f94>] (asm_do_IRQ+0x54/0x158)
  131. r7 = 00000003  r6 = 00000000  r5 = C03A4000  r4 = FFFFFFFF
  132. [<c0024f40>] (asm_do_IRQ+0x0/0x158) from [<c0023978>] (__irq_svc+0x38/0x158)
  133. [<c00253e0>] (setup_irq+0x0/0x130) from [<c00255cc>] (request_irq+0xbc/0xd8)
  134. r8 = C023A15C  r7 = C01989F4  r6 = 10000000  r5 = 0000003F
  135. r4 = C3D0B640
  136. [<c0025510>] (request_irq+0x0/0xd8) from [<c001a270>] (s3c2410but_probe+0xc4/0x138)
  137. [<c001a1ac>] (s3c2410but_probe+0x0/0x138) from [<c014eb84>] (driver_probe_device+0x5c/0xa8)
  138. r7 = C028B8CC  r6 = C028B8CC  r5 = 00000000  r4 = C025907C
  139. [<c014eb28>] (driver_probe_device+0x0/0xa8) from [<c014ecc8>] (__driver_attach+0x4c/0x78)
  140. r6 = C014EC7C  r5 = C03A5F50  r4 = C0259124
  141. [<c014ec7c>] (__driver_attach+0x0/0x78) from [<c014e2a4>] (bus_for_each_dev+0x50/0x84)
  142. r4 = 00000000
  143. [<c014e254>] (bus_for_each_dev+0x0/0x84) from [<c014ed14>] (driver_attach+0x20/0x28)
  144. r7 = C02866DC  r6 = 00000001  r5 = C028B8CC  r4 = C028B8E0
  145. [<c014ecf4>] (driver_attach+0x0/0x28) from [<c014e718>] (bus_add_driver+0x6c/0x138)
  146. [<c014e6ac>] (bus_add_driver+0x0/0x138) from [<c014f120>] (driver_register+0x34/0x38)
  147. [<c014f0ec>] (driver_register+0x0/0x38) from [<c001a2f8>] (s3c2410but_init+0x14/0x1c)
  148. r4 = C001DFC8
  149. [<c001a2e4>] (s3c2410but_init+0x0/0x1c) from [<c0023100>] (init+0x90/0x1d0)
  150. [<c0023070>] (init+0x0/0x1d0) from [<c003e3cc>] (do_exit+0x0/0xc54)
  151. r7 = 00000000  r6 = 00000000  r5 = 00000000  r4 = 00000000
  152. Code: 1b004eb7 e59f0014 eb004eb5 e3a03000 (e5833000)
  153. <0>Kernel panic - not syncing: Aiee, killing interrupt handler!
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP