lkml.org 
[lkml]   [2000]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Serial Console
On Tue, 5 Dec 2000, Steve Hill wrote:

> On Tue, 5 Dec 2000, PaulJakma wrote:
>
> > how? symlink to /dev/ttyS0, or with console=ttyS0 boot option?
>
> console=ttyS0
>
> Nope, /dev/console *does* block.

very weird.. the reason i replied to you, even though i have no direct
experience of serial console, was that last night i read a mail on the
linux-mips on almost exactly the same subject (serial console being
quite common on linux-mips), and IIRC Ralf Baechle explained how there
was a fundamental difference between tty and console precisely because
/dev/console might not be going anywhere.

Quoting from Ralf's email:

"/dev/console (as chardev 5/1) differs from another device in some important
ways:

- When opened by a process without controlling tty it will not become
a CTTY even if the NOCTTY flag is not set.

- It will never block but rather loose data. This may sound like a
disadvantage but it's actually very important for proper operation.
For example, if /dev/console'd block due to a serial console with
hardware handshaking enabled (DON'T) syslogd writing to it may also
block for an unbounded time and thus as soon as /dev/log is full all
services trying to log via syslog(3) will also freeze.

Syslogd actually tries to be clever about avoiding this from
happening but fails to handle one case correctly, so this is a real
world scenario.

- It uses different routines to access the console device than normal
write access to i.e. ttyS0."

perhaps linux-mips is just different? or i386 serial-console is
incorrect?

> ATM I've found a quick workaround - I
> use "stty -F /dev/console clocal -crtscts" to turn off the serial flow
> control at the stawrt of /etc/rc.d/rc.sysinit - this seems to work quite
> well... of course it doesn't stop some program turning flow control back
> on and ballsing it all up again :)

yukkk...

/dev/console having non-blocking semantics sounds much cleaner.

regards,

--paulj

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:51    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site