2001-07-30 14:55:06

by christophe barbé

[permalink] [raw]
Subject: serial console and kernel 2.4

I recently upgraded a linux box to the kernel 2.4.4 (from 2.2.18). This box
has no display and use the serial console. Since the upgrade I can see the
boot output on the remote console but I can't use the keyboard. Each time I
press a key, an interrupt is seen by the no-display machine but no char
appears in the console.
Today I've upgraded an another box to 2.4.7 with a similar setup and I've
the same problem.

Is there something that I'm missing ? (something new with the kernel 2.4
that is required for a serial console that was not required with the 2.2 ?)

Is sombody else experienciong the same problem ?

Christophe


--
Christophe Barb?
Software Engineer - [email protected]
Lineo France - Lineo High Availability Group
42-46, rue M?d?ric - 92110 Clichy - France
phone (33).1.41.40.02.12 - fax (33).1.41.40.02.01
http://www.lineo.com


2001-07-30 15:13:30

by Reto Baettig

[permalink] [raw]
Subject: Re: serial console and kernel 2.4

Hi!

I had the same problem and I attached you a patch how I'm working
around this problem.

Reto

--- drivers/char/serial.c.orig Thu May 3 09:29:00 2001
+++ drivers/char/serial.c Thu May 3 09:29:34 2001
@@ -1764,8 +1764,8 @@
/*
* !!! ignore all characters if CREAD is not set
*/
- if ((cflag & CREAD) == 0)
- info->ignore_status_mask |= UART_LSR_DR;
+// if ((cflag & CREAD) == 0)
+// info->ignore_status_mask |= UART_LSR_DR;
save_flags(flags); cli();
if (uart_config[info->state->type].flags & UART_STARTECH) {
serial_outp(info, UART_LCR, 0xBF);

>
> I recently upgraded a linux box to the kernel 2.4.4 (from 2.2.18). This box
> has no display and use the serial console. Since the upgrade I can see the
> boot output on the remote console but I can't use the keyboard. Each time I
> press a key, an interrupt is seen by the no-display machine but no char
> appears in the console.
> Today I've upgraded an another box to 2.4.7 with a similar setup and I've
> the same problem.
>
> Is there something that I'm missing ? (something new with the kernel 2.4
> that is required for a serial console that was not required with the 2.2 ?)
>
> Is sombody else experienciong the same problem ?
>
> Christophe
>
>
> --
> Christophe Barb?
> Software Engineer - [email protected]
> Lineo France - Lineo High Availability Group
> 42-46, rue M?d?ric - 92110 Clichy - France
> phone (33).1.41.40.02.12 - fax (33).1.41.40.02.01
> http://www.lineo.com
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

2001-07-30 15:20:49

by Steve Hill

[permalink] [raw]
Subject: Re: serial console and kernel 2.4

On Mon, 30 Jul 2001, christophe barb? wrote:

> Is there something that I'm missing ? (something new with the kernel 2.4
> that is required for a serial console that was not required with the 2.2 ?)

I've just started using 2.4.6 on both a Cobalt Qube 3 and Raq 4R (which
use serial consoles), and they seem to be fine... although if the console
isn't plugged in then it causes all sorts of problems so I've hacked
around the kernel to allow the console to point at null...

I'm just about to upgrade to 2.4.8-pre2 if it all works...

--

- Steve Hill
System Administrator Email: [email protected]
Navaho Technologies Ltd. Tel: +44-870-7034015

... Alcohol and calculus don't mix - Don't drink and derive! ...


2001-07-30 15:21:29

by James Bottomley

[permalink] [raw]
Subject: Re: serial console and kernel 2.4

> I recently upgraded a linux box to the kernel 2.4.4 (from 2.2.18).
> This box has no display and use the serial console. Since the upgrade
> I can see the boot output on the remote console but I can't use the
> keyboard. Each time I press a key, an interrupt is seen by the
> no-display machine but no char appears in the console. Today I've
> upgraded an another box to 2.4.7 with a similar setup and I've the
> same problem.

> Is there something that I'm missing ? (something new with the kernel
> 2.4 that is required for a serial console that was not required with
> the 2.2 ?)

I hate to send an email which says "it works for me", but it does (all the way
up to 2.4.7).

However, one of the things to remember about the serial console is that it is
primarily designed for *output*. If you see the boot messages, then it's
doing its job correctly. Things like kdb and sysrq can accept input from the
serial console, but usually only if something else (like getty) has opened it
first.

My setup (on RedHat 7.1) looks like this

In /etc/lilo.conf

# make lilo output to serial console
serial=0,9600n8

# for each kernel add this line
append="console=ttyS0,9600n8 console=tty0"

Note, the above append causes /dev/console to be /dev/tty0 (the virtual
console). If you want to see all the boot messages you need /dev/ttyS0 to be
/dev/console and you should reverse the two console statements in this line.

In /etc/inittab:

S:0123456:respawn:/sbin/mingetty --noclear ttyS0

With this setup I can activate sysrq and kdb from the serial console.

Note also that different distributions have different ways of handling the
system console; you might also have to disable the special distribution
handling on a non-RedHat system.

James Bottomley


2001-07-30 15:34:12

by christophe barbé

[permalink] [raw]
Subject: Re: serial console and kernel 2.4

Thank you very much.
It solves my problem.
I'm going to look in it to understand what is CREAD.
certainly a patch need to be proposed here.

Christophe

Le lun, 30 jui 2001 17:18:12, [email protected] a ?crit :
> Hi!
>
> I had the same problem and I attached you a patch how I'm working
> around this problem.
>
> Reto
>
> --- drivers/char/serial.c.orig Thu May 3 09:29:00 2001
> +++ drivers/char/serial.c Thu May 3 09:29:34 2001
> @@ -1764,8 +1764,8 @@
> /*
> * !!! ignore all characters if CREAD is not set
> */
> - if ((cflag & CREAD) == 0)
> - info->ignore_status_mask |= UART_LSR_DR;
> +// if ((cflag & CREAD) == 0)
> +// info->ignore_status_mask |= UART_LSR_DR;
> save_flags(flags); cli();
> if (uart_config[info->state->type].flags & UART_STARTECH) {
> serial_outp(info, UART_LCR, 0xBF);
>
> >
> > I recently upgraded a linux box to the kernel 2.4.4 (from 2.2.18). This
> box
> > has no display and use the serial console. Since the upgrade I can see
> the
> > boot output on the remote console but I can't use the keyboard. Each
> time I
> > press a key, an interrupt is seen by the no-display machine but no char
> > appears in the console.
> > Today I've upgraded an another box to 2.4.7 with a similar setup and
> I've
> > the same problem.
> >
> > Is there something that I'm missing ? (something new with the kernel
> 2.4
> > that is required for a serial console that was not required with the
> 2.2 ?)
> >
> > Is sombody else experienciong the same problem ?
> >
> > Christophe
> >
> >
> > --
> > Christophe Barb?
> > Software Engineer - [email protected]
> > Lineo France - Lineo High Availability Group
> > 42-46, rue M?d?ric - 92110 Clichy - France
> > phone (33).1.41.40.02.12 - fax (33).1.41.40.02.01
> > http://www.lineo.com
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel"
> in
> > the body of a message to [email protected]
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at http://www.tux.org/lkml/
> >
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel"
> in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
Christophe Barb?
Software Engineer - [email protected]
Lineo France - Lineo High Availability Group
42-46, rue M?d?ric - 92110 Clichy - France
phone (33).1.41.40.02.12 - fax (33).1.41.40.02.01
http://www.lineo.com

2001-07-30 15:37:29

by christophe barbé

[permalink] [raw]
Subject: Re: serial console and kernel 2.4

"it works for me" is better that no answer for me. So Thank you for your
answer.
Reto give me a solution : because of a flag all incomming char are ignored.
So now I need to find why this flag is ok for you and not for me.

Christophe


Le lun, 30 jui 2001 17:20:55, James Bottomley a ?crit :
> > I recently upgraded a linux box to the kernel 2.4.4 (from 2.2.18).
> > This box has no display and use the serial console. Since the upgrade
> > I can see the boot output on the remote console but I can't use the
> > keyboard. Each time I press a key, an interrupt is seen by the
> > no-display machine but no char appears in the console. Today I've
> > upgraded an another box to 2.4.7 with a similar setup and I've the
> > same problem.
>
> > Is there something that I'm missing ? (something new with the kernel
> > 2.4 that is required for a serial console that was not required with
> > the 2.2 ?)
>
> I hate to send an email which says "it works for me", but it does (all
> the way
> up to 2.4.7).
>
> However, one of the things to remember about the serial console is that
> it is
> primarily designed for *output*. If you see the boot messages, then it's
>
> doing its job correctly. Things like kdb and sysrq can accept input from
> the
> serial console, but usually only if something else (like getty) has
> opened it
> first.
>
> My setup (on RedHat 7.1) looks like this
>
> In /etc/lilo.conf
>
> # make lilo output to serial console
> serial=0,9600n8
>
> # for each kernel add this line
> append="console=ttyS0,9600n8 console=tty0"
>
> Note, the above append causes /dev/console to be /dev/tty0 (the virtual
> console). If you want to see all the boot messages you need /dev/ttyS0
> to be
> /dev/console and you should reverse the two console statements in this
> line.
>
> In /etc/inittab:
>
> S:0123456:respawn:/sbin/mingetty --noclear ttyS0
>
> With this setup I can activate sysrq and kdb from the serial console.
>
> Note also that different distributions have different ways of handling
> the
> system console; you might also have to disable the special distribution
> handling on a non-RedHat system.
>
> James Bottomley
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel"
> in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
Christophe Barb?
Software Engineer - [email protected]
Lineo France - Lineo High Availability Group
42-46, rue M?d?ric - 92110 Clichy - France
phone (33).1.41.40.02.12 - fax (33).1.41.40.02.01
http://www.lineo.com

2001-07-30 15:49:49

by Stuart MacDonald

[permalink] [raw]
Subject: Re: serial console and kernel 2.4

From: "christophe barb?" <[email protected]>
> "it works for me" is better that no answer for me. So Thank you for your
> answer.
> Reto give me a solution : because of a flag all incomming char are
ignored.
> So now I need to find why this flag is ok for you and not for me.

The patch breaks the correct operation of the serial driver.
CREAD is the flag that enables/disables the rx side of the serial
port. The kernel or whatever service is trying to use the console
doesn't set CREAD, so rxed (incoming) characters are ignored.

You need to find out why the CREAD handling isn't done properly.
This has come up a number of times on lkml recently; you should
be able to find an appropriate answer or pointer in the right
direction by checking the archives.

Patching the driver breaks the driver instead of fixing the problem.

..Stu


2001-07-30 16:21:42

by christophe barbé

[permalink] [raw]
Subject: Re: serial console and kernel 2.4

I fully agree with you that the patch is not correct and I'm sure that Reto
agree too.
I'm looking in the code to find the reason but it sounds not easy (termio
stuff ever scare me).
Do you remember a related thread ? with a correct solution ?

Christophe


Le lun, 30 jui 2001 17:53:28, Stuart MacDonald a ?crit :
> From: "christophe barb?" <[email protected]>
> > "it works for me" is better that no answer for me. So Thank you for
> your
> > answer.
> > Reto give me a solution : because of a flag all incomming char are
> ignored.
> > So now I need to find why this flag is ok for you and not for me.
>
> The patch breaks the correct operation of the serial driver.
> CREAD is the flag that enables/disables the rx side of the serial
> port. The kernel or whatever service is trying to use the console
> doesn't set CREAD, so rxed (incoming) characters are ignored.
>
> You need to find out why the CREAD handling isn't done properly.
> This has come up a number of times on lkml recently; you should
> be able to find an appropriate answer or pointer in the right
> direction by checking the archives.
>
> Patching the driver breaks the driver instead of fixing the problem.
>
> ..Stu
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel"
> in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
Christophe Barb?
Software Engineer - [email protected]
Lineo France - Lineo High Availability Group
42-46, rue M?d?ric - 92110 Clichy - France
phone (33).1.41.40.02.12 - fax (33).1.41.40.02.01
http://www.lineo.com

2001-07-30 16:55:04

by Chris Wedgwood

[permalink] [raw]
Subject: Re: serial console and kernel 2.4

On Mon, Jul 30, 2001 at 06:21:24PM +0200, christophe barb? wrote:

Do you remember a related thread ? with a correct solution ?

Upgrade init ?



--cw

(Using 2.4.x all over the place with serial console and no magic patches)

2001-07-30 20:37:17

by Tom Duffy

[permalink] [raw]
Subject: Re: serial console and kernel 2.4

On 31 Jul 2001 04:55:27 +1200, Chris Wedgwood wrote:
> On Mon, Jul 30, 2001 at 06:21:24PM +0200, christophe barb? wrote:
>
> Do you remember a related thread ? with a correct solution ?
>
> Upgrade init ?

to what? and which version is broken?

I am seeing a problem on an x86 machine <-> sparc64 machine (E3500) both
running linux. the sparc box has the latest debian woody and the x86 is
running the latest redhat 7.1. x86 is running 2.4.3+xfs and sparc64 is
running 2.4.7+vger.samba.org. I can type on the sparc and see output on
the x86, but not vice versa.

-tduffy

2001-07-30 20:44:37

by Fabrice Gautier

[permalink] [raw]
Subject: Re: serial console and kernel 2.4


On Mon, 30 Jul 2001 16:54:53 +0200
christophe barb? <[email protected]> wrote:

> I recently upgraded a linux box to the kernel 2.4.4 (from 2.2.18). This box
> has no display and use the serial console. Since the upgrade I can see the
> boot output on the remote console but I can't use the keyboard. Each time I
> press a key, an interrupt is seen by the no-display machine but no char
> appears in the console.
> Today I've upgraded an another box to 2.4.7 with a similar setup and I've
> the same problem.
>
> Is there something that I'm missing ? (something new with the kernel 2.4
> that is required for a serial console that was not required with the 2.2 ?)

It's probably a bug in your init.

I had the same, my init is busybox init, but maybe the sysv init has/had
the same problem.

Init have to set (or unset i don't remenber exactly) the CREAD flag when
opening the console in order to receive the input. Before 2.42 (or is it
2.4.3 ?) it seems that the kernel was not taking this flag into account
for anything.

The proposed fix for the kernel is a workaround.

The bug has been fixed in busybox (around v0.50 or v0.51).
(The guy working on busybox for lineo should be able to tell you. )

regards,

--
Fabrice Gautier <[email protected]>

2001-07-30 21:00:17

by Miquel van Smoorenburg

[permalink] [raw]
Subject: Re: serial console and kernel 2.4

In article <[email protected]>,
Fabrice Gautier <[email protected]> wrote:
>> Is there something that I'm missing ? (something new with the kernel 2.4
>> that is required for a serial console that was not required with the 2.2 ?)
>
>It's probably a bug in your init.
>I had the same, my init is busybox init, but maybe the sysv init has/had
>the same problem.

It has, was fixed in 2.80 which I put on
ftp.cistron.nl/pub/people/miquels/software/ a few days ago.

It's probably wise to wait for your vendor to ship a new sysvinit
package, or for all I know some vendors might have patched 2.78 already.

Mike.
--
"dselect has a user interface which scares small children"
-- Theodore Tso, on debian-devel

2001-07-30 21:41:07

by Chris Wedgwood

[permalink] [raw]
Subject: Re: serial console and kernel 2.4

On Mon, Jul 30, 2001 at 01:36:32PM -0700, Thomas Duffy wrote:

to what? and which version is broken?

No idea, whatever debian ships with.

