From c3e6a6edd2f8baf75fe85676012b61c894a7dac3 Mon Sep 17 00:00:00 2001 From: John Levon Date: Thu, 22 Aug 2019 10:12:58 +0000 Subject: 11581 'debug' loader option is a little obscure Reviewed by: Jerry Jelinek Reviewed by: Rob Johnston Reviewed by: Toomas Soome Reviewed by: Gergő Doma Approved by: Robert Mustacchi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- usr/src/boot/sys/boot/common/help.common | 4 +-- usr/src/boot/sys/boot/forth/beadm.4th | 3 +- usr/src/boot/sys/boot/forth/loader.4th | 6 ++-- usr/src/boot/sys/boot/forth/menu-commands.4th | 47 ++++++++++++------------- usr/src/boot/sys/boot/forth/menu.4th | 40 +++++++++++----------- usr/src/boot/sys/boot/forth/menu.rc | 49 ++++++++++++++------------- 6 files changed, 76 insertions(+), 73 deletions(-) diff --git a/usr/src/boot/sys/boot/common/help.common b/usr/src/boot/sys/boot/common/help.common index 5bcd1c08c3..dca3b09ab9 100644 --- a/usr/src/boot/sys/boot/common/help.common +++ b/usr/src/boot/sys/boot/common/help.common @@ -209,9 +209,9 @@ information when the kernel is booted. ################################################################################ -# Tset Sboot_debug DDrop to the kernel debugger (kmdb) +# Tset Sboot_drop_into_kmdb DDrop into the kernel debugger (kmdb) - set boot_debug + set boot_drop_into_kmdb Instructs the kernel to start in the kmdb debugger, rather than proceeding to initialize when booted. Can only be used when boot_kmdb diff --git a/usr/src/boot/sys/boot/forth/beadm.4th b/usr/src/boot/sys/boot/forth/beadm.4th index 99d5fbde2d..74e9022634 100644 --- a/usr/src/boot/sys/boot/forth/beadm.4th +++ b/usr/src/boot/sys/boot/forth/beadm.4th @@ -10,6 +10,7 @@ \ Copyright 2017 Toomas Soome \ Copyright 2019 OmniOS Community Edition (OmniOSce) Association. +\ Copyright 2019 Joyent, Inc. \ This module is implementing the beadm user command to support listing \ and switching Boot Environments (BE) from command line and @@ -246,7 +247,7 @@ variable page_remainder s" boot_single" unsetenv s" boot_verbose" unsetenv s" boot_kmdb" unsetenv - s" boot_debug" unsetenv + s" boot_drop_into_kmdb" unsetenv s" boot_reconfigure" unsetenv start \ load config, kernel and modules ." Current boot device: " s" currdev" getenv type cr diff --git a/usr/src/boot/sys/boot/forth/loader.4th b/usr/src/boot/sys/boot/forth/loader.4th index 92c742c472..7ac6aa372f 100644 --- a/usr/src/boot/sys/boot/forth/loader.4th +++ b/usr/src/boot/sys/boot/forth/loader.4th @@ -156,7 +156,7 @@ only forth also support-functions also builtins definitions else drop then - s" boot_debug" getenv dup -1 <> if + s" boot_drop_into_kmdb" getenv dup -1 <> if s" YES" compare-insensitive 0= if [char] d addr len + c! len 1+ to len then @@ -286,7 +286,7 @@ only forth definitions also support-functions \ -s to boot_single=YES \ -v to boot_verbose=YES \ -k to boot_kmdb=YES -\ -d to boot_debug=YES +\ -d to boot_drop_into_kmdb=YES \ -r to boot_reconfigure=YES \ -B acpi-user-options=X to acpi-user-options=X \ @@ -455,7 +455,7 @@ only forth definitions also support-functions else dup c@ [char] k = if s" set boot_kmdb=YES" evaluate TRUE else dup c@ [char] d = if - s" set boot_debug=YES" evaluate TRUE + s" set boot_drop_into_kmdb=YES" evaluate TRUE else dup c@ [char] r = if s" set boot_reconfigure=YES" evaluate TRUE else dup c@ [char] a = if diff --git a/usr/src/boot/sys/boot/forth/menu-commands.4th b/usr/src/boot/sys/boot/forth/menu-commands.4th index d9d3dba411..ca0dea0a71 100644 --- a/usr/src/boot/sys/boot/forth/menu-commands.4th +++ b/usr/src/boot/sys/boot/forth/menu-commands.4th @@ -24,6 +24,7 @@ \ \ Copyright 2015 Toomas Soome \ Copyright 2019 OmniOS Community Edition (OmniOSce) Association. +\ Copyright 2019 Joyent, Inc. marker task-menu-commands.4th @@ -36,9 +37,9 @@ variable acpi_state variable kernel_state variable root_state variable kmdb_state -variable debug_state +variable drop_into_kmdb_state 0 kmdb_state ! -0 debug_state ! +0 drop_into_kmdb_state ! 0 osconsole_state ! 0 acpi_state ! 0 kernel_state ! @@ -200,11 +201,11 @@ also menu-namespace also menu-command-helpers : kmdb_disable ( -- ) s" boot_kmdb" unsetenv - s" boot_debug" unsetenv + s" boot_drop_into_kmdb" unsetenv ; : init_kmdb ( N -- N ) - dup kmdb_state ! \ store entry number for kmdb+debug + dup kmdb_state ! \ store entry number for kmdb+drop_into_kmdb kmdb_enabled? if toggle_menuitem ( n -- n ) then @@ -213,9 +214,9 @@ also menu-namespace also menu-command-helpers : toggle_kmdb ( N -- N TRUE ) toggle_menuitem dup toggle_stateN @ 0= if ( kmdb is not set ) - debug_state @ if ( debug is set? ) - debug_state @ toggle_stateN @ if ( debug is enabled? ) - debug_state @ toggle_menuitem drop + drop_into_kmdb_state @ if ( drop_into_kmdb is set? ) + drop_into_kmdb_state @ toggle_stateN @ if ( drop_into_kmdb is enabled? ) + drop_into_kmdb_state @ toggle_menuitem drop then then then @@ -233,35 +234,35 @@ also menu-namespace also menu-command-helpers ; \ -\ kmdb + debug +\ drop into kmdb \ -: debug_disable ( -- ) - s" boot_debug" unsetenv +: drop_into_kmdb_disable ( -- ) + s" boot_drop_into_kmdb" unsetenv ; -: debug_enabled? ( -- flag ) - \ -d is only allowed with -k - s" boot_debug" getenv -1 <> kmdb_enabled? and dup if +: drop_into_kmdb_enabled? ( -- flag ) + \ -d is only allowed with -k + s" boot_drop_into_kmdb" getenv -1 <> kmdb_enabled? and dup if swap drop ( c-addr flag -- flag ) else - debug_disable \ make sure env is not set + drop_into_kmdb_disable \ make sure env is not set then ; -: debug_enable ( -- ) +: drop_into_kmdb_enable ( -- ) kmdb_enable - s" set boot_debug=YES" evaluate + s" set boot_drop_into_kmdb=YES" evaluate ; -: init_debug ( N -- N ) - dup debug_state ! \ store entry number for kmdb - kmdb_enabled? debug_enabled? and if +: init_drop_into_kmdb ( N -- N ) + dup drop_into_kmdb_state ! \ store entry number for kmdb + kmdb_enabled? drop_into_kmdb_enabled? and if toggle_menuitem ( n -- n ) then ; -: toggle_debug ( N -- N TRUE ) +: toggle_drop_into_kmdb ( N -- N TRUE ) toggle_menuitem kmdb_enabled? 0= if kmdb_state @ toggle_menuitem drop @@ -271,9 +272,9 @@ also menu-namespace also menu-command-helpers \ Now we're going to make the change effective dup toggle_stateN @ 0= if - debug_disable + drop_into_kmdb_disable else - debug_enable + drop_into_kmdb_enable then TRUE \ loop menu again @@ -523,7 +524,7 @@ also menu-namespace also menu-command-helpers s" boot_ask" unsetenv singleuser_disable verbose_disable - kmdb_disable \ disables debug as well + kmdb_disable \ disables drop_into_kmdb as well reconfigure_disable ; diff --git a/usr/src/boot/sys/boot/forth/menu.4th b/usr/src/boot/sys/boot/forth/menu.4th index efdd51b6a8..5f5709fcf6 100644 --- a/usr/src/boot/sys/boot/forth/menu.4th +++ b/usr/src/boot/sys/boot/forth/menu.4th @@ -442,20 +442,20 @@ also menu-infrastructure definitions : acpi-captions ( N -- ) \ first entry - dup s" [A]CPI.... default" rot 48 menu_caption[x][y] setenv - dup s" ^[1mA^[mCPI.... ^[32;7mdefault^[m" rot 48 ansi_caption[x][y] setenv + dup s" [A]CPI.............. default" rot 48 menu_caption[x][y] setenv + dup s" ^[1mA^[mCPI.............. ^[32;7mdefault^[m" rot 48 ansi_caption[x][y] setenv - dup s" [A]CPI........ On" rot 49 menu_caption[x][y] setenv - dup s" ^[1mA^[mCPI........ ^[34;1mOn^[m" rot 49 ansi_caption[x][y] setenv + dup s" [A]CPI.............. On" rot 49 menu_caption[x][y] setenv + dup s" ^[1mA^[mCPI.............. ^[34;1mOn^[m" rot 49 ansi_caption[x][y] setenv - dup s" [A]CPI........ Off" rot 50 menu_caption[x][y] setenv - dup s" ^[1mA^[mCPI........ ^[34;1mOff^[m" rot 50 ansi_caption[x][y] setenv + dup s" [A]CPI.............. Off" rot 50 menu_caption[x][y] setenv + dup s" ^[1mA^[mCPI.............. ^[34;1mOff^[m" rot 50 ansi_caption[x][y] setenv - dup s" [A]CPI....... MADT" rot 51 menu_caption[x][y] setenv - dup s" ^[1mA^[mCPI....... ^[34;1mMADT^[m" rot 51 ansi_caption[x][y] setenv + dup s" [A]CPI.............. MADT" rot 51 menu_caption[x][y] setenv + dup s" ^[1mA^[mCPI.............. ^[34;1mMADT^[m" rot 51 ansi_caption[x][y] setenv - dup s" [A]CPI..... Legacy" rot 52 menu_caption[x][y] setenv - s" ^[1mA^[mCPI..... ^[34;1mLegacy^[m" rot 52 ansi_caption[x][y] setenv + dup s" [A]CPI.............. Legacy" rot 52 menu_caption[x][y] setenv + s" ^[1mA^[mCPI.............. ^[34;1mLegacy^[m" rot 52 ansi_caption[x][y] setenv ; \ Illumos console has following values: @@ -463,20 +463,20 @@ also menu-infrastructure definitions : osconsole-captions ( N -- ) \ first entry - dup s" Os[C]onsole.. text" rot 48 menu_caption[x][y] setenv - dup s" Os^[1mC^[monsole.. ^[32;7mtext^[m" rot 48 ansi_caption[x][y] setenv + dup s" Os[C]onsole............ text" rot 48 menu_caption[x][y] setenv + dup s" Os^[1mC^[monsole............ ^[32;7mtext^[m" rot 48 ansi_caption[x][y] setenv - dup s" Os[C]onsole.. ttya" rot 49 menu_caption[x][y] setenv - dup s" Os^[1mC^[monsole.. ^[34;1mttya^[m" rot 49 ansi_caption[x][y] setenv + dup s" Os[C]onsole............ ttya" rot 49 menu_caption[x][y] setenv + dup s" Os^[1mC^[monsole............ ^[34;1mttya^[m" rot 49 ansi_caption[x][y] setenv - dup s" Os[C]onsole.. ttyb" rot 50 menu_caption[x][y] setenv - dup s" Os^[1mC^[monsole.. ^[34;1mttyb^[m" rot 50 ansi_caption[x][y] setenv + dup s" Os[C]onsole............ ttyb" rot 50 menu_caption[x][y] setenv + dup s" Os^[1mC^[monsole............ ^[34;1mttyb^[m" rot 50 ansi_caption[x][y] setenv - dup s" Os[C]onsole.. ttyc" rot 51 menu_caption[x][y] setenv - dup s" Os^[1mC^[monsole.. ^[34;1mttyc^[m" rot 51 ansi_caption[x][y] setenv + dup s" Os[C]onsole............ ttyc" rot 51 menu_caption[x][y] setenv + dup s" Os^[1mC^[monsole............ ^[34;1mttyc^[m" rot 51 ansi_caption[x][y] setenv - dup s" Os[C]onsole.. ttyd" rot 52 menu_caption[x][y] setenv - s" Os^[1mC^[monsole.. ^[34;1mttyd^[m" rot 52 ansi_caption[x][y] setenv + dup s" Os[C]onsole............ ttyd" rot 52 menu_caption[x][y] setenv + s" Os^[1mC^[monsole............ ^[34;1mttyd^[m" rot 52 ansi_caption[x][y] setenv ; \ This function creates the list of menu items. This function is called by the diff --git a/usr/src/boot/sys/boot/forth/menu.rc b/usr/src/boot/sys/boot/forth/menu.rc index d84c5b4430..6079c2c196 100644 --- a/usr/src/boot/sys/boot/forth/menu.rc +++ b/usr/src/boot/sys/boot/forth/menu.rc @@ -130,44 +130,45 @@ set optionsmenu_command[3]="cycle_acpi" set optionsmenu_keycode[3]=97 set optionsmenu_init[4]="init_singleuser" -set optionsmenu_caption[4]="[S]ingle User. Off" -set optionstoggled_text[4]="[S]ingle User. On" +set optionsmenu_caption[4]="[S]ingle User......... Off" +set optionstoggled_text[4]="[S]ingle User......... On" set optionsmenu_command[4]="toggle_singleuser" set optionsmenu_keycode[4]=115 -set optionsansi_caption[4]="^[1mS^[mingle User. ^[34;1mOff^[m" -set optionstoggled_ansi[4]="^[1mS^[mingle User. ^[32;7mOn^[m" +set optionsansi_caption[4]="^[1mS^[mingle User........... ^[34;1mOff^[m" +set optionstoggled_ansi[4]="^[1mS^[mingle User........... ^[32;7mOn^[m" set optionsmenu_init[5]="init_verbose" -set optionsmenu_caption[5]="[V]erbose..... Off" -set optionstoggled_text[5]="[V]erbose..... On" +set optionsmenu_caption[5]="[V]erbose............. Off" +set optionstoggled_text[5]="[V]erbose............. On" set optionsmenu_command[5]="toggle_verbose" set optionsmenu_keycode[5]=118 -set optionsansi_caption[5]="^[1mV^[merbose..... ^[34;1mOff^[m" -set optionstoggled_ansi[5]="^[1mV^[merbose..... ^[32;7mOn^[m" +set optionsansi_caption[5]="^[1mV^[merbose............... ^[34;1mOff^[m" +set optionstoggled_ansi[5]="^[1mV^[merbose............... ^[32;7mOn^[m" set optionsmenu_init[6]="init_reconfigure" -set optionsmenu_caption[6]="[R]econfigure. Off" -set optionstoggled_text[6]="[R]econfigure. On" +set optionsmenu_caption[6]="[R]econfigure......... Off" +set optionstoggled_text[6]="[R]econfigure......... On" set optionsmenu_command[6]="toggle_reconfigure" set optionsmenu_keycode[6]=114 -set optionsansi_caption[6]="^[1mR^[meconfigure. ^[34;1mOff^[m" -set optionstoggled_ansi[6]="^[1mR^[meconfigure. ^[32;7mOn^[m" +set optionsansi_caption[6]="^[1mR^[meconfigure........... ^[34;1mOff^[m" +set optionstoggled_ansi[6]="^[1mR^[meconfigure........... ^[32;7mOn^[m" set optionsmenu_init[7]="init_kmdb" -set optionsmenu_caption[7]="k[m]db........ Off" -set optionstoggled_text[7]="k[m]db........ On" +set optionsmenu_caption[7]="Load [k]mdb........... Off" +set optionstoggled_text[7]="Load [k]mdb........... On" set optionsmenu_command[7]="toggle_kmdb" -set optionsmenu_keycode[7]=109 -set optionsansi_caption[7]="k^[1mm^[mdb........ ^[34;1mOff^[m" -set optionstoggled_ansi[7]="k^[1mm^[mdb........ ^[32;7mOn^[m" - -set optionsmenu_init[8]="init_debug" -set optionsmenu_caption[8]="[D]ebug....... Off" -set optionstoggled_text[8]="[D]ebug....... On" -set optionsmenu_command[8]="toggle_debug" +set optionsmenu_keycode[7]=107 +set optionsansi_caption[7]="Load ^[1mk^[mmdb............. ^[34;1mOff^[m" +set optionstoggled_ansi[7]="Load ^[1mk^[mmdb............. ^[32;7mOn^[m" + +set optionsmenu_init[8]="init_drop_into_kmdb" +set optionsmenu_caption[8]="[D]rop into kmdb...... Off" +set optionstoggled_text[8]="[D]rop into kmdb...... On" +set optionsmenu_command[8]="toggle_drop_into_kmdb" set optionsmenu_keycode[8]=100 -set optionsansi_caption[8]="^[1mD^[mebug....... ^[34;1mOff^[m" -set optionstoggled_ansi[8]="^[1mD^[mebug....... ^[32;7mOn^[m" +set optionsansi_caption[8]="^[1mD^[mrop into kmdb........ ^[34;1mOff^[m" +set optionstoggled_ansi[8]="^[1mD^[mrop into kmdb........ ^[32;7mOn^[m" + \ \ BOOT ENVIRONMENT MENU -- cgit v1.2.3