From owner-freebsd-hackers@FreeBSD.ORG Sun Feb 24 22:01:14 2008 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 B574E16A401 for ; Sun, 24 Feb 2008 22:01:14 +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 92BA313C459 for ; Sun, 24 Feb 2008 22:01:14 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id 91C3F1CC033; Sun, 24 Feb 2008 14:01:14 -0800 (PST) Date: Sun, 24 Feb 2008 14:01:14 -0800 From: Jeremy Chadwick To: Oliver Fromme Message-ID: <20080224220114.GA52366@eos.sc1.parodius.com> References: <20080224145940.GA41037@eos.sc1.parodius.com> <200802241738.m1OHccfW031633@lurza.secnetix.de> <20080224200305.GA49564@eos.sc1.parodius.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080224200305.GA49564@eos.sc1.parodius.com> User-Agent: Mutt/1.5.16 (2007-06-09) Cc: freebsd-hackers@freebsd.org Subject: Re: loader and ficl/Forth help 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: Sun, 24 Feb 2008 22:01:14 -0000 On Sun, Feb 24, 2008 at 12:03:05PM -0800, Jeremy Chadwick wrote: > I'll have to get the qemu stuff set up so I can test this more easily. I re-thought the method a bit, and went with something slightly more hackish, plus added code to deal with the case where one uses -h or -Dh in /boot.config (thus setting boot_serial=YES). The Forth code can probably be simplified, but since I got this to work, I'll submit a PR for the whole thing. We can hash out details/improvements there. \ Used when serial console is detected (-|+ characters) 45 constant ascii_dash 124 constant ascii_pipe 43 constant ascii_plus : 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 ; set_serial_charset should be called after f_single in frames.4th. I just tested it on our development box, which uses -S115200 -Dh in /boot.config and nothing serial-related in loader.conf: +-----------------------------------------+ | | | | ______ | | | ____| __ ___ ___ | Welcome to FreeBSD! | | |__ | '__/ _ \/ _ \ | | | __|| | | __/ __/ | | | | | | | | | | 1. Boot FreeBSD [default] | |_| |_| \___|\___| | 2. Boot FreeBSD with ACPI disabled | ____ _____ _____ | 3. Boot FreeBSD in Safe Mode | | _ \ / ____| __ \ | 4. Boot FreeBSD in single user mode | | |_) | (___ | | | | | 5. Boot FreeBSD with verbose logging | | _ < \___ \| | | | | 6. Escape to loader prompt | | |_) |____) | |__| | | 7. Reboot | | | | | | | |____/|_____/|_____/ | | | | | | | Select option, [Enter] for default | | or [Space] to pause timer 6 | +-----------------------------------------+ -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |