Share your knowledge at the LQ Wiki.
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 07-03-2009, 07:24 AM   #1
LQ Newbie
Registered: Jun 2009
Posts: 2

Rep: Reputation: 0
not show output of simple module

hello i am newer here and also a new user for linux. actutally the problem is that i was writing a simple module for kernel 2.6.30. it does load and unload successfuly, but do not gives required output as it should show. can any body help me. code is so simple here it is
* hello−1.c − The simplest kernel module.
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_INFO */
int init_module(void)
printk(KERN_INFO "Hello world 1.\n");
* A non 0 return means init_module failed; module can't be loaded.
return 0;
void cleanup_module(void)
printk(KERN_INFO "Goodbye world 1.\n");

and here its Makefile

obj−m += hello−1.o
make −C /lib/modules/$(shell uname −r)/build M=$(PWD) modules
make −C /lib/modules/$(shell uname −r)/build M=$(PWD) clean

after loading it does not show any output, and should show Hello world!

Last edited by supernaturalyasir; 07-03-2009 at 07:26 AM.
Old 07-03-2009, 08:53 AM   #2
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 69
Let me make sure that you're expecting the output in the right place. The phrases "Hello world" and "Goodbye world" will not be printed in your terminal, they will be seen if you run the


command after you load or unload the module.


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
My fstab output doesn't show my slave!!!!! faby1321 Linux - Newbie 3 01-06-2008 12:16 PM
Is there a way to show the output of background process? nadavvin Linux - General 1 05-27-2007 11:21 PM
Can I show different output on the laptop screen and the external one? riwaJR Linux - Laptop and Netbook 9 11-14-2006 02:01 PM
how to show input and output of a program on the terminal divin Linux - Software 1 03-25-2005 12:19 AM
'Invalid module format' loading simple module on Suse Linux Professional 9.1 rocketdude Linux - Distributions 3 07-27-2004 11:40 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:05 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