freebsd-dev/sys
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
..
amd64 Adjust the handling the various timer frequencies when using the lapic 2008-08-23 12:35:43 +00:00
arm Whitespace nit. 2008-08-23 23:35:08 +00:00
boot cosmetic changes and style fixes 2008-08-22 20:28:19 +00:00
bsm Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
cam SCSI_DELAY is specified in milliseconds, not seconds. 2008-08-16 21:26:58 +00:00
cddl Add MIPS support. 2008-08-23 04:58:11 +00:00
compat Add comments on NOARGS, NODEF, and NOPROTO. 2008-08-21 22:57:31 +00:00
conf Add a very simple dpms(4) driver that uses the VESA BIOS DPMS calls to 2008-08-23 21:00:40 +00:00
contrib Commit step 1 of the vimage project, (network stack) 2008-08-17 23:27:27 +00:00
crypto Simplify session selection/allocation. 2008-08-09 20:01:01 +00:00
ddb Add a missing include which was erroneusly left out from the previous 2008-08-18 16:51:44 +00:00
dev Make syscons(4) use ttyv0 instead of consolectl as its primary window. 2008-08-24 19:50:57 +00:00
fs Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
gdb Commit SYSINIT() ;-adding patch missed in previous pass. 2008-03-16 13:02:04 +00:00
geom Commit step 1 of the vimage project, (network stack) 2008-08-17 23:27:27 +00:00
gnu - Disallow XFS mounting in write mode. The write support never worked really 2008-07-21 23:01:09 +00:00
i386 Add a very simple dpms(4) driver that uses the VESA BIOS DPMS calls to 2008-08-23 21:00:40 +00:00
ia64 Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
isa MFp4 (my newcard tree): 2008-08-24 07:40:14 +00:00
kern Allow the user to suppress the rate-limited pty(4) warning. 2008-08-23 16:03:00 +00:00
libkern Add strcspn to libkern for use by xenbus routines. Will add to build 2008-08-15 04:07:22 +00:00
mips White space nit. 2008-08-23 23:44:45 +00:00
modules Add a very simple dpms(4) driver that uses the VESA BIOS DPMS calls to 2008-08-23 21:00:40 +00:00
net Make the checks for ptp interfaces in ifa_ifwithdstaddr() and 2008-08-24 11:03:43 +00:00
net80211 Verify that the WPA flags set are actually compatible with the 2008-08-09 05:46:01 +00:00
netatalk Remove NETISR_MPSAFE, which allows specific netisr handlers to be directly 2008-07-04 00:21:38 +00:00
netgraph A bunch of formatting fixes brough to light by, or created by the Vimage commit 2008-08-20 01:05:56 +00:00
netinet Make the kernel compile with SCTP and SCTP_DEBUG but 2008-08-24 18:29:22 +00:00
netinet6 Fix some of the formatting fixes.. It's amazing how some thing stand out 2008-08-20 01:24:55 +00:00
netipsec Commit step 1 of the vimage project, (network stack) 2008-08-17 23:27:27 +00:00
netipx Begin the sysctl descriptions with a capital letter. 2008-07-25 23:54:07 +00:00
netnatm Remove NETISR_MPSAFE, which allows specific netisr handlers to be directly 2008-07-04 00:21:38 +00:00
netncp lockmgrs need to be released before to be destroyed and draining doesn't 2008-03-30 18:16:33 +00:00
netsmb Really, smb_iod_main() is not totally MPSAFE, so just acquire and drop 2008-03-27 01:23:59 +00:00
nfs Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT. 2008-03-25 09:39:02 +00:00
nfs4client Move the NFS/RPC code away from lbolt. 2008-07-22 21:27:22 +00:00
nfsclient Commit step 1 of the vimage project, (network stack) 2008-08-17 23:27:27 +00:00
nfsserver Remove spls from NFS server setup call; expand receive socket buffer 2008-06-30 20:43:06 +00:00
nlm Fix an interop issue with Linux: If you do nothing but TCP 2008-08-13 12:03:31 +00:00
opencrypto Make ftruncate a 'struct file' operation rather than a vnode operation. 2008-01-07 20:05:19 +00:00
pc98 Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
pccard
pci Move wb driver from sys/pci to sys/dev/wb. 2008-08-14 21:26:29 +00:00
powerpc Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
rpc Rename the static M_RPC defined here to M_RPCCLNT, since a global M_RPC 2008-08-18 12:11:47 +00:00
security Use sbuf_putc instead of sbuf_cat. This makes more sense, since we are 2008-08-24 03:12:17 +00:00
sparc64 Announce the speed of the PCI bus for informational purpose. 2008-08-24 16:22:04 +00:00
sun4v Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
sys Minor style nits. 2008-08-23 01:20:36 +00:00
tools Introduce a standalone shell script for embedding MFS image. 2008-02-05 10:46:30 +00:00
ufs Put the relocked variable from the r182111 into the #ifdef QUOTA braces 2008-08-24 19:06:19 +00:00
vm Remove unused variable nosleepwithlocks. 2008-08-23 12:40:07 +00:00
xdr Add the new kernel-mode NFS Lock Manager. To use it instead of the 2008-03-26 15:23:12 +00:00
xen - add more debug cruft to xenbus 2008-08-20 09:20:12 +00:00
Makefile Improve the glimpse target: don't index .svn and compile directories. 2008-08-15 14:11:30 +00:00