kernel - Fix panic when X11 intercepts console (II)
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 5 Sep 2010 18:14:49 +0000 (11:14 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 5 Sep 2010 18:14:49 +0000 (11:14 -0700)
commit28d7e704b1a949e1b01af023e51b33e2f87ce626
treeba32f77fbe5e5a4020af6636d6a35cedef2fece8
parent137b3005941f794eb062a6701382d4620cb03f6a
kernel - Fix panic when X11 intercepts console (II)

* There is a secondary issue when the console is runs through a pty or
  other device and kqueue is used, the tty_token is not enough.

* Rewrite kputchar() and shift all constty intercepts over to their own
  kernel thread.  kputchar() will write to the dmesg buffer and will call
  cnputc() to write to the real console, and (for tprintf()) it will
  output a specified tty.  But it will no longer attempt to write to
  the console tty via the kprintf() path.

  Instead kputchar() simply wakes up the monitoring kernel thread and
  the monitoring kernel thread tracks and copies the dmesg buffer to
  the constty.

* This completely fixes the constty intercept issue.  'xconsole' now works
  perfectly.  Nothing can go wrong.  Go wrong.  Go wrong.
sys/kern/subr_prf.c