免费注册 查看新帖 |

Chinaunix

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

[驱动] Ooops:17 错误 求解 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-04-16 11:43 |只看该作者 |倒序浏览
arm-linux-gcc交叉编译了个驱动,加载了模块报错,如下:
unable to handle kernel NULL dereference at virtual address 000000c
Internal error : Ooops :17[#1]
这个怎么处理啊

oops17.png (82.59 KB, 下载次数: 24)

oops17.png

论坛徽章:
0
2 [报告]
发表于 2013-04-16 12:54 |只看该作者
很明显的空指针错误,在module_init中访问了一个指向NULL的数据结构中偏移量为0xC的成员。

论坛徽章:
0
3 [报告]
发表于 2013-04-18 02:55 |只看该作者
本帖最后由 ch81 于 2013-04-18 02:55 编辑

我精简了所有代码 只剩下这些 还是出错 我无语了 哥们帮忙看看
#include <linux/init.h>
#include <linux/module.h>

static int __init hello_init(void)
{
        printk("hello world \n");
        return 0;
}

static void __exit hello_exit(void)
{
        printk("Goodbye,cruel world \n");
}

module_init(hello_init);
module_exit(hello_exit);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("chang hao");
MODULE_DESCRIPTION("test module");

//***************Makefile**********************
obj-m := test_module.o
KDIR  := /opt/linux-3.1_TQ2416
PWD   := $(shell pwd)  
all:
        make -C $(KDIR) M=$(PWD) modules
clean:
        make -C $(KDIR) M=$(PWD) modules clean
        rm -f *.ko *.o

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP