Subject: Re: Indigo2 Kernel Boots!!!

From: Harald Koerfgen <[email-masked]>
Date: Fri, 01 Dec 2000 16:33:48 +0100 (CET)

On 01-Dec-00 Kevin D. Kissell wrote:
> 
>> > When the init process fires up, it opens /dev/console as the
>> > console output device.  A default SGI workstation installation
>> > file system will have /dev/console bound to the major/minor device
>> > node of the graphics display console.  If you want to run with a serial
>> > console, you must therefore change this to bind /dev/console
>> > to the serial port.  You can do this by doing an explicit mknod,
>> > or by linking to the appropriate serial port device node,
>> > which is usually /dev/ttyS0.
>>
>> Which both are wrong.  /dev/console should be a char device major 5, minor
> 1.
>> There is no need to change this ever except for very old kernels.  With
> 2.2
>> or 2.4 whenever people change /dev/console's major/minor it's usually
> painting
>> over some bug.
> 
> Having been through the exercise a dozen or more times with
> the SGI 2.2 kernel distributions for the Indy, I would be fascinated
> to know what bug I was painting over, and where the correct
> procedure was documented.

linux/Documentation/serial-console.txt

-- 
Regards,
Harald

---

From: Ralf Baechle <[email-masked]>
Date: Fri, 1 Dec 2000 18:53:21 +0100

> linux/Documentation/serial-console.txt

In addition let me add some word about what the term console actually is,
this commonly seems to cause confusition because the word is used with two
different meanings:

 1) The device on which you login in single user mode, that's usually some
    kind of serial device at ttyS0 or a virtual console, that is with keyboard
    and some kind of text terminal.
 2) The second is the device which the kernel prints all the printk messages
    and data sent to /dev/console to.  The two often often but not always
    refer to the same actual device.

/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.

The most common problem is that CONFIG_SERIAL_CONSOLE wasn't configured;
some drivers are simply buggy and don't properly register the console
on startup.  Dunno what the problem was in your case, Kevin.

  Ralf

---

From: Gordon McNutt <[email-masked]>
Date: Fri, 01 Dec 2000 11:15:50 -0700

This is a little off-topic, so if people complain I can take it offline. But
since this doesn't seem to be (very) common knowledge maybe others would like to
see it, as well.

>    CTTY even if the NOCTTY flag is not set.

What do you mean by "controlling tty"? And why is the distinction noted above
important? I assume it has something to do with keyboard input/screen output, but
perhaps you can clarify.

Thanks,

--Gordon

---

From: Ralf Baechle <[email-masked]>
Date: Sat, 2 Dec 2000 02:53:17 +0100

On Fri, Dec 01, 2000 at 11:15:50AM -0700, Gordon McNutt wrote:

> What do you mean by "controlling tty"?
> output, but perhaps you can clarify.

Controlling terminal is a fundamental UNIX term; you should check a good
UNIX book about it.  The glibc info pages also have some words about it.

> And why is the distinction noted above important? I assume it has something
> to do with keyboard input/screen

Reread my posting, it describes some of the differences in the behaviour
of for example /dev/console and /dev/ttyS0 even though both refer to the
same device.

That could be different.  The classic UNIX setup is sending /dev/console to
the printer on one serial and having the system's console terminal on
another.  Any arbitrary device combination would be possible.

  Ralf