kernel progarmmer's(module compiletion problem)==> full detail<==
==> i try to compile this module code form root password
=========
hello.c
=========
/* hello.c - The simplest kernel module.
*/
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_ALERT */
#if CONFIG_MODVERSIONS==1
#define MODVERSIONS
#include <linux/modversions.h>
#endif
int init_module(void)
{
printk("Hello world 1.\n");
// A non 0 return means init_module failed; module can't be loaded.
return 0;
}
void cleanup_module(void)
{
printk("Goodbye world 1.\n");
}
==>for compiling this module i use a bash file that contain's
==========
compiling
==========
hello.o: hello.c /usr/include/linux/version.h
gcc -Wall -DMODULE -D__KERNEL__ -DLINUX -c hello.c
==> but these error's are come
================
error i
================
hello.o:: command not found
In file included from hello.c:3:
/usr/include/linux/module.h:60: parse error before `atomic_t'
/usr/include/linux/module.h:60: warning: no semicolon at end of struct or union
/usr/include/linux/module.h:60: warning: no semicolon at end of struct or union
/usr/include/linux/module.h:62: parse error before `}'
/usr/include/linux/module.h:62: warning: data definition has no type or storage class
/usr/include/linux/module.h:91: parse error before `}'
hello.c: In function `init_module':
hello.c:11: warning: implicit declaration of function `printk'
==> i m using RH7.3 kernel 2.4.18.3 please help me for solving this problem
|