From owner-freebsd-current@FreeBSD.ORG Tue Sep 2 01:33:45 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5DF0216A4BF; Tue, 2 Sep 2003 01:33:45 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id B6CF944005; Tue, 2 Sep 2003 01:33:43 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id SAA13655; Tue, 2 Sep 2003 18:33:37 +1000 Date: Tue, 2 Sep 2003 18:33:36 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Scott Long In-Reply-To: <3F53E315.6070401@freebsd.org> Message-ID: <20030902175538.A617@gamplex.bde.org> References: <1062445674.59251.1.camel@acheron.livid.de> <3F53CF00.6020304@freebsd.org><3F53D645.2040501@freebsd.org> <3F53E315.6070401@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: "Scott M. Likens" cc: current@freebsd.org Subject: Re: Question related to FreeBSD Serial Console... X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2003 08:33:45 -0000 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. Bruce