From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 18 18:39:17 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FF98106566B for ; Fri, 18 Sep 2009 18:39:17 +0000 (UTC) (envelope-from remodeler@alentogroup.org) Received: from courriel.marmotmail.com (courriel.marmotmail.com [85.17.36.172]) by mx1.freebsd.org (Postfix) with ESMTP id 317CF8FC15 for ; Fri, 18 Sep 2009 18:39:16 +0000 (UTC) Received: from bruce.epifora.com (localhost.local [127.0.0.1]) by courriel.marmotmail.com (Postfix) with ESMTP id B9AE1239547 for ; Fri, 18 Sep 2009 21:52:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by bruce.epifora.com (Postfix) with ESMTP id 5D2534761F9 for ; Fri, 18 Sep 2009 14:49:00 -0400 (EDT) Received: from bruce.epifora.com ([127.0.0.1]) by localhost (bruce.epifora.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 17774-07 for ; Fri, 18 Sep 2009 14:48:58 -0400 (EDT) Received: from alentogroup.org (localhost [127.0.0.1]) by bruce.epifora.com (Postfix) with ESMTP id 33BCF4761F8 for ; Fri, 18 Sep 2009 14:48:58 -0400 (EDT) From: "remodeler" To: freebsd-hackers@freebsd.org Date: Fri, 18 Sep 2009 14:48:58 -0400 Message-Id: <20090918182520.M99301@alentogroup.org> X-OriginatingIP: 127.0.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Subject: SOLUTION MBR hack for serial console X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 18:39:17 -0000 This is a solution to the problem I had. I think others might struggle with it too. John Baldwin kindly helped on this list. The FreeBSD handbook article on setting up serial consoles says "Only sio0 through sio3 (COM1 through COM4) can be used; multiport serial cards will not work". I have a recent motherboard that does not have an on-board serial port, only only has PCI / PCI-e expansion slots. PCI dynamically assigns addresses to devices, and I cannot assign a COM1-COM4 address (0x3F8, 0x2F8, 0x3E8 or 0x2E8) to my single-port PCI serial card because a different PCI-PCI bridge has a bit set claiming the legacy addresses. I cannot modify the use of the legacy com address for the serial console in the boot0 code, due to its single-sector size and complexity. It uses PC BIOS calls to access a serial console, and I do not have access to the proprietary motherboard BIOS to change the mapping below boot0. For this reason, creating /boot.config with a flag enabling the serial console (-P, etc.) causes a lockup on boot before boot0 outputs the "F1: FreeBSD" menu. I can catch the serial console during initialization of the loader, though, and can drop to single-user mode or the loader prompt remotely. I specified my non-legacy serial console address in /etc/make.conf and rebuilt the kernel: BOOT_COMCONSOLE_PORT= 0xE800 I set the port and speed in the boot2 Makefile (/usr/src/sys/boot/i386 - it's an AMD64 machine but amd64 still uses the i386 boot blocks): BOOT_COMCONSOLE_PORT?= 0xe800 BOOT_COMCONSOLE_SPEED?= 115200 Rebuilt the boot blocks and wrote the new boot blocks out: # cd /sys/boot # make clean # make # make install # bsdlabel -B /dev/boot_disk I added the console flag to the serial device in /boot/device.hints (could be sio driver instead of uart, this is on 9.0-HEAD): hint.uart.0.port="0xE800" hint.uart.0.flags="0x10" hint.uart.0.irq="20" And last I set these environmental variables in /boot/loader.conf: console="comconsole" comconsole_speed="115200" My goal was a headless remote server w/o high-end server gear, so I didn't set "boot_multicons". I didn't see any effect to setting "boot_serial" in the loader configuration file. I have a fully functioning serial console ;) __ __ ________ ____ ___ ____ ____/ /__ / /__ _____ / ___/ _ \/ __ `__ \/ __ \/ __ / _ \/ / _ \/ ___/ / / / __/ / / / / / /_/ / /_/ / __/ / __/ / /_/ \___/_/ /_/ /_/\____/\__,_/\___/_/\___/_/ The information contained in this message is confidential and is intended for the addressee only. Any unauthorized use, dissemination of the information, or copying of this message is prohibited.