照例写了个小小驱动测试程序帮忙看看!
/*test.c*/
#include <linux/module.h>
#include <linux/kernel.h>
#if CONFIG_MODVERSIONS==1
#include <linux/modversions.h>
#endif
int init_module()
{
printk("hello world!\n");
printd("I have running in a kernel mod@!!\n");
return 1;
}
int cleanup_module()
{
printk("I will shut down myself in kernel mod!\n");
return 0;
}
#a makefile for a module
CC=gcc
MODCFLAG= -Wall _DMODULE -D_KERNEL_ -DLinux test.o test.c /usr/include/linux/version.h
all:
$(CC) $(MODCFLAG)
#echo the module is complie completely
想请问:
1.make时就是通不过
2.这里的
#include <linux/module.h>
#include <linux/kernel.h>
#if CONFIG_MODVERSIONS==1
#include <linux/modversions.h>
#endif
能找到LINUX/MODULE.H吗?