Re: Question related to FreeBSD Serial Console...

From: Bruce Evans <>
Date: Tue, 2 Sep 2003 18:33:36 +1000 (EST)
About the original question: multiple consoles in the kernel are
unsupported in FreeBSD-4 but are standard in -current.  Unfortunately,
their implementation is slightly incomplete even in -current.  In
-current, you get them by booting with -D after booting using the
kern.console sysctl.  The number of consoles is limited only by the
number of devices that support consoles.  Low level console i/o (mainly
boot messages and other kernel messags printed by kernel printfs) is
then sent to and received from all the consoles, but for some reason
high-level console output (all i/o from/to /dev/console) is only sent
to the first console in the list.  This should be easy to fix for
writes and ioctls though not so easy for reads.  I think booting with
-Dh makes the serial console first and booting with -D makes the video
console first (if both are configured).  The order can be changed using
the sysctl.

On Mon, 1 Sep 2003, Scott Long wrote:

> John Birrell wrote:
> > On Mon, Sep 01, 2003 at 05:29:09PM -0600, Scott Long wrote:
> >
> >>At one time I was working on patches to the loader to make the console
> >>speed configurable.  At the time, at least, I didn't see any evidence
> >>that the settings were stored in the boot0 block, but maybe I was wrong.

There are already too many places to set it.

> > AFAIK, the boot0 block uses bios int 0x16 to get a key-press and bios int
> > 0x10 to display a character, so in a situation where you *want* a serial
> > console, the F1 etc stuff can't be used unless the bios supports console
> > re-direction. And you have to live with whatever baud rate the bios sets.

I think boot0 is already full (unless you unportabalize it by expanding it
beyond one sector).  It doesn't have its own serial i/o routines mainly
because there is no space for them.

> > Once you get to boot2, then the serial console can work if set in /boot.config.
> >
> > It would be nice to have a boot.config setting for the baud rate. I have a
> > board here that allows bios re-direction to either the first or second serial
> > port at a fixed baud rate of 38400. I have to build boot2 with
> > BOOT_COMCONSOLE_SPEED=38400, and then the kernel with CONSPEED=38400 to
> > get all the ducks in a row.

The latter shouldn't be necessary.  The kernel (i386 sio only) uses the
same speed that boot2 used if the kernel was booted with -h.  It should
also use the same speed if the kernel was booted with -D.

> > But it would be even nicer if both boot2 and the kernel would just work with
> > whatever baud rate the bios set.
> This is exactly the problem that I was working on.

Unfortunately most BIOSes don't provide a way to set the speed.  I'm not
sure that it even has a default.  I always use 115200 bps, but at least he
old BIOS interface is limited to 9600 bps.  I may work on this a bit soon
to make 921600 bps work.

Received on Mon Sep 01 2003 - 23:33:45 UTC

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