Re: Serial console only works after reboot?

From: Bruce Evans <bde_at_zeta.org.au>
Date: Mon, 5 Jan 2004 16:50:13 +1100 (EST)
On Mon, 5 Jan 2004, Bruce M Simpson wrote:

> On Sun, Jan 04, 2004 at 04:41:03PM -0700, M. Warner Losh wrote:
> > Somewhere along the way, it gets set to 115200.  Maybe it is
> > initialized to 115200 by the boot blocks?  I think once there's a
> > divisor programmed into the serial port, the kernel console code
> > doesn't change it.  I could be wrong about this, however....

sio always uses the current divisor iff:
- the kernel was booted with RB_SERIAL, and
- the current divisor is nonzero.  A divisor of 0 "can't happen", but is
  most likely after a cold boot when everything neglects to set the
  divisor (since the contents of the divisor registers is undefined
  after 8250-16x50 reset).  However, anything that sets RB_SERIAL
  should set the divisor.  sio cannot check that the port that it reads
  the divisor on is the same one that the boot program set RB_SERIAL on.

> Try installing boot0sio as your boot manager. It specifically requests 9600
> 8-N-1 via BIOS calls. However this does mean that boot selection has to
> happen over COM1.

It should use BOOT_COMCONSOLE_PORT and BOOT_CONSOLE_SPEED like boot2
does.  These are standard -- see make.conf(5).  boot2 doesn't use the
BIOS, so BOOT_COMCONSOLE_PORT can be a port not understood by the BIOS.
boot0sio would have problems with this, and mapping BOOT_COMCONSOLE_PORT
to a BIOS port number might take more code than fits.  boot2 also supports
setting the character format (B2SIOFMT macro), but this is nonstandard and
not supported by the sio console.

Bruce
Received on Sun Jan 04 2004 - 20:50:35 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:36 UTC