hi,
i am trying to compile a below mentioned hello world program in linux-2.6.15-1.2054_FC5.It is not generating a hello.ko file.can anybody please help me out regarding this...
*****hello.c*****
#include
#include
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(void)
{
printk(KERN_ALERT "Hello, world\n");
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world\n");
}
module_init(hello_init);
module_exit(hello_exit);
*****Makefile*****
obj-m += hello.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
After giving a make command i am getting the output as:
*****make output****
make -C /lib/modules/2.6.15-1.2054_FC5/build M=/home/kum/dir modules
make: *** /lib/modules/2.6.15-1.2054_FC5/build: No such file or directory. Stop.
make: *** [all] Error 2
No such file or directory
"No such file or directory" means, that the file or directory you wanted to access did not exist. I see no simpler way to explain it than the message itself.
Example:
It's going to your kernel
It's going to your kernel source tree, which it can find from /lib/modules/`uname -r`/build, a symbolic link to where you built your kernel and ran make modules_install. Which you can tell from the Makefile you wrote.
From "2.6.15-1.2054_FC5," I'm guessing you're using a stock Linux kernel packaged in binary format in some Fedora Core package. Get the source.
If my guess is off and your source tree is just somewhere else, well, then just change your Makefile to pass the path to it to make's -C option.
but iam getting output:
but iam getting
output:
empty variable name stop
make ***[default] Error 2