<<>> <> <> <<>> CedarConsole PCEDAR 2.0 % CedarConsole Copy UNIX /dev/console to Feedback Brent Welch Ó Copyright 1990 Xerox Corporation. All rights reserved. Abstract: CedarConsole is a small package that diverts UNIX system error messages to the Feedback package. It is intended for use in RawViewers, although it can run just fine in X11Viewers, too. Created by: Brent Welch Maintained by: Brent Welch Keywords: /dev/console, UNIX, Feedback XEROX Xerox Corporation Palo Alto Research Center 3333 Coyote Hill Road Palo Alto, California 94304 1. Introduction The CedarConsole package arranges for UNIX error messages to be diverted to the Feedback package. This includes any messages generated by kernel printfs, as well as anything else written to /dev/console. If these messages are not diverted then they go to the raw physical console, and this can trash the display if it also being used for RawViewers. The diversion is controlled by two procedures in the interface CedarConsole.Start[] and CedarConsole.Stop[]. The primary client of CedarConsole is RawViewers. RawViewers is careful to stop the diversion of /dev/console when it releases control of the screen. This is important because the diversion steals the I/O stream from the Commander that lives beneath RawViewers. If the diversion is not stopped then there is no way to communicate with this Commander, e.g. to type QuitWorld or RawViewers. The diversion is achieved by opening a UNIX psuedo terminal pair and using the TIOCCONS ioctl() to inform the kernel that this pseudo-terminal should be the console. CedarConsole.Stop[] closes the pseudo-terminal and the console reverts to the physical one. Console Command A Console command is registerd with the Commander for manual control of the diversion. % Console on -- Turns on diversion % Console off -- Turns off diversion