TQ3358 编写的内核模块 求助MAKEFILE !!!
大虾们你们好:我自己在交叉编译环境里想编译这个模块儿 不会写makefile!帮我提供个简单的能编译生成.ko的makefile 这个.c的文件名为hello.c
我想编译生成的.ko直接insmod 一下 不想在内核里嵌入!
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/init.h>
MODULE_LICENSE("GPL");
static int __init hello_init(void)
{
printk("<1>\n hello,guoxiao!\n");
printk("<1>\n this is first driver test\n\n");
return 0;
}
static void __exit hello_exit(void)
{
printk("<1>\n exit!\n");
printk("<1>\n goodbye guoxiao69!\n\n");
}
module_init(hello_init);
module_exit(hello_exit);
还有一个问题是 u-boot下一直不能用TFTP服务器更新系统!帖子链接为:
http://www.armbbs.net/forum.php?mod=viewthread&tid=18160&extra=
手册中有教如何添加自己的驱动的,按你的意思是想编绎成模块,你可以加在配置单中然后配置成M即可。 http://www.armbbs.net/forum.php?mod=viewthread&tid=18380&highlight=make
论坛有很多相关的帖子的找下看下吧 大虾 我这个不能单独编译生成模块儿 然后直接装在模块儿不行吗?非得要重新编译内核模块儿吗? 这个问题已解决!谢谢大虾们!
页:
[1]