kvorion
September 10th, 2007, 07:05 PM
I am trying to compile my first hello world kernel module. I realized that I did not have the linux kernel source, so I downloaded it.
#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"); }
The problem is that gcc is not able to find linux/module.h file inside /usr/include/iinux folder (which I believe is the default path). How do I like gcc to the file inside the /usr/src/linux-source-2.6.15-2.6.15/include/linux folder where the file actually is? (I created this folder by extracting from the source archive that I downloaded). Where should I extract this so that gcc can actually find it?
#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"); }
The problem is that gcc is not able to find linux/module.h file inside /usr/include/iinux folder (which I believe is the default path). How do I like gcc to the file inside the /usr/src/linux-source-2.6.15-2.6.15/include/linux folder where the file actually is? (I created this folder by extracting from the source archive that I downloaded). Where should I extract this so that gcc can actually find it?