天嵌 ARM开发社区

 找回密码
 注册
查看: 2652|回复: 3

Oops :17 错误求解

[复制链接]
ch81 发表于 2013-4-18 02:47:24 | 显示全部楼层 |阅读模式
本帖最后由 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

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
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
确认下编译器是不是一样的。内核与模块

板上 /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-
看下
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号 )

GMT+8, 2024-5-24 22:37 , Processed in 1.046875 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表