Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-07-2013, 12:48 PM   #1
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:
make -C /lib/modules/`uname -r`/build M=$PWD modules

The error message obtained is as follows

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...
*** 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.

#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_AUTHOR("Arun Kumar");
Old 08-08-2013, 05:30 PM   #2
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
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
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):
Makefile : obj-m := Hello_world.0
Are you sure your spelling is correct (Hello_world.o)?


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 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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:54 AM.

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