Where are my printk messages?
I'm using Slack 8.1 and succesfully compiled the helloworld module.
I can load the module with insmod, I can then see it loaded with lsmod and I can unload it with rmmod.
However, I never see my printk messages anywhere.
I tried doing a cat of /var/log/messages and /var/log/syslog but don't see my output.
I'm doing all this work via ssh if that makes any diference.
Chris
root@slack-8-1:/usr/src/hellomod# cat hello.c
#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);
root@slack-8-1:/usr/src/hellomod#
root@slack-8-1:/usr/src/hellomod# lsmod
Module Size Used by Not tainted
pcmcia_core 40896 0
ide-scsi 7456 0
eepro100 17264 1
root@slack-8-1:/usr/src/hellomod# insmod hello.o
root@slack-8-1:/usr/src/hellomod# lsmod
Module Size Used by Not tainted
hello 336 0 (unused)
pcmcia_core 40896 0
ide-scsi 7456 0
eepro100 17264 1
root@slack-8-1:/usr/src/hellomod# rmmod hello
root@slack-8-1:/usr/src/hellomod# ls mod
/bin/ls: mod: No such file or directory
root@slack-8-1:/usr/src/hellomod# lsmod
Module Size Used by Not tainted
pcmcia_core 40896 0
ide-scsi 7456 0
eepro100 17264 1
root@slack-8-1:/usr/src/hellomod#
Where are my printk messages?
Hi
you printk messages will be in /var/log/messages/dmesg
or just type
dmesg
at the end you will see you printk message