Sun 3 console question

Joseph Thomas jpt at uf.msc.umn.edu
Mon Mar 6 09:11:24 AEST 1989


Hey, this sounds like one we just fixed !! This had been driving us crazy
for sometime. Even renaming/removing /dev/fb et. al. didn't seem to help.
We could usually get the console back by killing the associated
shell/getty for the tty port. The cincher was when one of our users
reported getting the sysop's prompt on his tty. 

The culprit ( for us anyways ) was having a process steal the console via
a TIOCCONS ioctl control. Seems lots of window systems like doing this (
for valid reasons ) and several X-terms we'd be testing. You can verify
this next time it happens by adb'ing the kernel and looking at the value
of 'consdev'

[
	$ adb /vmunix /dev/kmem
	consdev/x
	$q
]

Valid values for using /dev/ttya or /dev/ttyb are 'c00' or 'c01'. These
are the major/minor device numbers of the current 'console'. [ On a system
with a frame buffer, this would be '0' with out a window system running,
and the device number of some pty with windows ( such as '1400' for
/dev/ttyp0 ) ] If it's not the real tty device, you should be able to
track down the owner of the pty and find out what he/she's running.

Using source, we added a check in sys/tty_pty.c to make sure that the
current console device is 0 ( the frame buffer ) before allowing the ioctl
to complete. If it's not, someone else has the console, or it shouldn't be
allowd to change. This seems to work with all our testing, we have yet to
put it into production during the next coule of weeks.

Joseph Thomas
Minnesota Supercomputer Center
jpt at msc.umn.edu
612/626-1888



More information about the Comp.sys.sun mailing list