ch81 发表于 2013-04-16 11:43

Ooops:17 错误 求解

arm-linux-gcc交叉编译了个驱动,加载了模块报错,如下:
unable to handle kernel NULL dereference at virtual address 000000c
Internal error : Ooops :17[#1]
这个怎么处理啊

ShadowStar 发表于 2013-04-16 12:54

很明显的空指针错误,在module_init中访问了一个指向NULL的数据结构中偏移量为0xC的成员。

ch81 发表于 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

页: [1]
查看完整版本: Ooops:17 错误 求解