conf/121064: Use ASCII characters for box/line characters in
frames.4th
Jeremy Chadwick
koitsu at FreeBSD.org
Sun Feb 24 22:20:01 UTC 2008
>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 at 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:
More information about the freebsd-bugs
mailing list