ch81 发表于 2013-4-18 02:47:24

Oops :17 错误求解

本帖最后由 ch81 于 2013-4-18 02:49 编辑

搞了好几天了 没搞出来 麻烦问问怎么回事。我驱动加载不到板子上,insmod出错 我精简了全部代码,只剩下模块初始化和退出了 还是不对,各位大神有没有办法。最纳闷的是module link那行 我也没有什么rt3070啊。
源代码:#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

TQ-ZQL 发表于 2013-4-18 09:01:49

确认下编译器是不是一样的。内核与模块

ch81 发表于 2013-4-18 14:18:25

本帖最后由 ch81 于 2013-4-18 14:52 编辑

TQ-ZQL 发表于 2013-4-18 09:01 static/image/common/back.gif
确认下编译器是不是一样的。内核与模块
板上 /cat/proc/version得知 gcc 4.3.3
交叉编译环境 arm-linux-gcc-4.3.3
modinfo没有显示编译器型号,根据makefile 估计问题不大
应该不是编译器的问题。
还有什么可能呢?谢谢了

TQ-ZQL 发表于 2013-4-18 16:08:53

makefile改成
$(MAKE) -C $(KERNEL_DIR) M=$(PWD) modules ARCH=arm CROSS_COMPILE=arm-linux-
看下
页: [1]
查看完整版本: Oops :17 错误求解