From owner-freebsd-current@FreeBSD.ORG Mon Nov 8 22:14:55 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88A8A1065679 for ; Mon, 8 Nov 2010 22:14:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 597198FC1C for ; Mon, 8 Nov 2010 22:14:55 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id E27E946B0D for ; Mon, 8 Nov 2010 17:14:54 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1E1958A009 for ; Mon, 8 Nov 2010 17:14:54 -0500 (EST) From: John Baldwin To: current@freebsd.org Date: Mon, 8 Nov 2010 17:14:53 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201011081714.53637.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 08 Nov 2010 17:14:54 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=0.7 required=4.2 tests=BAYES_00,TO_NO_BRKTS_DIRECT autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: Subject: Only display ACPI bootmenu key if ACPI is present X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 22:14:55 -0000 This patch changes the Forth code for the Beastie menu to only display the menu option to enable or disable ACPI if the loader detects ACPI. This avoids displaying a menu item prompting to enable ACPI if the BIOS doesn't actually include ACPI. Any objections? --- //depot/projects/smpng/sys/boot/forth/beastie.4th 2010-11-08 21:53:18.000000000 0000 +++ //depot/user/jhb/ktrace/boot/forth/beastie.4th 2010-11-08 22:14:04.000000000 0000 @@ -140,12 +140,16 @@ fbsdbw-logo ; -: acpienabled? ( -- flag ) +: acpipresent? ( -- flag ) s" hint.acpi.0.rsdp" getenv dup -1 = if drop false exit then 2drop + true +; + +: acpienabled? ( -- flag ) s" hint.acpi.0.disabled" getenv dup -1 <> if s" 0" compare 0<> if @@ -178,8 +182,7 @@ 42 20 2 2 box 13 6 at-xy ." Welcome to FreeBSD!" printmenuitem ." Boot FreeBSD [default]" bootkey ! - s" arch-i386" environment? if - drop + acpipresent? if printmenuitem ." Boot FreeBSD with ACPI " bootacpikey ! acpienabled? if ." disabled" -- John Baldwin