/dev/console buffering behavior
Hey guys, I've got a couple questions related to the /dev/console special file.
From what I've read online, it seems that /dev/console used to be a simple symlink to ttyS0, or whatever was passed to the kernel with the "console=" parameter. In recent kernels, /dev/console is managed directly by the kernel. Does anyone know the relevant files in the kernel source that deal with setting up/configuring /dev/console?
On the current systems I am working with, the kernel command line parameters in grub.conf look something like this:
kernel /vmlinuz ro root=/dev/md2 console=tty0 console=ttyS0,115200n8r
I have noticed that echoing text to /dev/console and /dev/ttyS0 does not always have the same effect. For one, it seems that writes to /dev/console ignore the "clocal" stty flag, but honor the "crtscts" flag. Second, if I have "co:2345:respawn:/sbin/agetty -h ttyS0 115200 vt100" such that agetty is running with flow control on, writes to /dev/console behave differently in this way:
* writes are buffered (looks like a ~4096 character buffer)
* once the buffer becomes full, writes block until CTS is asserted
Can anyone explain this behavior?
EDIT: I'm running CentOS 5.3 x64 BTW.
Last edited by jsjohns2; 10-20-2009 at 10:52 AM.