Driver porting: hello world
Driver porting: hello world
Posted Nov 9, 2004 12:32 UTC (Tue) by madhavi_srinivas (guest, #25933)Parent article: Driver porting: hello world
Dear all,
Here is the small hello.c program.
----------------------------------
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(void)
{
printk("Hello World!\n");
return 0;
}
static void hello_exit(void)
{
printk("Good bye!\n");
}
module_init(hello_init);
module_exit(hello_exit);
Here is the Makefile.
---------------------
#
# Makefile for hello.c file
#
KDIR:=/lib/modules/$(shell uname -r)/build
obj-m:=hello.o
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
$(RM) .*.cmd *.mod.c *.o *.ko -r .tmp*
#####################################################
It got compiled and inserted with out any errors, but dmesg says "unsupported module, tainting kernel".
System Configuration: x86, SuSE 9.1 with 2.6.5-7.71 kernel version.
What can I do to get rid of that message?
Thanks for any hints.
Regards,
Srinivas G
