public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Luca Falavigna <dktrkranz@gmail.com>
To: selvakumar nagendran <kernelselva@yahoo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Printk output on console
Date: Thu, 23 Dec 2004 12:04:11 +0100	[thread overview]
Message-ID: <41CAA62B.5030001@gmail.com> (raw)
In-Reply-To: <20041221094302.14478.qmail@web60608.mail.yahoo.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Selvakumar,
| While the
|> kernel is in execution where the output of all these
|> statements will go?

printk messages go to /proc/kmsg. You can read them using cat (e.g. cat
/proc/kmsg)
| can we redirect the output of
|> printk to our console?

There is another way to display kernel messages on a console: managing
ttys. Here is some code (taken from Peter Salzman's "The Linux Kernel
Module Programming Guide"):

static void print_string(char *str)
{
	struct tty_struct *tty;

#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,5) )
	tty = current->tty;
#else
	tty = current->signal->tty;
#endif

	if (!tty)
		return;

	((my_tty->driver)->write) (my_tty, 0, str, strlen(str));
	((my_tty->driver)->write) (my_tty, 0, "\015\012", 2);

}

Regards,

					Luca
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQEVAwUBQcqmKxZrwl7j21nOAQKKegf/ZvQxx4FlaObzfeRQYXr5rRyK3/CSwaMX
3vFxX4fGm1Bn0PkTM1NgmgGnDdWaRFyME4odSy6k5XjnyPwO1DqkDUqJarexaq2V
8wrFhQMe3duEhgxonhOSVn/n+/ZIkqxkLujgk5YNpI8jE2vgzw9SwgGb5ck4wEz3
KbqF7YDRPnPot2rud3RTVVzc1MOb0Ti0zDRMpmvyOxkjOL1eocYKJfo5ZalNBQZi
k6B7Akk4zWZ6iFjl2Ojxw4RrZVoUupPb2qbkGWp11ghStTur1Qpw5WJyQ25zQB40
8r8ERFfzE02dbE/jiUj5SucJ8DVIKY38KXcMTS64+vWtH9263GkuxQ==
=1DIB
-----END PGP SIGNATURE-----


  parent reply	other threads:[~2004-12-23 17:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-21  9:24 Printk output on console srinivas naga vutukuri
2004-12-21  9:43 ` selvakumar nagendran
2004-12-21 16:19   ` srinivas naga vutukuri
2004-12-23 11:04   ` Luca Falavigna [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-12-21  6:32 selvakumar nagendran
2004-12-27 10:34 ` Robin Jose

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41CAA62B.5030001@gmail.com \
    --to=dktrkranz@gmail.com \
    --cc=kernelselva@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox