Driver porting: hello world
Driver porting: hello world
Posted Apr 25, 2006 11:48 UTC (Tue) by SAturn (guest, #37343)Parent article: Driver porting: hello world
Hi. I'm trying to make a module under kernel 2.6.11.4 with the source:
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
static int hello_init(void)
{
printk( "<1>Hello World 1.\n" );
return 0;
}
static void hello_exit(void)
{
printk( KERN_ALERT "Goodbye 1.\n" );
}
module_init(hello_init);
module_exit(hello_exit);
MODULE_LICENSE("Dual BSD/GPL");
// end of source
the Makefile is
ifneq ($ (KERNELRELEASE), )
obj-m := mod1.o
else
KDIR := /lib/modules/$( shell uname -r)/build
PwD := $(shell pwd )
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
endif
# end of Makefile
And executing a command like:
make -C /usr/src/linux SUBDIRS=$PWD modules
I get a response:
make: Entering directory `/usr/src/linux-2.6.11.4-20a'
WARNING: Symbol version dump /usr/src/linux-2.6.11.4-20a/Module.symvers is missing; modules will have no modversions.
Building modules, stage 2.
MODPOST
/bin/sh: scripts/mod/modpost: No such file or directory
make[1]: *** [__modpost] Error 127
make: *** [modules] Error 2
make: Leaving directory `/usr/src/linux-2.6.11.4-20a'
What's the problem? And what should I do? Help me please.
