Re: /dev/console should it always be available?

From: Ricky Beam (jfbeam@bluetopia.net)
Date: Sat Feb 26 2000 - 14:25:03 EST

  • Next message: Ricky Beam: "Re: /proc/nzombies"

    On Sat, 26 Feb 2000, Mike Panetta wrote:
    >Should /dev/console always be available even if there is no
    >video card or keyboard on a machine? I keep getting these

    As a rule, yes. However, intel based systems tend to have serious problem
    without a video card in there. Sparcs and most alphas (at least the server
    hardware) uses the serial port as the console in the absence of a video
    console.

    I look at this as a serious flaw in the x86 hardware design, but seeing
    as x86 hardware is generally designed for "desktop" applications, I don't
    hold it against anyone. (BTW, have you ever tried running NT on a machine
    without a video device? It's not pretty unless you have a specialized
    version.)

    >messages in the logs about init not being able to open(/dev/console)
    >when I remove the video card from an embedded box I am working on.

    You can compile in serial console support and use "console=ttyS0"
    to set the console to the serial port. There were patches as far
    back as 1.2 for serial consoles on x86 hardware.

    >when I do this strange things start to happen like it cannot properly
    >umount /dev/hda5 (not root partition) on shutdown, and mingetty starts
    >to respawn to fast. This is related to a previous message I sent to the
    >list about a week ago reguarding the ext2 corruption messages without
    >a video card in the machine. Since then I have upgraded all the libraries
    >to be compilant with the rquirements in Documentation/Changes and the
    >corruption has gone away. Now I am stuck with unclean mounts and other
    >random occurences...

    Bad programs making bad assumptions... from a purist standpoint, one
    should check the return values from printf() and things [no one ever
    does, tho'. I've seen some programs peg the CPU because of it.]

    >What am I to do?

    Make sure /dev/console points to a useable device at all times. One could
    write a quicky program to check /dev/tty1, /dev/ttyS0, /dev/null, etc. and
    replace /dev/console with a symlink. (Of course, one could argue the kernel
    console driver should've done that at boot :-))

    I quote devices.txt:

      5 char Alternate TTY devices
                      0 = /dev/tty Current TTY device
                      1 = /dev/console System console
    ...

    That says to me the kernel should always have a valid /dev/console (even if
    it has to send it to /dev/null.)

    --Ricky

    PS: programs not having a stdin, stdout, and stderr is a nasty problem.

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



    This archive was generated by hypermail 2b29 : Sat Feb 26 2000 - 14:33:30 EST