Subject: Re: serial consoles and BIOS console redirection
To: Alex <xela@MIT.EDU>
From: Thor Lancelot Simon <tls@rek.tjls.com>
List: port-i386
Date: 10/29/2002 12:53:08
On Tue, Oct 29, 2002 at 12:44:44PM -0500, Alex wrote:
> 
> > - > 	Is there any way to convince everything to share the
> > - > same console port?  
> 
> Yes, at least with these machines and this BIOS.  After a lot of
> trial and error, what we found to work is regular (vga) bootblocks
> and a kernel that forces a serial console (i.e, with the lines
>   options         CONSDEVNAME="\"com\"",CONADDR=0x3f8,CONSPEED=9600
>   options         CONS_OVERRIDE
> added to the kernel config).  We could not get serial bootblocks
> to echo to the console, nor could we get a kernel that doesn't
> force a serial console to do so.  Note: we got all this working
> at 9600 bps: the blades come with the serial port preset to
> 38400 bps, but we had some issues at that speed.
> 
> I could go on at much greater length about things we tried that
> didn't work, but we're not a lab and didn't take rigorous notes,
> so I'd likely get some detail wrong that turned out to be
> important.  I'll be glad to try to answer any specific questions
> anyone may have, though.

I can explain why you had to do it the way you did.  It's pretty
simple, really.

First off, the BIOS lies to the bootblocks when it's doing console
redirection.  It tells them that there's a VGA card present and that
that's where their output is going, AND it also tells them that there
is no serial port available -- because it's using the serial port, and
doesn't want to be stomped on.  So, the VGA bootblocks work -- because
the BIOS takes their calls to the "output this to the screen" BIOS
interface and sends the output to the serial port -- but the serial
bootblocks don't, because the BIOS calls to output to the serial port
fail.  It may still be possible to build "hardwired" serial bootblocks
that actually directly manipulate the UART, but here too you may run
afoul of the BIOS because it may frob the UART behind your back, causing
you to miss input characters, etc -- with "console redirection" going on,
using the VGA bootblocks really is the way to go.

However, the kernel ends up discovering that there's no VGA card -- it
actually probes for the hardware, rather than asking the BIOS -- and thus
needs to use a serial console.  It's not possible for the bootblocks to
tell it what they used, because they think they used VGA.  You can see
where this is headed.

The solution is to explicitly tell the kernel to use serial console on
the correct UART at the correct speed.  Then all works nicely, using the
VGA bootblocks and the BIOS console redirection.

-- 
 Thor Lancelot Simon	                                      tls@rek.tjls.com
   But as he knew no bad language, he had called him all the names of common
 objects that he could think of, and had screamed: "You lamp!  You towel!  You
 plate!" and so on.              --Sigmund Freud