免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3867 | 回复: 0
打印 上一主题 下一主题

怎么ldd3的sculld编译运行有问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-08-02 00:32 |只看该作者 |倒序浏览
是2.6.10内核树

书上带的例子没动
编译时

  1. [root@localhost sculld]# make
  2. make -C /lib/modules/2.6.10/build M=/root/ldd3/sculld LDDINC=/root/ldd3/sculld modules
  3. make[1]: Entering directory `/root/linux-2.6.10'
  4.   Building modules, stage 2.
  5.   MODPOST
  6. *** Warning: "register_ldd_driver" [/root/ldd3/sculld/sculld.ko] undefined!
  7. *** Warning: "unregister_ldd_device" [/root/ldd3/sculld/sculld.ko] undefined!
  8. *** Warning: "register_ldd_device" [/root/ldd3/sculld/sculld.ko] undefined!
  9. *** Warning: "unregister_ldd_driver" [/root/ldd3/sculld/sculld.ko] undefined!
  10. make[1]: Leaving directory `/root/linux-2.6.10'
复制代码
找到那几个undefined函数后,编译不报warning了,但是插入又报
  1. Badness in kref_get at lib/kref.c:32
  2. [<c01b7714>] kref_get+0x44/0x50
  3. [<c01b6bea>] kobject_get+0x1a/0x30
  4. [<c01edcfd>] get_bus+0x1d/0x40
  5. [<c01edb04>] bus_add_driver+0x24/0xd0
  6. [<c01ee19f>] driver_register+0x2f/0x40
  7. [<c01ee170>] driver_register+0x0/0x40
  8. [<d085afd1>] register_ldd_driver+0x21/0x70 [sculld]
  9. [<d085aa8e>] sculld_init+0x4e/0x180 [sculld]
  10. [<c012a3fb>] sys_init_module+0x1ab/0x1d0
  11. [<c01025c9>] sysenter_past_esp+0x52/0x75
  12. Badness in kref_get at lib/kref.c:32
  13. [<c01b7714>] kref_get+0x44/0x50
  14. [<c01b6bea>] kobject_get+0x1a/0x30
  15. [<c01b6871>] kobject_init+0x31/0x50
  16. [<c01b69fb>] kobject_register+0x1b/0x60
  17. [<c01edb37>] bus_add_driver+0x57/0xd0
  18. [<c01ee19f>] driver_register+0x2f/0x40
  19. [<c01ee170>] driver_register+0x0/0x40
  20. [<d085afd1>] register_ldd_driver+0x21/0x70 [sculld]
  21. [<d085aa8e>] sculld_init+0x4e/0x180 [sculld]
  22. [<c012a3fb>] sys_init_module+0x1ab/0x1d0
  23. [<c01025c9>] sysenter_past_esp+0x52/0x75
  24. Unable to handle kernel NULL pointer dereference at virtual address 00000048
  25. printing eip:
  26. c01b694a
  27. *pde = 00000000
  28. Oops: 0002 [#1]
  29. Modules linked in: sculld
  30. CPU:    0
  31. EIP:    0060:[<c01b694a>]    Not tainted VLI
  32. EFLAGS: 00010282   (2.6.10)
  33. EIP is at kobject_add+0x4a/0xe0
  34. eax: 00000048   ebx: d085cd00   ecx: 00000000   edx: ffff0001
  35. esi: d085cd00   edi: 00000000   ebp: 00000000   esp: c6fdbf00
  36. ds: 007b   es: 007b   ss: 0068
  37. Process insmod (pid: 3895, threadinfo=c6fda000 task=c803e500)
  38. Stack: 00000000 d085cd00 d085cd00 d085cd00 d085cce8 c01b6a03 d085cd00 d085cd00
  39.        d085cf00 d085cd00 d085cf00 c01edb37 d085cd00 c02d9228 d085b10a d085cce0
  40.        d085cce8 bffffb00 c6fda000 c01ee19f d085cce8 ffffff00 c01ee170 00000060
  41. Call Trace:
  42. [<c01b6a03>] kobject_register+0x23/0x60
  43. [<c01edb37>] bus_add_driver+0x57/0xd0
  44. [<c01ee19f>] driver_register+0x2f/0x40
  45. [<c01ee170>] driver_register+0x0/0x40
  46. [<d085afd1>] register_ldd_driver+0x21/0x70 [sculld]
  47. [<d085aa8e>] sculld_init+0x4e/0x180 [sculld]
  48. [<c012a3fb>] sys_init_module+0x1ab/0x1d0
  49. [<c01025c9>] sysenter_past_esp+0x52/0x75
  50. Code: 00 00 8b 13 85 d2 75 05 8d 43 04 89 03 8b 43 24 89 04 24 e8 99 02 00 00
  51. 89 c7 8b 43 28 85 c0 74 48 8b 08 ba 01 00 ff ff 8d 41 48 <0f> c1 10 85 d2 0f
  52. 85 20 06 00 00 85 ff 74 6f 8b 43 28 8d
  53. 53 1c
复制代码
insmod报这个错

sculld应该怎么运行?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP