Seeing kernel messages on multiple VGA and serial consoles - Unix

This is a discussion on Seeing kernel messages on multiple VGA and serial consoles - Unix ; [ X-posted to comp.unix.programmer, comp.os.linux.development.system ] Hello, I've compiled a Linux 2.6.22 kernel with VGA console support and serial console support. /boot/grub/menu.lst contains the following relevant lines: serial --unit=0 --speed=57600 --word=8 --parity=no --stop=1 terminal --timeout=2 console serial [...] kernel /boot/bzImage ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Seeing kernel messages on multiple VGA and serial consoles

  1. Seeing kernel messages on multiple VGA and serial consoles

    [ X-posted to comp.unix.programmer, comp.os.linux.development.system ]

    Hello,

    I've compiled a Linux 2.6.22 kernel with VGA console support
    and serial console support.

    /boot/grub/menu.lst contains the following relevant lines:

    serial --unit=0 --speed=57600 --word=8 --parity=no --stop=1
    terminal --timeout=2 console serial
    [...]
    kernel /boot/bzImage ro root=/dev/hdc1 console=ttyS0,57600n8
    console=tty0 panic=3 apic=debug nmi_watchdog=0

    /etc/inittab contains the following lines:

    id:3:initdefault:
    si:S:sysinit:/etc/rc.d/rc.S
    rc:23:wait:/etc/rc.d/rc.M
    l0:0:wait:/etc/rc.d/rc.0
    l6:6:wait:/etc/rc.d/rc.6
    c1:23:respawn:/sbin/agetty -h ttyS0 57600 vt100

    I connected a screen to the system's VGA port, and I connected a NULL
    modem cable to one of the system's serial ports.

    When I boot the system, I see the output of the BIOS on both the VGA and
    serial consoles. Then I also see the kernel boot messages on both consoles.

    But then, once control is transferred to init, the messages from init
    only appear on the VGA console, not on the serial console.

    Once I can log in over ssh, if I run 'echo FOO > /dev/console' then
    'FOO' appears on the VGA console, but not on the serial console.

    Finally, when I call 'poweroff', the messages from init appear only on
    the VGA console. But the final messages from the kernel appear on both
    consoles.

    I suppose I didn't configure init properly? How do I make it work?

    Regards.

  2. Re: Seeing kernel messages on multiple VGA and serial consoles

    [ X-posted to comp.unix.programmer, comp.os.linux.development.system ]

    Spoon wrote:

    > I've compiled a Linux 2.6.22 kernel with VGA console support
    > and serial console support.
    >
    > /boot/grub/menu.lst contains the following relevant lines:
    >
    > serial --unit=0 --speed=57600 --word=8 --parity=no --stop=1
    > terminal --timeout=2 console serial
    > [...]
    > kernel /boot/bzImage ro root=/dev/hdc1 console=ttyS0,57600n8
    > console=tty0 panic=3 apic=debug nmi_watchdog=0
    >
    > /etc/inittab contains the following lines:
    >
    > id:3:initdefault:
    > si:S:sysinit:/etc/rc.d/rc.S
    > rc:23:wait:/etc/rc.d/rc.M
    > l0:0:wait:/etc/rc.d/rc.0
    > l6:6:wait:/etc/rc.d/rc.6
    > c1:23:respawn:/sbin/agetty -h ttyS0 57600 vt100
    >
    > I connected a screen to the system's VGA port, and I connected a NULL
    > modem cable to one of the system's serial ports.
    >
    > When I boot the system, I see the output of the BIOS on both the VGA and
    > serial consoles. Then I also see the kernel boot messages on both consoles.
    >
    > But then, once control is transferred to init, the messages from init
    > only appear on the VGA console, not on the serial console.
    >
    > Once I can log in over ssh, if I run 'echo FOO > /dev/console' then
    > 'FOO' appears on the VGA console, but not on the serial console.
    >
    > Finally, when I call 'poweroff', the messages from init appear only on
    > the VGA console. But the final messages from the kernel appear on both
    > consoles.
    >
    > I suppose I didn't configure init properly? How do I make it work?


    I forgot to mention I am using sysvinit-2.86
    http://freshmeat.net/projects/sysvinit/

    Regards.

  3. Re: Seeing kernel messages on multiple VGA and serial consoles

    Spoon writes:
    >[ X-posted to comp.unix.programmer, comp.os.linux.development.system ]
    >
    >Hello,
    >
    >I've compiled a Linux 2.6.22 kernel with VGA console support
    >and serial console support.
    >
    >/boot/grub/menu.lst contains the following relevant lines:
    >
    >serial --unit=0 --speed=57600 --word=8 --parity=no --stop=1
    >terminal --timeout=2 console serial
    >[...]
    >kernel /boot/bzImage ro root=/dev/hdc1 console=ttyS0,57600n8
    >console=tty0 panic=3 apic=debug nmi_watchdog=0
    >
    >/etc/inittab contains the following lines:
    >
    >id:3:initdefault:
    >si:S:sysinit:/etc/rc.d/rc.S
    >rc:23:wait:/etc/rc.d/rc.M
    >l0:0:wait:/etc/rc.d/rc.0
    >l6:6:wait:/etc/rc.d/rc.6
    >c1:23:respawn:/sbin/agetty -h ttyS0 57600 vt100
    >
    >I connected a screen to the system's VGA port, and I connected a NULL
    >modem cable to one of the system's serial ports.
    >
    >When I boot the system, I see the output of the BIOS on both the VGA and
    >serial consoles. Then I also see the kernel boot messages on both consoles.
    >
    >But then, once control is transferred to init, the messages from init
    >only appear on the VGA console, not on the serial console.
    >
    >Once I can log in over ssh, if I run 'echo FOO > /dev/console' then
    >'FOO' appears on the VGA console, but not on the serial console.
    >
    >Finally, when I call 'poweroff', the messages from init appear only on
    >the VGA console. But the final messages from the kernel appear on both
    >consoles.
    >
    >I suppose I didn't configure init properly? How do I make it work?
    >
    >Regards.


    I'm not sure you can get what you want. The system will take the
    last 'console=' entry on the kernel command line and link that to
    /dev/console. init(1) assigns /dev/console to stdin/out/err, and /dev/console
    has no "multiplexing" capability that would let it send to both /dev/ttyS0
    and /dev/tty0.

    If you want only on serial, put console=ttyS0 after console=tty0.

    scott

  4. Re: Seeing kernel messages on multiple VGA and serial consoles

    Scott Lurndal wrote:

    > Spoon wrote:
    >
    >> I've compiled a Linux 2.6.22 kernel with VGA console support
    >> and serial console support.
    >>
    >> /boot/grub/menu.lst contains the following relevant lines:
    >>
    >> serial --unit=0 --speed=57600 --word=8 --parity=no --stop=1
    >> terminal --timeout=2 console serial
    >> [...]
    >> kernel /boot/bzImage ro root=/dev/hdc1 console=ttyS0,57600n8
    >> console=tty0 panic=3 apic=debug nmi_watchdog=0
    >>
    >> /etc/inittab contains the following lines:
    >>
    >> id:3:initdefault:
    >> si:S:sysinit:/etc/rc.d/rc.S
    >> rc:23:wait:/etc/rc.d/rc.M
    >> l0:0:wait:/etc/rc.d/rc.0
    >> l6:6:wait:/etc/rc.d/rc.6
    >> c1:23:respawn:/sbin/agetty -h ttyS0 57600 vt100
    >>
    >> I connected a screen to the system's VGA port, and I connected a NULL
    >> modem cable to one of the system's serial ports.
    >>
    >> When I boot the system, I see the output of the BIOS on both the VGA and
    >> serial consoles. Then I also see the kernel boot messages on both consoles.
    >>
    >> But then, once control is transferred to init, the messages from init
    >> only appear on the VGA console, not on the serial console.
    >>
    >> Once I can log in over ssh, if I run 'echo FOO > /dev/console' then
    >> 'FOO' appears on the VGA console, but not on the serial console.
    >>
    >> Finally, when I call 'poweroff', the messages from init appear only on
    >> the VGA console. But the final messages from the kernel appear on both
    >> consoles.
    >>
    >> I suppose I didn't configure init properly? How do I make it work?

    >
    > I'm not sure you can get what you want. The system will take the
    > last 'console=' entry on the kernel command line and link that to
    > /dev/console. init(1) assigns /dev/console to stdin/out/err, and /dev/console
    > has no "multiplexing" capability that would let it send to both /dev/ttyS0
    > and /dev/tty0.
    >
    > If you want only on serial, put console=ttyS0 after console=tty0.


    Thanks for the reply.

    For completeness, Miquel van Smoorenburg (sysvinit maintainer) provided
    a similar answer:

    The kernel prints diagnostic output to all console devices you have
    configured on the kernel command line, but /dev/console, which is what
    userland (such as init) uses, can only be connected to *one* device (the
    last one specified). See linux-2.6.22/Documentation/serial-console.txt

    Regards.

+ Reply to Thread