Print this page
11581 'debug' loader option is a little obscure
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Rob Johnston <rob.johnston@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/boot/sys/boot/forth/loader.4th.man.txt
          +++ new/usr/src/boot/sys/boot/forth/loader.4th.man.txt
↓ open down ↓ 131 lines elided ↑ open up ↑
 132  132    else
 133  133      drop
 134  134    then
 135  135    s" boot_kmdb" getenv dup -1 <> if
 136  136       s" YES" compare-insensitive 0= if
 137  137         [char] k addr len + c! len 1+ to len
 138  138       then
 139  139    else
 140  140      drop
 141  141    then
 142      -  s" boot_debug" getenv dup -1 <> if
      142 +  s" boot_drop_into_kmdb" getenv dup -1 <> if
 143  143       s" YES" compare-insensitive 0= if
 144  144         [char] d addr len + c! len 1+ to len
 145  145       then
 146  146    else
 147  147      drop
 148  148    then
 149  149    s" boot_reconfigure" getenv dup -1 <> if
 150  150       s" YES" compare-insensitive 0= if
 151  151         [char] r addr len + c! len 1+ to len
 152  152       then
↓ open down ↓ 96 lines elided ↑ open up ↑
 249  249    ?dup 0= if 0 1 autoboot then ;
 250  250  
 251  251  also forth definitions previous
 252  252  
 253  253  builtin: boot builtin: boot-conf
 254  254  
 255  255  only forth definitions also support-functions
 256  256  
 257  257     in case the boot-args is set, parse it and extract following options:  -a
 258  258  to boot_ask=YES  -s to boot_single=YES  -v to boot_verbose=YES  -k to
 259      -boot_kmdb=YES  -d to boot_debug=YES  -r to boot_reconfigure=YES  -B acpi-user-
 260      -options=X to acpi-user-options=X    This is needed so that the menu can manage
 261      -these options. Unfortunately, this  also means that boot-args will override
 262      -previously set options, but we have no  way to control the processing order
 263      -here. boot-args will be rebuilt at boot.     NOTE: The best way to address the
 264      -order is to *not* set any above options  in boot-args.
      259 +boot_kmdb=YES  -d to boot_drop_into_kmdb=YES  -r to boot_reconfigure=YES  -B
      260 +acpi-user-options=X to acpi-user-options=X    This is needed so that the menu
      261 +can manage these options. Unfortunately, this  also means that boot-args will
      262 +override previously set options, but we have no  way to control the processing
      263 +order here. boot-args will be rebuilt at boot.     NOTE: The best way to
      264 +address the order is to *not* set any above options  in boot-args.
 265  265  
 266  266  : parse-boot-args  { | baddr blen -- }
 267  267    s" boot-args" getenv dup -1 = if drop exit then
 268  268    to blen
 269  269    to baddr
 270  270  
 271  271    baddr blen
 272  272  
 273  273     loop over all instances of switch blocks, starting with '-'
 274  274    begin
↓ open down ↓ 78 lines elided ↑ open up ↑
 353  353        2swap 2drop swap
 354  354      then
 355  355  
 356  356      over c@ [char] - = if     ( addr len )
 357  357        2dup 1- swap 1+         ( addr len len' addr' )
 358  358        begin               loop till ' ' or 0      dup c@ dup 0<> swap bl <>
 359  359  and
 360  360        while    dup c@ [char] s = if       s" set boot_single=YES" evaluate
 361  361  TRUE      else dup c@ [char] v = if       s" set boot_verbose=YES" evaluate
 362  362  TRUE      else dup c@ [char] k = if       s" set boot_kmdb=YES" evaluate TRUE
 363      -     else dup c@ [char] d = if       s" set boot_debug=YES" evaluate TRUE
 364      -     else dup c@ [char] r = if       s" set boot_reconfigure=YES" evaluate
 365      -TRUE      else dup c@ [char] a = if       s" set boot_ask=YES" evaluate TRUE
 366      -     then then then then then then      dup TRUE = if    drop      dup >r
      363 +     else dup c@ [char] d = if       s" set boot_drop_into_kmdb=YES" evaluate
      364 +TRUE      else dup c@ [char] r = if       s" set boot_reconfigure=YES"
      365 +evaluate TRUE  else dup c@ [char] a = if       s" set boot_ask=YES" evaluate
      366 +TRUE      then then then then then then      dup TRUE = if    drop      dup >r
 367  367            ( addr len len' addr' R: addr' )     1+ swap 1-        ( addr len
 368  368  addr'+1 len'-1 R: addr' )       r> swap move      ( addr len )
 369  369  
 370  370         2drop baddr blen 1-       check if we have space after '-', if so, drop
 371  371  '- '        swap dup 1+ c@ bl = if            2 + swap 2 -    else
 372  372             swap       then      dup dup 0= swap 1 = or if    empty or only '-'
 373  373  is left.           2drop          s" boot-args" unsetenv        exit    else
 374  374           s" boot-args" setenv        then      recurse        exit    then
 375  375       1+ swap 1- swap
 376  376        repeat
↓ open down ↓ 130 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX