Re: Support for serial console on legacy free machines

Eric W. Biederman (ebiederm@xmission.com)
31 Jul 2001 21:21:54 -0600


Russell King <rmk@arm.linux.org.uk> writes:

> On Tue, Jul 31, 2001 at 10:34:35AM -0400, Stuart MacDonald wrote:
> > That's very odd. That implies that serial consoles don't use the serial
> > driver at all then, as the pci serial port setup is done at the same
> > time as the regular serial port setups.
> >
> > If a serial console is using serial.c, the pci serial ports will also
> > be available.
>
> No. Console initialisation is done early, before PCI is setup. This
> means that the serial driver is relying on a static array of IO port
> addresses. At this time, the serial driver hasn't probed any ports at
> all, so it doesn't really know what does and doesn't exist.

Hmm. I hadn't realized it was poking in the dark.

> The more I think about this, the more that I think we need to get rid
> of this early console initialisation. I think Linus really wants early
> console initialisation though, and to be honest, its an extremely useful
> debugging tool for those pesky non-boots with blank displays.

I think I both agree and disagree with you. I think it might make sense
to seperate out the debugging console drivers from the normal kernel drivers.
I have had several times where I have had to hack up a serial driver that
is initialized very early so I could see why my kernel is crashing.

If we seperated out the console drivers and modified them so they would
build for specific hardware, and would be initialized immediately upon
transition to C code. There would be a major debugging benefit.

Then we could probably afford to use the normal serial code for a more
normal serial console.

Does this sound like a reasonable direction to go? You've torn open
the code and familiar with what it's guts look like.

> If someone would like to produce a patch which adds an option for early
> console vs "normal" console initialisation... Otherwise I'll add it to
> my (longish) "to do" list.

I might have to look. I have done some preliminary work, in getting a
very, very early serial console built so I'm not completely in the
dark. If you like the idea of splitting the console code in two half
that uses normal routines and another have that does very, very, very
early initialization I'm more likely to :)

Eric

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