From owner-freebsd-bugs@FreeBSD.ORG Sun Feb 24 22:20:01 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFB0616A404 for ; Sun, 24 Feb 2008 22:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A2C5C13C468 for ; Sun, 24 Feb 2008 22:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m1OMK1JV069793 for ; Sun, 24 Feb 2008 22:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m1OMK1cN069792; Sun, 24 Feb 2008 22:20:01 GMT (envelope-from gnats) Resent-Date: Sun, 24 Feb 2008 22:20:01 GMT Resent-Message-Id: <200802242220.m1OMK1cN069792@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jeremy Chadwick Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24BDB16A403 for ; Sun, 24 Feb 2008 22:19:22 +0000 (UTC) (envelope-from jdc@parodius.com) Received: from mx01.sc1.parodius.com (mx01.sc1.parodius.com [72.20.106.3]) by mx1.freebsd.org (Postfix) with ESMTP id 0846B13C45A for ; Sun, 24 Feb 2008 22:19:21 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id CE6FF1CC033; Sun, 24 Feb 2008 14:19:21 -0800 (PST) Message-Id: <20080224221921.CE6FF1CC033@mx01.sc1.parodius.com> Date: Sun, 24 Feb 2008 14:19:21 -0800 (PST) From: Jeremy Chadwick To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: conf/121064: Use ASCII characters for box/line characters in frames.4th X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jeremy Chadwick List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Feb 2008 22:20:01 -0000 >Number: 121064 >Category: conf >Synopsis: Use ASCII characters for box/line characters in frames.4th >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Sun Feb 24 22:20:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Jeremy Chadwick >Release: FreeBSD 6.3-PRERELEASE i386 >Organization: >Environment: System: FreeBSD eos.sc1.parodius.com 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #0: Mon Jan 14 17:48:12 PST 2008 root@eos.sc1.parodius.com:/usr/obj/usr/src/sys/EOS i386 >Description: The existing /boot/frames.4th framework assumes users are on a CP437 (PC ANSI)-capable or PC98-capable console The character set used will be generally incompatible on systems using serial console, where the user attached is using a VT100 terminal, xterm, xterm via PuTTY, or anything else that doesn't use a CP437 or PC98 charset. The result is that the box/line characters appear incorrect, as shown here: http://lists.freebsd.org/pipermail/freebsd-hackers/2007-June/020851.html I've come up with a patch which addresses this, using ASCII characters to do the line drawing -- but only when the serial port is chosen as an output device for loader (via -h in /boot.config or console="comconsole" in loader.conf). Patch tested successfully on RELENG_7, but should work on RELENG_6 too. Full discussion of said issue: http://lists.freebsd.org/pipermail/freebsd-hackers/2008-February/023534.html Much thanks to Oliver Fromme for all the help! :-) >How-To-Repeat: See description. >Fix: Apply below patch, then enable serial console. --- frames.4th.orig 2008-02-12 00:20:18.000000000 -0800 +++ frames.4th 2008-02-24 14:11:38.000000000 -0800 @@ -56,6 +56,11 @@ 178 constant fill_bright [then] +\ Used when serial console is detected (-|+ characters) +45 constant ascii_dash +124 constant ascii_pipe +43 constant ascii_plus + : hline ( len x y -- ) \ Draw horizontal single line at-xy \ move cursor 0 do @@ -108,5 +113,35 @@ 2drop ; +: set_serial_charset ( -- ) + s" console" getenv + dup -1 = if + drop exit + then + s" comconsole" compare-insensitive 0= if + drop + ascii_dash h_el ! + ascii_pipe v_el ! + ascii_plus lt_el ! + ascii_plus lb_el ! + ascii_plus rt_el ! + ascii_plus rb_el ! + then + s" boot_serial" getenv + dup -1 = if + drop exit + then + s" YES" compare-insensitive 0= if + drop + ascii_dash h_el ! + ascii_pipe v_el ! + ascii_plus lt_el ! + ascii_plus lb_el ! + ascii_plus rt_el ! + ascii_plus rb_el ! + then +; + f_single +set_serial_charset fill_none fill ! >Release-Note: >Audit-Trail: >Unformatted: