LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Problem adding a simple kernel module in 2.6 (https://www.linuxquestions.org/questions/linux-software-2/problem-adding-a-simple-kernel-module-in-2-6-a-204788/)

palbox2003 07-14-2004 01:53 AM

Problem adding a simple kernel module in 2.6
 
Hello every1,
I am new to Linux and just installed Fedora Core 2. I tried adding a simple hello world module but I have been getting problems.
This is my hello.c program:

#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>

static int hello_init(void)
{
printk("<1> Hello, world\n");
return 0;
}

static void hello_exit(void)
{
printk("<1> Goodbye, cruel world\n");
}

module_init(hello_init);
module_exit(hello_exit);


The Makefile for this is:

ifneq ($(KERNELRELEASE),)
obj-m:= hello.o

else
KDIR:= /lib/modules/$(shell uname -r)/build
PWD:= $(shell pwd)

default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
endif



so the problem is once I type the command "make" at the shell prompt it gives the following message :

$ make: Nothing to be done for 'default'

I dont know whats the problem. Can any1 please help me out here. Your help will be appreciated.

Thanks
Hemal

J.W. 07-14-2004 03:09 AM

Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

http://www.linuxquestions.org/rules.php

The twin to this post can be found here Please post any replies to it as this thread has been flagged for closure. -- J.W.

palbox2003 07-14-2004 03:23 AM

Didnt know this, sorry.
People who can help me, can you please reply here :

http://www.linuxquestions.org/questi...hreadid=204806


All times are GMT -5. The time now is 02:06 AM.