LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't get printk output directed to console (https://www.linuxquestions.org/questions/linux-newbie-8/can%27t-get-printk-output-directed-to-console-499582/)

xuanadoo 11-07-2006 08:40 PM

Can't get printk output directed to console
 
This is a suse 9.1 / KDE 3.2.1 / 2.6.4-52-default kernel machine on which I'm attempting to learn about device drivers. I've logged in as root and compiled a hello.c file 'through' the /usr/src/linux/Makefile OK. Here's the source of hello.c:

/*************************************************************************/
/*
* $Id: hello.c,v 1.5 2004/10/26 03:32:21 corbet Exp $
*/
#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");

static int hello_init(void)
{
printk(KERN_ALERT "Hello, world\n");
return 0;
}

static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world\n");
}

module_init(hello_init);
module_exit(hello_exit);

/*************************************************************************/


The resulting hello.ko loads & unloads OK. The printk strings ("Hello, world\n", "Goodbye, cruel world\n") go to '/var/log/messages' and '/var/log/warn'.
Tried "setterm -msg on" and "echo 'n' > /proc/sys/kernel/prink", where 'n' = 0, 7, or 8, to try to direct the printk strings to the X and standard terminal console I open under KDE desktop. Here's a few things I tried in /etc/syslog.conf:

*.* root
and
*.* /dev/console


No luck with printk to console or x console resulting from insmod or rmmod. Any help appreciated.


All times are GMT -5. The time now is 08:29 PM.