Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Are you inserting this "hello world" module into a remote kernel? If you are then the printk results are probably on the remote machine...Hope this Helps Gerard4143
I tried compiling your Hello world module and it worked...the message(s) appeared in the /var/log/messages file...kernel - 2.6.27.7-9-default x86_64 GNU/Linux
Code:
//#define MODULE
//#define LINUX
//#define __KERNEL__
#include <linux/module.h>
#include <linux/kernel.h>
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(void)
{
printk("<1> Hello Mod Init!\n");
return 0;
}
static void hello_exit(void)
{
printk(KERN_WARNING "Hello Mod Exit!\n");
}
module_init(hello_init);
module_exit(hello_exit);
Makefile
Code:
obj-m += test.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
A Newbie's Getting Started Guide to Linux
Learn the basics of the Linux operating systems. Get to know what it is all about, and familiarize yourself with the practical side. Basically, if you're a complete Linux newbie and looking for a quick and easy guide to get you started this is it. subscribe
Open Source Security Myths Dispelled Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization subscribe
InformationWeek InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology. subscribe