一个简单的模块问题
时间:2010-08-20
来源:互联网
- #include <linux/init.h>
- #include <linux/module.h>
- #include <linux/kernel.h>
-
- int __init init(void)
- {
- int i = 0;
- int *p = 0;
- *p = i+1;
- return 0;
- }
-
- void __exit fint(void)
- {
- return;
- }
- module_init(init)
- module_exit(fint)
-
- MODULE_LICENSE("GPL");
- MODULE_AUTHOR("ZX");
错误信息如下
Message from syslogd@localhost at Aug 20 23:09:08 ...
kernel:Oops: 0002 [#1] SMP
Message from syslogd@localhost at Aug 20 23:09:08 ...
kernel:last sysfs file: /sys/devices/virtual/net/lo/type
Message from syslogd@localhost at Aug 20 23:09:08 ...
kernel

Message from syslogd@localhost at Aug 20 23:09:08 ...
kernel:Stack:
Message from syslogd@localhost at Aug 20 23:09:08 ...
kernel:Call Trace:
Message from syslogd@localhost at Aug 20 23:09:08 ...
kernel:Code: <c7> 05 00 00 00 00 01 00 00 00 5d c3 00 00 00 00 00 00 00 00 00 00
Message from syslogd@localhost at Aug 20 23:09:08 ...
kernel:EIP: [<f8b36005>] init_module+0x5/0x11 [crash] SS:ESP 0068:f1961f84
Message from syslogd@localhost at Aug 20 23:09:08 ...
kernel:CR2: 0000000000000000
已杀死
反汇编的代码是
- crash.ko: file format elf32-i386
-
-
- Disassembly of section .init.text:
-
- 00000000 <init>:
- 0: 55 push %ebp
- 1: 31 c0 xor %eax,%eax
- 3: 89 e5 mov %esp,%ebp
- 5: c7 05 00 00 00 00 01 movl $0x1,0x0
- c: 00 00 00
- f: 5d pop %ebp
- 10: c3 ret
-
- Disassembly of section .exit.text:
-
- 00000000 <cleanup_module>:
- 0: 55 push %ebp
- 1: 89 e5 mov %esp,%ebp
- 3: e8 fc ff ff ff call 4 <cleanup_module+0x4>
- 8: 5d pop %ebp
- 9: c3 ret
2 插入模块出错后,就不能卸载了。只有重启吗?还有其它的方法吗?
作者: donotgiveup 发布时间: 2010-08-20
QUOTE:
1 我想问下f8b36005这个地址是怎么来的?模块的都是以f开头的吗(fxxx xxxx)
提示信息中说这个是EIP的地址,也就是出现oops 的当前指令的地址
QUOTE:
2 插入模块出错后,就不能卸载了。只有重启吗?还有其它的方法吗?
因为出现oops了,系统有异常了。最好还是重启。
作者: Godbach 发布时间: 2010-08-22
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28