From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 15:25:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E24BC800; Sun, 9 Dec 2012 15:25:34 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C672B8FC08; Sun, 9 Dec 2012 15:25:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9FPYH0074745; Sun, 9 Dec 2012 15:25:34 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9FPYsG074743; Sun, 9 Dec 2012 15:25:34 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201212091525.qB9FPYsG074743@svn.freebsd.org> From: Devin Teske Date: Sun, 9 Dec 2012 15:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244048 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 15:25:35 -0000 Author: dteske Date: Sun Dec 9 15:25:34 2012 New Revision: 244048 URL: http://svnweb.freebsd.org/changeset/base/244048 Log: Use ASCII characters for box/line characters in frames.4th Committed with changes to support the following from loader.conf(5): + console="vidconsole comconsole" (not just console="comconsole") + boot_serial="anything" (not just boot_serial="YES") + boot_multicons="anything" (unsupported in originally-submitted patch) PR: conf/121064 Submitted by: koitsu Reviewed by: gcooper, adrian (co-mentor) Approved by: adrian (co-mentor) Modified: head/sys/boot/forth/frames.4th head/sys/boot/forth/support.4th Modified: head/sys/boot/forth/frames.4th ============================================================================== --- head/sys/boot/forth/frames.4th Sun Dec 9 09:58:44 2012 (r244047) +++ head/sys/boot/forth/frames.4th Sun Dec 9 15:25:34 2012 (r244048) @@ -12,6 +12,11 @@ variable rt_el variable rb_el variable fill +\ ASCII frames (used when serial console is detected) + 45 constant ascii_dash +124 constant ascii_pipe + 43 constant ascii_plus + s" arch-pc98" environment? [if] \ Single frames 149 constant sh_el @@ -63,7 +68,17 @@ s" arch-pc98" environment? [if] loop ; +: f_ascii ( -- ) ( -- ) \ set frames to ascii + ascii_dash h_el ! + ascii_pipe v_el ! + ascii_plus lt_el ! + ascii_plus lb_el ! + ascii_plus rt_el ! + ascii_plus rb_el ! +; + : f_single ( -- ) \ set frames to single + boot_serial? if f_ascii exit then sh_el h_el ! sv_el v_el ! slt_el lt_el ! @@ -73,6 +88,7 @@ s" arch-pc98" environment? [if] ; : f_double ( -- ) \ set frames to double + boot_serial? if f_ascii exit then dh_el h_el ! dv_el v_el ! dlt_el lt_el ! Modified: head/sys/boot/forth/support.4th ============================================================================== --- head/sys/boot/forth/support.4th Sun Dec 9 09:58:44 2012 (r244047) +++ head/sys/boot/forth/support.4th Sun Dec 9 15:25:34 2012 (r244048) @@ -201,6 +201,46 @@ create last_module_option sizeof module. : getenv? getenv -1 = if false else drop true then ; +\ determine if a word appears in a string, case-insensitive +: contains? ( addr1 len1 addr2 len2 -- 0 | -1 ) + 2 pick 0= if 2drop 2drop true exit then + dup 0= if 2drop 2drop false exit then + begin + begin + swap dup c@ dup 32 = over 9 = or + over 10 = or over 13 = or swap drop + while 1+ swap 1- repeat + swap 2 pick 1- over < + while + 2over 2over drop over compare-insensitive 0= if + 2 pick over = if 2drop 2drop true exit then + 2 pick tuck - -rot + swap over c@ dup 32 = + over 9 = or over 10 = or over 13 = or + swap drop if 2drop 2drop true exit then + then begin + swap dup c@ + dup 32 = over 9 = or over 10 = or over 13 = or + swap drop if false else true then 2 pick 0> and + while 1+ swap 1- repeat + swap + repeat + 2drop 2drop false +; + +: boot_serial? ( -- 0 | -1 ) + s" console" getenv dup -1 <> if + s" comconsole" 2swap contains? + else drop false then + s" boot_serial" getenv dup -1 <> if + swap drop 0> + else drop false then + or \ console contains comconsole ( or ) boot_serial + s" boot_multicons" getenv dup -1 <> if + swap drop 0> + else drop false then + or \ previous boolean ( or ) boot_multicons +; + \ Private definitions vocabulary support-functions