#include <linux/init.h>
#include <linux/module.h>
int __init hello_init(void)
{
printk("Hello World enter ++\n");
return 0;
}
void __exit hello_exit(void)
{
printk("Hello world exit --\n");
}
module_init(hello_init);
module_exit(hello_exit);
MODULE_AUTHOR("https://blog.csdn.net/qq_30155503");
MODULE_LICENSE("GPL v2");
Makefile内容如下:
obj-m := hello.o
KERNELDIR := /usr/src/linux-headers-3.2.0-23-generic-pae/
default:
make -C $(KERNELDIR) M=$(shell pwd) modules
install:
insmod hello.ko
uninstall:
rmmod hello.ko
clean:
make -C $(KERNELDIR) M=$(shell pwd) clean
执行make后,也生成了hello.ko
把hello.ko放到板子上后,执行insmod hello.ko失败
root@freescale /opt/QT4.8.6/apps$ insmod hello.ko
hello: disagrees about version of symbol module_layout
insmod: can't insert 'hello.ko': invalid module format
这是什么问题? root@freescale /opt/QT4.8.6/apps$ uname -r
3.14.38-6UL_ga-00063-g6a08c48
是不是内核版本的问题?3.14.38?3.2.0? 您可以从网上搜一下,比如http://lagignition.blog.163.com/blog/static/12873002320109135292479/ fcu1201设备 的4G模块,怎么实现发短信的功能? 这个我们没做过,不清楚怎么实现发短信功能,您自己探索一下吧
页:
1
[2]