here is an example, anything wrong ?
//---------hello.c----------------
#include <linux/kernel.h>
#include <linux/module.h>
int init_module(void)
{
printk("hello world\n");
return 0;
}
void cleanup_module(void)
{
printk("bye\n");
}
//------end of hello.c-------
I compiled it with command:
gcc -I/usr/src/linux-2.6.0-test7/include -D_KERNEL_ -DMODULE -DKBUILD_MODNAME=hello -c hello.c
ant then I got may "undeclared" errors.
This is the first time for me to write kernel module on 2.6, and I even don't know how to generate a .ko file.