These two files i have created in som efolder in home dir
1)hello-1.c
2)Makefile
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_INFO */
int init_module(void)
{
printk(KERN_INFO "Hello world 1.\n");
/*
* A non 0 return means init_module failed; module can't be loaded.
*/
return 0;
}
void cleanup_module(void)
{
printk(KERN_INFO "Goodbye world 1.\n");
}
---------------------------------------------------------------------------
Makefile:
obj−m += hello−1.o
all:
make −C /lib/modules/$(shell uname −r)/build M=$(PWD) modules
clean:
make −C /lib/modules/$(shell uname −r)/build M=$(PWD) clean
------------------------------------------------------------------------------
when i tried
$ make
make: Nothing to be done for `all'.
i tried to compile the c file directly with gcc.
it is not able to find kernel.h and module.h
then i gave the whole path . even then it is giving some library errors only .
How can i made this first step SUCCESSFULL.,
pls help me.. i am very much interested in learning kernel.
thanks & regards
-vinay