freebsd-nq/sys/dev/syscons
Ed Schouten 537de51435 Make syscons(4) use ttyv0 instead of consolectl as its primary window.
When I was hacking on uart(4) to make it work with the MPSAFE TTY layer,
I noticed there was a difference between the way syscons and uart work
with respect to consoles:

- The uart(4) driver sets cn_name to the corresponding ttyu%r node,
  which means init(8) (which opens /dev/console) will have its output
  redirected to /dev/ttyu%r. After /etc/rc is done, it can spawn a getty
  on that device node as well.

- Syscons used a little different approach. Apart from the /dev/ttyv%r
  nodes, it creates a /dev/consolectl node. This device node is used by
  moused and others to deliver their data, but for some reason it also
  acts as a TTY, which shares its stat structure with ttyv0. This device
  node is used as a console (run conscontrol).

There are a couple advantages of this approach:

- Because we use two different TTY's to represent the 0th syscons
  window, we allocate two sets of TTY buffers. Even if you don't use
  /dev/consolectl after the system has booted (systems that don't run
  moused), it seems the buffers are still allocated.

- We have to apply an evil hack to redirect input to /dev/consolectl.
  Because each window (stat) is associated not associated with one TTY,
  syscons solves this by redirecting all input to closed TTY's to
  consolectl.

  This means that opening /dev/ttyv0 while in single user mode will
  probably cause strange things to happen with respect to keyboard input
  redirection.

The first patch that I discussed with philip@ turned consolectl into a
symlink to ttyv0, but this was not a good idea, because in theory we
would want consolectl to be a simple device node, which contains all the
`privileged' ioctl()'s. Apart from that, it didn't work, because each
time /dev/ttyv0 got revoked, moused also lost its descriptor to deliver
input, which meant you had to plug out/in your mouse to make it work
again. This version just leaves the consolectl device the way it is. It
can still be used to write output to ttyv0, but it can no longer receive
any input.

In my opinion this patch is not a complete solution, but it's already a
step in the good direction. It would allow us to turn consolectl into a
special (non-TTY) device node in the far future. It shaves off 15 KB of
wasted TTY buffer space.

Discussed with:	philip
2008-08-24 19:50:57 +00:00
..
apm APM was calling the suspend process from a timeout. This meant that 2006-05-25 23:06:38 +00:00
blank Replace explicit calls to video methods with their respective variants 2007-12-29 23:26:59 +00:00
daemon Commit step 1 of the vimage project, (network stack) 2008-08-17 23:27:27 +00:00
dragon Replace explicit calls to video methods with their respective variants 2007-12-29 23:26:59 +00:00
fade Replace explicit calls to video methods with their respective variants 2007-12-29 23:26:59 +00:00
fire Replace explicit calls to video methods with their respective variants 2007-12-29 23:26:59 +00:00
green Replace explicit calls to video methods with their respective variants 2007-12-29 23:26:59 +00:00
logo Replace explicit calls to video methods with their respective variants 2007-12-29 23:26:59 +00:00
rain Replace explicit calls to video methods with their respective variants 2007-12-29 23:26:59 +00:00
snake Replace explicit calls to video methods with their respective variants 2007-12-29 23:26:59 +00:00
star Replace explicit calls to video methods with their respective variants 2007-12-29 23:26:59 +00:00
warp Replace explicit calls to video methods with their respective variants 2007-12-29 23:26:59 +00:00
scgfbrndr.c Replace explicit calls to video methods with their respective variants 2007-12-29 23:26:59 +00:00
schistory.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
scmouse.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
scterm-dumb.c Fix -Wundef. 2005-12-04 02:12:43 +00:00
scterm-sc.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
scterm.c
sctermvar.h
scvesactl.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
scvgarndr.c Replace explicit calls to video methods with their respective variants 2007-12-29 23:26:59 +00:00
scvidctl.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
scvtb.c
syscons.c Make syscons(4) use ttyv0 instead of consolectl as its primary window. 2008-08-24 19:50:57 +00:00
syscons.h Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
sysmouse.c Make sysmouse(4) use its own locks, instead of using Giant. 2008-08-24 15:20:44 +00:00