|
Home > Archive > Unix Programming > October 2007 > Seeing kernel messages on multiple VGA and serial consoles
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
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.
| |
|
| [ 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.
| |
| Scott Lurndal 2007-10-17, 1:34 am |
| Spoon <root@localhost> 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
| |
|
| Scott Lurndal wrote:
> Spoon wrote:
>
>
> 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.
|
|
|
|
|