Re: Only display ACPI bootmenu key if ACPI is present

From: David Rhodus <sdrhodus_at_gmail.com>
Date: Wed, 10 Nov 2010 11:01:32 -0500
What are the chances the detection fails and one still needs to disable ACPI and can't because it's not showing as a option ?

Thanks,
David Rhodus

On Nov 8, 2010, at 5:14 PM, John Baldwin <jhb_at_freebsd.org> wrote:

> 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
> _at__at_ -140,12 +140,16 _at__at_
>    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
> _at__at_ -178,8 +182,7 _at__at_
>    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
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
Received on Wed Nov 10 2010 - 15:01:55 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:09 UTC