lkml.org 
[lkml]   [2009]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
Subjectbuilding custom module on 2.6.28 fails
From
Hi everyone,

I tried to compile build the following sample kernel module on 2.6.28 :

______________________________________________________________________
#include <linux/module.h>
/* Defines the license for this LKM */
MODULE_LICENSE("GPL");
/* Init function called on module entry */

int my_module_init( void )
{
printk(KERN_INFO "my_module_init called. Module is now loaded.\n");
return 0;
}

/* Cleanup function called on module exit */
void my_module_cleanup( void )
{
printk(KERN_INFO "my_module_cleanup called. Module is now unloaded.\n");
return;
}

/* Declare entry and exit functions */
module_init( my_module_init );
module_exit( my_module_cleanup );
____________________________________________________________________

but it fails with the following error :

_____________________________________________________________________
make -C /lib/modules/`uname -r`/build
SUBDIRS=/home/satish/prog/kernel/modules modules
make[1]: Entering directory `/usr/src/kernels/linux-2.6.28'
CC [M] /home/satish/prog/kernel/modules/simple-mod.o
In file included from include/linux/gfp.h:4,
from include/linux/kmod.h:22,
from include/linux/module.h:13,
from /home/satish/prog/kernel/modules/simple-mod.c:1:
include/linux/mmzone.h:18:26: error: linux/bounds.h: No such file or directory
include/linux/mmzone.h:256:5: warning: "MAX_NR_ZONES" is not defined
In file included from include/linux/gfp.h:4,
from include/linux/kmod.h:22,
from include/linux/module.h:13,
from /home/satish/prog/kernel/modules/simple-mod.c:1:
include/linux/mmzone.h:277: error: 'MAX_NR_ZONES' undeclared here (not
in a function)
make[2]: *** [/home/satish/prog/kernel/modules/simple-mod.o] Error 1
make[1]: *** [_module_/home/satish/prog/kernel/modules] Error 2
make[1]: Leaving directory `/usr/src/kernels/linux-2.6.28'
make: *** [all] Error 2
__________________________________________________________________

any hints what could be wrong ?


Thanks
Satish

--
http://satish.playdrupal.com


\
 
 \ /
  Last update: 2009-01-25 06:01    [W:0.051 / U:0.920 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site