LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 11-07-2006, 09:40 PM   #1
xuanadoo
LQ Newbie
 
Registered: Sep 2006
Posts: 3

Rep: Reputation: 0
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.
 
  


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
program console output using C xrado Programming 5 04-04-2005 03:48 PM
noob needs help with console output (c++) shadow.blue Programming 7 04-19-2004 06:24 PM
output of printk can NOT be found in /var/log/messages linshu Linux - Software 1 02-13-2004 10:06 AM
Console output to X? dcm1878 Linux - Software 4 04-23-2003 09:07 PM
Long console output Loke Linux - Newbie 1 02-26-2003 07:35 AM


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

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