hey guys i am newbie and am trying to compile the famous helloworld
program and i am using the following hello.c file and the make file
also i have given and i am getting the following errors i am trying
from one week pls help

hello.c
**************************************

#include
#include

static int hello_init(void) /* Loads a module in the kernel */
{
printk(KERN_ALERT"Hello kernel\n");
return 0;

}

static void hello_exit(void) /* Removes module from kernel */
{
printk(KERN_ALERT"GoodBye Kernel\n");

}

module_init(hello_init);
module_exit(hello_exit);

makefile
****************************

ifneq ($KERNELRELEASE),)

obj-m :=hello.o

else

KERNELDIR := /lib/modules/$(shell uname -r)/build

PWD := $(shell pwd)

default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

endif

%make hello
********************************
cc -c -o hello.o hello.c
hello.c:2:24: error: linux/init.h: No such file or directory
hello.c:3:26: error: linux/module.h: No such file or directory
hello.c: In function 'hello_init':
hello.c:7: error: 'KERN_ALERT' undeclared (first use in this function)
hello.c:7: error: (Each undeclared identifier is reported only once
hello.c:7: error: for each function it appears in.)
hello.c:7: error: expected ')' before string constant
hello.c: In function 'hello_exit':
hello.c:13: error: 'KERN_ALERT' undeclared (first use in this
function)
hello.c:13: error: expected ')' before string constant
hello.c: At top level:
hello.c:16: warning: data definition has no type or storage class
hello.c:16: warning: parameter names (without types) in function
declaration
hello.c:17: warning: data definition has no type or storage class
hello.c:17: warning: parameter names (without types) in function
declaration
make: *** [hello.o] Error 1