The reason I use debian is 'things just work' --- presumably redhat
has an update for sysvinit, so just snarf the latest and see if that
helps.



--cw

2001-07-30 22:24:37

by Miquel van Smoorenburg

[permalink] [raw]
Subject: Re: serial console and kernel 2.4

In article <[email protected]>,
Chris Wedgwood <[email protected]> wrote:
>On Mon, Jul 30, 2001 at 01:36:32PM -0700, Thomas Duffy wrote:
>
> to what? and which version is broken?
>
>No idea, whatever debian ships with.
>
>The reason I use debian is 'things just work' --- presumably redhat
>has an update for sysvinit, so just snarf the latest and see if that
>helps.

sysvinit 2.80 is now in debian unstable, it fixes the CREAD bug.
It might take 1 or 2 days for the alpha/mips/etc autobuilders to
catch up and produce a .deb for those platforms.

Mike.
--
"dselect has a user interface which scares small children"
-- Theodore Tso, on debian-devel

2001-07-31 07:51:58

by christophe barbé

[permalink] [raw]
Subject: Re: serial console and kernel 2.4

On Debian/Sid, sysinit is uptodate as usual.
Unfortunately I've also to deal with RHbox.
In RedHat Rawhide the current version is SysVinit-2.78-18 and is patched
for the CREAD bug.
So If you have a RedHat box, update your SysInit package up to 2.78-18.

Thank you Miguel for your work (and for your fortune, I like it).

Christophe


Le mar, 31 jui 2001 00:24:16, Miquel van Smoorenburg a ?crit :
> In article <[email protected]>,
> Chris Wedgwood <[email protected]> wrote:
> >On Mon, Jul 30, 2001 at 01:36:32PM -0700, Thomas Duffy wrote:
> >
> > to what? and which version is broken?
> >
> >No idea, whatever debian ships with.
> >
> >The reason I use debian is 'things just work' --- presumably redhat
> >has an update for sysvinit, so just snarf the latest and see if that
> >helps.
>
> sysvinit 2.80 is now in debian unstable, it fixes the CREAD bug.
> It might take 1 or 2 days for the alpha/mips/etc autobuilders to
> catch up and produce a .deb for those platforms.
>
> Mike.
> --
> "dselect has a user interface which scares small children"
> -- Theodore Tso, on debian-devel
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel"
> in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
Christophe Barb?
Software Engineer - [email protected]
Lineo France - Lineo High Availability Group
42-46, rue M?d?ric - 92110 Clichy - France
phone (33).1.41.40.02.12 - fax (33).1.41.40.02.01
http://www.lineo.com

2002-01-16 14:30:26

by Eric Lamarque

[permalink] [raw]
Subject: Re: serial console and kernel 2.4

From: christophe barb? ([email protected])
Date: Mon Jul 30 2001 - 09:54:53 EST
> I recently upgraded a linux box to the kernel 2.4.4 .
> Since the upgrade I can see the boot output on the remote console
> but I can't use the keyboard

It seems that I experiment the same problem: I've some Compaq machine
that I control remotely with the serial console.

It always runs 2.4.x kernel and all runs fine.

I just replace the machine by a newer one and experiment the same problem
as you. It seems to me that Linux send CTRL-S on the serial line.

To check that this is the real problem, I use rlogin to access the machine
and send CTRL-Q to the Linux console: it does the trick.
( # echo -e "\021" > /dev/console )

I trace the problem to be the arch/i386/kernel/dmi_scan.c function:
DMI is a set of structures to get information about the machine.
It is the one that print "Board Version:.." at boot time.

I'll check at http://www.ibm.com/products/surepath/other/smbios.html to
know the type of such data. "Board Version" must be a string (I assume with
printable character).

My problem is that "Board Version" is printed as "Board Version: 0x14 0x13 *."
where 0x13 is CTRL-S.

Does the kernel contains a mechanism to avoid console printing of DMI information?
(If not, we could maybe add it in function dmi_scan.c:dmi_save_ident()).

Eric.