Re: Printing the messages through printk while using Xwindows.

From: Russell King (rmk@arm.linux.org.uk)
Date: Fri Jul 28 2000 - 13:45:41 EST


Richard B. Johnson writes:
> This is a wee bit better because it will compile and run ;)
>
> 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);
> }

And probably oops. Doesn't X disassociate itself from the tty,
so current->tty could well be NULL. Also, Who's to say that
"current" is the X server?

Note also that this will write in "text" mode onto a graphics
mode framebuffer, which won't be very visible.

Probably the best way of seeing the kernel messages is to either
use a serial console, or failing that kill klogd and use
cat /proc/kmsg to display them in an xterm.
   _____
  |_____| ------------------------------------------------- ---+---+-
  | | Russell King rmk@arm.linux.org.uk --- ---
  | | | | http://www.arm.linux.org.uk/~rmk/aboutme.html / / |
  | +-+-+ --- -+-
  / | THE developer of ARM Linux |+| /|\
 / | | | --- |
    +-+-+ ------------------------------------------------- /\\\ |

-
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