resistantgnome
October 2nd, 2007, 02:46 PM
I tried my first driver code. Book said the code will compile and run under linux kernel version 2.0 to 2.4. I don't have an older kernel. I am using Ubuntu 7.04(Kernel 2.6.20-16-generic).
When I do this
gcc -c test.c
Code gives an error
test.c:2:26: error: linux/module.h: No such file or directory
#define MODULE
#include <linux/module.h>
int init_module(void)
{
printk("<1>Hello, world\n");
return 0;
}
void cleanup_module(void)
{
printk("<1>Goodbye cruel world\n");
}
Is there any way I can make this code work?
When I do this
gcc -c test.c
Code gives an error
test.c:2:26: error: linux/module.h: No such file or directory
#define MODULE
#include <linux/module.h>
int init_module(void)
{
printk("<1>Hello, world\n");
return 0;
}
void cleanup_module(void)
{
printk("<1>Goodbye cruel world\n");
}
Is there any way I can make this code work?