Driver porting: compiling external modules
Driver porting: compiling external modules
Posted Nov 9, 2004 10:16 UTC (Tue) by madhavi_srinivas (guest, #25933)In reply to: Driver porting: compiling external modules by kabbalah
Parent article: Driver porting: compiling external modules
Dear Kabbalah,
I am using SuSE 9.1 with 2.6.5-7.71 kernel. I have written small hello.c program here. It was working fine on my x86 machine.
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
MODULE_LICENSE("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);
For this the make file is as follows.
KDIR:=/lib/modules/$(shell uname -r)/build
obj-m:=hello.o
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
$(RM) .*.cmd *.o *.ko -r .tmp*
It was working fine under x86 machine with 2.6.5-7.71 kernel version with SuSE Linux.
Regards,
Srinivas G
