LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-07-2013, 12:48 PM   #1
Arunkr24
LQ Newbie
 
Registered: Jul 2013
Location: Bangalore, KA, India
Distribution: Fedora 21
Posts: 3

Rep: Reputation: Disabled
Kernel Module - Compile Error on 3.9.10


well this is embarrasing...
i have written a simple Kernel module that write "hello world" to the kernel log buffer in its module_init call.

i tried compiling it using the kbuild system,but it failed in a strange manner..

This worked on a 2.6 and 3.0 but is not working in 3.9

The details are as follows.

Kernel Version:3.9.10

Makefile : obj-m := Hello_world.0

Command used:
Code:
make -C /lib/modules/`uname -r`/build M=$PWD modules

The error message obtained is as follows


Code:
make: Entering directory `/home/arun/temp/Linux_Build/linux-3.9.10'
make: *** No rule to make target `Device'.  Stop.
make: Leaving directory `/home/arun/temp/Linux_Build/linux-3.9.10'

i am not able to comprehend this...
Code:
*** No rule to make target `Device'.  Stop.
any ideas...
as i am pretty new to the kernel, i am not used to GOOD debugging techniques.


//-----------------------------------------------------------------------//
Code:
#include <linux/module.h>
#include <linux/init.h>


static int my_init(void)
{
        printk(KERN_ALERT "hello world\n");
        return 0;
}


static void my_exit(void)
{
        printk(KERN_ALERT "exit\n");
}


module_init(my_init);
module_exit(my_exit);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Arun Kumar");
MODULE_DESCRIPTION("Sample Module");
 
Old 08-08-2013, 05:30 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,568

Rep: Reputation: 164Reputation: 164
Are you sure you have all the headers for 3.9 installed correctly? Does it come from the packages or you have compiled it yourself?
 
Old 08-09-2013, 02:57 AM   #3
moo-cow
Member
 
Registered: Mar 2006
Distribution: Debian
Posts: 105

Rep: Reputation: 26
Have you configured and built your kernel source in linux-3.9.10? That's a prerequisite for compiling modules. (Having the kernel headers is not sufficient.)

And a really stupid suggestion (sorry):
Quote:
Makefile : obj-m := Hello_world.0
Are you sure your spelling is correct (Hello_world.o)?
 
  


Reply

Tags
kernel, modules


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Am I obliged to compile the kernel to compile a module? abd_bela Linux - Kernel 1 08-20-2011 01:17 PM
Compile and load kernel module automatically after boot? (Intel NIC module) touser Linux - Newbie 3 08-29-2009 09:45 PM
compile error of kernel module i.you Linux - Kernel 0 03-16-2007 03:33 AM
ati (8.16.20) : Module Installing | Error After Kernel Compile dfwcomputer Linux - Newbie 2 05-10-2006 09:03 PM
kernel compile: reiserfs module error geniarse Linux - Software 2 04-04-2004 06:37 PM


All times are GMT -5. The time now is 12:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration