LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-22-2005, 10:14 PM   #1
astronaut3000
LQ Newbie
 
Registered: Jul 2004
Distribution: Red Hat 9.0
Posts: 4

Rep: Reputation: 0
Linux Kernel Module Programming


Hello,

I've spend countless hours trying to create a simple hello.c module in linux 2.6.11-1.1369_FC4.

I read the tldp.org manual for it and it still doesn't work.

this is my hello.c:
#include <linux/module.h>
#include <linux/kernel.h>

int init_module(void)
{
printk(KERN_INFO "Hello World\n");
return 0;
}

void cleanup_module(void)
{
printk(KERN_INFO "Goodbye\n");
}



my makefile is:
obj-m += hello.o

all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

and when i try to 'make'
it tells me this.:

[root@localhost code]# make
make -C ../../../lib/modules/2.6.11-1.1369_FC4/build M=/home/user1/code modulesmake: *** ../../../lib/modules/2.6.11-1.1369_FC4/build: No such file or directory. Stop.
make: *** [all] Error 2
[root@localhost code]#


i check that directory with ls -al
and it shows me
[root@localhost 2.6.11-1.1369_FC4]# ls -al
total 100
drwxr-xr-x 3 root root 4096 Sep 22 20:09 .
drwxr-xr-x 5 root root 4096 Sep 22 22:41 ..
lrwxrwxrwx 1 root root 47 Jul 18 19:59 build -> ../../../usr/src/kernels/2.6.11-1.1369_FC4-i686
drwxr-xr-x 9 root root 4096 Jul 18 19:59 kernel
-rw-r--r-- 1 root root 45 Sep 22 20:09 modules.alias
-rw-r--r-- 1 root root 69 Sep 22 20:09 modules.ccwmap
-rw-r--r-- 1 root root 0 Sep 22 20:09 modules.dep
-rw-r--r-- 1 root root 73 Sep 22 20:09 modules.ieee1394map
-rw-r--r-- 1 root root 132 Sep 22 20:09 modules.inputmap
-rw-r--r-- 1 root root 81 Sep 22 20:09 modules.isapnpmap
-rw-r--r-- 1 root root 99 Sep 22 20:09 modules.pcimap
-rw-r--r-- 1 root root 49 Sep 22 20:09 modules.symbols
-rw-r--r-- 1 root root 189 Sep 22 20:09 modules.usbmap
lrwxrwxrwx 1 root root 5 Jul 18 19:59 source -> build

whats the problem here?
I'm completely confused

Thanks.
 
Old 09-23-2005, 02:02 AM   #2
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
You should also include the ouput of pwd when inside that directory.
 
  


Reply


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
Linux kernel debugging and Linux kernel module programming Igor007 Programming 2 08-13-2005 05:12 AM
Linux kernel debugging and Linux kernel module programming Igor007 Linux - Enterprise 3 08-12-2005 02:47 PM
Kernel module programming lokutas Programming 2 04-27-2004 02:26 AM
Linux kernel module programming(Signal and semaphore) eshwar_ind Programming 1 02-16-2004 12:10 PM
kernel module programming shellcode Programming 1 02-05-2004 11:43 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration