Hi
Even i am working on my first hello world program in modifying the kernel. I have just began to get familiarized with linux, so i dont have a lot of practice with the makefiles.
This is my kernel program
#define MODULE
#include <linux/module.h>
int init_module(void)
{
printk("hello\n");
return 0;
}
void cleanup_module(void)
{
printk("bbye\n");
}
I have been trying to search for the makefile to use for this.
If i run the program using the gcc command (as stated in the book - O Reilly)
#gcc -c hello.c
usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../crt1.o(.text+0x1

: In function `_start':
../sysdeps/i386/elf/start.S:77: undefined reference to `main'
/tmp/cc6tY8ap.o(.text+0xf): In function `init_module':
: undefined reference to `printk'
/tmp/cc6tY8ap.o(.text+0x2c): In function `cleanup_module':
: undefined reference to `printk'
collect2: ld returned 1 exit status
the linux i am using presently is 2.4.20-8
I have tried to search about this error and similar pots online, but couldnt find anything. Could someone please help me with this? Or if similar question has been asked before to post the link so that i can get my program working
thanks in advance
gagan