设备驱动修改后需要重新启动吗
编了个设备驱动,每次重新make后再rmmon , insmod后在运行应用程序,内核总是报告内存错误,但是重新驱动后就好了,这是为什么呢?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
编了个设备驱动,每次重新make后再rmmon , insmod后在运行应用程序,内核总是报告内存错误,但是重新驱动后就好了,这是为什么呢?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(8)
在哪一步报的错误?
把原始的错误信息贴出来,不要自己加工
报错如下:
temp opeUnable to handle kernel paging request at virtual address 35376d6c
n OK!
pgd = c2424000
[35376d6c] *pgd=00000000
Internal error: Oops: 0 [#1] PREEMPT
Modules linked in: lm75
CPU: 0 Not tainted (2.6.22.10 #7)
PC is at 0x35376d6c
LR is at do_ioctl+0xa8/0xd0
pc : [<35376d6c>] lr : [<c01857cc>] psr: 20000013
sp : c1bbff30 ip : 35376d6c fp : c1bbff4c
r10: 00900036 r9 : c1bbe000 r8 : c0120814
r7 : 00000000 r6 : bef02cdc r5 : c1ae8c20 r4 : 35376d6c
r3 : bef02cdc r2 : 00000000 r1 : c1ae8c20 r0 : c1af8268
Flags: nzCv IRQs on FIQs on Mode SVC_32 Segment user
Control: 0005317f Table: c2424000 DAC: 00000015
Process hb1030_tempt (pid: 195, stack limit = 0xc1bbe260)
Stack: (0xc1bbff30 to 0xc1bc0000)
ff20: 00000003 c1ae8c20 bef02cdc c1ae8c20
ff40: c1bbff7c c1bbff50 c0185aa4 c0185734 c0178c4c c0252234 00000003 00000003
ff60: bef02cdc 00000000 c0120814 c1bbe000 c1bbffa4 c1bbff80 c0185b08 c0185804
ff80: c0126a10 00000000 00000003 bef02cf0 000083f4 00000036 00000000 c1bbffa8
ffa0: c0120020 c0185ad8 00000003 bef02cf0 00000003 00000000 bef02cdc bef02cd8
ffc0: 00000003 bef02cf0 000083f4 4005aea8 bef02d74 00000001 00008368 000084cc
ffe0: 40019808 bef02cc4 00008504 40019828 20000010 00000003 00000003 00000004
Backtrace:
[<c0185724>] (do_ioctl+0x0/0xd0) from [<c0185aa4>] (vfs_ioctl+0x2b0/0x2d4)
r7:c1ae8c20 r6:bef02cdc r5:c1ae8c20 r4:00000003
[<c01857f4>] (vfs_ioctl+0x0/0x2d4) from [<c0185b08>] (sys_ioctl+0x40/0x64)
r9:c1bbe000 r8:c0120814 r6:00000000 r5:bef02cdc r4:00000003
[<c0185ac8>] (sys_ioctl+0x0/0x64) from [<c0120020>] (ret_fast_syscall+0x0/0x2c)
r7:00000036 r6:000083f4 r5:bef02cf0 r4:00000003
Code: bad PC value.
Unable to handle kernel NULL pointer dereference at virtual address 00000004
pgd = c0104000
[00000004] *pgd=00000000
Internal error: Oops: 0 [#2] PREEMPT
Modules linked in: lm75
CPU: 0 Not tainted (2.6.22.10 #7)
PC is at 0x4
LR is at filp_close+0x4c/0x78
pc : [<00000004>] lr : [<c0176890>] psr: 20000013
sp : c1bbfdd8 ip : c1bbfdf8 fp : c1bbfdf4
r10: 00000000 r9 : c05fa380 r8 : 00000000
r7 : c049f8e8 r6 : c049f8e0 r5 : 00000001 r4 : c1ae8c20
r3 : 00000004 r2 : c1bbe000 r1 : c049f8e0 r0 : c1ae8c20
Flags: nzCv IRQs on FIQs on Mode SVC_32 Segment user
Control: 0005317f Table: c2424000 DAC: 00000015
Process hb1030_tempt (pid: 195, stack limit = 0xc1bbe260)
Stack: (0xc1bbfdd8 to 0xc1bc0000)
fdc0: c1bbfdfc c049f8e0
fde0: 00000001 0000000c c1bbfe1c c1bbfdf8 c01392ac c0176854 c049f8e0 c048f0a0
fe00: bf000000 00000001 0000000b c0364b9c c1bbfe44 c1bbfe20 c013a894 c013923c
fe20: 00000000 bf000000 c1bbfe44 c1bbfe38 c0136f8c 00000000 c1bbfe54 c1bbfe48
fe40: c0124744 c013a630 c1bbfe74 c1bbfe58 c0126734 c01244d0 ffffffec c1bbff1c
fe60: c048f0a0 c0613910 c1bbfebc c1bbfe78 c0126958 c01266d8 60000013 ffffffff
fe80: c1bbfe9c c1bbfe90 c1bbfee8 00000000 c1bbfeb4 ffffffff c1bbff1c bef02cdc
fea0: 00000000 c0120814 60000013 00900036 c1bbfed4 c1bbfec0 c0126a10 c0126754
fec0: c1ae84a0 ffffffff c1bbfee4 c1bbfed8 c011f1ec c0126a04 c1bbff4c c1bbfee8
fee0: c011fcac c011f1e4 c1af8268 c1ae8c20 00000000 bef02cdc 35376d6c c1ae8c20
ff00: bef02cdc 00000000 c0120814 c1bbe000 00900036 c1bbff4c 35376d6c c1bbff30
ff20: c01857cc 35376d6c 20000013 ffffffff 00000003 c1ae8c20 bef02cdc c1ae8c20
ff40: c1bbff7c c1bbff50 c0185aa4 c0185734 c0178c4c c0252234 00000003 00000003
ff60: bef02cdc 00000000 c0120814 c1bbe000 c1bbffa4 c1bbff80 c0185b08 c0185804
ff80: c0126a10 00000000 00000003 bef02cf0 000083f4 00000036 00000000 c1bbffa8
ffa0: c0120020 c0185ad8 00000003 bef02cf0 00000003 00000000 bef02cdc bef02cd8
ffc0: 00000003 bef02cf0 000083f4 4005aea8 bef02d74 00000001 00008368 000084cc
ffe0: 40019808 bef02cc4 00008504 40019828 20000010 00000003 00000003 00000004
Backtrace:
[<c0176844>] (filp_close+0x0/0x78) from [<c01392ac>] (put_files_struct+0x80/0xd4)
r6:0000000c r5:00000001 r4:c049f8e0
[<c013922c>] (put_files_struct+0x0/0xd4) from [<c013a894>] (do_exit+0x274/0x920)
[<c013a620>] (do_exit+0x0/0x920) from [<c0124744>] (die+0x284/0x2e0)
[<c01244c0>] (die+0x0/0x2e0) from [<c0126734>] (__do_kernel_fault+0x6c/0x7c)
[<c01266c8>] (__do_kernel_fault+0x0/0x7c) from [<c0126958>] (do_page_fault+0x214/0x22c)
r7:c0613910 r6:c048f0a0 r5:c1bbff1c r4:ffffffec
[<c0126744>] (do_page_fault+0x0/0x22c) from [<c0126a10>] (do_translation_fault+0x1c/0x80)
[<c01269f4>] (do_translation_fault+0x0/0x80) from [<c011f1ec>] (do_PrefetchAbort+0x18/0x1c)
r4:ffffffff
[<c011f1d4>] (do_PrefetchAbort+0x0/0x1c) from [<c011fcac>] (__pabt_svc+0x4c/0x80)
Exception stack(0xc1bbfee8 to 0xc1bbff30)
fee0: c1af8268 c1ae8c20 00000000 bef02cdc 35376d6c c1ae8c20
ff00: bef02cdc 00000000 c0120814 c1bbe000 00900036 c1bbff4c 35376d6c c1bbff30
ff20: c01857cc 35376d6c 20000013 ffffffff
[<c0185724>] (do_ioctl+0x0/0xd0) from [<c0185aa4>] (vfs_ioctl+0x2b0/0x2d4)
r7:c1ae8c20 r6:bef02cdc r5:c1ae8c20 r4:00000003
[<c01857f4>] (vfs_ioctl+0x0/0x2d4) from [<c0185b08>] (sys_ioctl+0x40/0x64)
r9:c1bbe000 r8:c0120814 r6:00000000 r5:bef02cdc r4:00000003
[<c0185ac8>] (sys_ioctl+0x0/0x64) from [<c0120020>] (ret_fast_syscall+0x0/0x2c)
r7:00000036 r6:000083f4 r5:bef02cf0 r4:00000003
Code: bad PC value.
Fixing recursive fault but reboot is needed!
[ 本帖最后由 dreamice 于 2008-11-13 13:06 编辑 ]
这个应该是OOPS了。
看看分配内存是否成功以及访问内存是否非法
把代码贴出来,你这个是kernel panic了。
系统刚启动的时候,不会有那么多模块在跑,所以你加载模块的时候可能不会马上出现kernel panic。
而当系统跑起来一会儿后,你再加载,就立竿见影了
这都是使用非法内存的原因
可能又是野指针造成的
基本上属于引用了系统保护的内存地址,或者就是NULL