Re: Printing the messages through printk while using Xwindows.

From: Tigran Aivazian (tigran@veritas.com)
Date: Fri Jul 28 2000 - 11:46:45 EST


On Fri, 28 Jul 2000, Jesse Pollard wrote:

>
> > Hi,
> > I have developed a driver in which I use messages to be printed for =
> > debugging. When using X Windows terminal I am not able to view the =
> > messages, while I can see them when using a console. Can I have a =
> > console window in X Windows where I can view the printed messages.
>
> Have you tried running the "xconsole" utility? It is supposed to redirect
> the /dev/console messages to the xconsole window, and I assume it still
> works.
>

You can use process' current->tty (if not NULL) and call the
tty->driver.write() routine directly.

This is covered in Linux Kernel Module Programming Guide (see
Coriolis, Linux Programming White Papers, page 288). The idea goes like
this:

print_string(char *str)
{
   struct tty_struct *tty = current->tty;

   (*tty->driver).write(tty, 0, str, strlen(str));
   (*tty->driver).write(tty, 0, "\015\012", 2);
}

How about this one?

Regards,
Tigran

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 31 2000 - 21:00:27 EST