OpenBoot Command Reference Manual
  Procure somente este livro
Fazer download desta apostila em PDF

Setting Configuration Parameters

3

This chapter describes how to access and modify non-volatile RAM (NVRAM) configuration parameters.
System configuration parameters are stored in the system NVRAM. These parameters determine the start-up machine configuration and related communication characteristics. You can modify the default values of the configuration parameters, and any changes you make remain in effect even after a power cycle. Configuration parameters should always be adjusted cautiously. When correctly used, these parameters give you flexibility in working with your system's hardware.
The procedures described in this chapter assume that the ok prompt is displayed on your screen. See Chapter 1, "Overview," for information about entering the Forth Monitor.
Table 3-1 lists current NVRAM configuration parameters.
Table 3-1
ParameterTypical DefaultDescription
auto-boot?trueIf true, boot automatically after power on or reset.
boot-devicediskDevice from which to boot.
boot-fileempty stringFile to boot (an empty string lets secondary booter choose default).
boot-fromvmunixBoot device and file (1.x only).
boot-from-diagle()vmunixDiagnostic boot device and file (1.x only).
diag-devicenetDiagnostic boot source device.
diag-fileempty stringFile from which to boot in diagnostic mode.
diag-switch?falseIf true, run in diagnostic mode.
fcode-debug?falseIf true, include name fields for plug-in device FCodes.
hardware-revisionno defaultSystem version information.
input-devicekeyboardPower-on input device (usually keyboard, ttya, or ttyb).
keyboard-click?falseIf true, enable keyboard click.
keymapno defaultKeymap for custom keyboard.
last-hardware-updateno defaultSystem update information.
local-mac-address?falseIf true, network drivers use their own MAC address, not system's.
mfg-switch?falseIf true, repeat system self-tests until interrupted with Stop-A.
nvramrcemptyContents of NVRAMRC.
oem-bannerempty stringCustom OEM banner (enabled by oem-banner? true).
oem-banner?falseIf true, use custom OEM banner.
oem-logono defaultByte array custom OEM logo (enabled by oem-logo? true). Displayed in hexadecimal.
oem-logo?falseIf true, use custom OEM logo (else, use Sun logo).
output-devicescreenPower-on output device (usually screen, ttya, or ttyb).
sbus-probe-list0123Which SBus slots are probed and in what order.
screen-#columns80Number of on-screen columns (characters/line).
screen-#rows34Number of on-screen rows (lines).
scsi-initiator-id7SCSI bus address of host adapter, range 0-7.
sd-targets31204567Map SCSI disk units (1.x only).
security-#badloginsno defaultNumber of incorrect security password attempts.
Table 3-1 (Continued)
ParameterTypical DefaultDescription
security-modenoneFirmware security level (options: none, command, or full).
security-passwordno defaultFirmware security password (never displayed). Do not set this directly.
selftest-#megs1Megabytes of RAM to test. Ignored if diag-switch? is true.
skip-vme-loopback?falseIf true, POST does not do VMEbus loopback tests.
st-targets45670123Map SCSI tape units (1.x only).
sunmon-compat?falseIf true, display Restricted Monitor prompt (>).
testarea0One-byte scratch field, available for read/write test.
tpe-link-test?trueEnable 10baseT link test for built-in twisted pair Ethernet.
ttya-mode9600,8,n,1,-TTYA (baud rate, #bits, parity, #stop, handshake).
ttyb-mode9600,8,n,1,-TTYB (baud rate, #bits, parity, #stop, handshake).
ttya-ignore-cdtrueIf true, operating system ignores carrier-detect on TTYA.
ttyb-ignore-cdtrueIf true, operating system ignores carrier-detect on TTYB.
ttya-rts-dtr-offfalseIf true, operating system does not assert DTR and RTS on TTYA.
ttyb-rts-dtr-offfalseIf true, operating system does not assert DTR and RTS on TTYB.
use-nvramrc?falseIf true, execute commands in NVRAMRC during system start-up.
version2?trueIf true, hybrid (1.x/2.x) PROM comes up in version 2.x.
watchdog-reboot?falseIf true, reboot after watchdog reset.

Note - Not all OpenBoot systems support all parameters. Defaults may vary depending on the type of system and the PROM revision.

Displaying and Changing Parameter Settings

NVRAM configuration parameters can be viewed and changed using the commands listed in Table 3-2.
Table 3-2
CommandDescription
printenvDisplay all current parameters and current default values. (Numbers are usually shown as decimal values.) printenv parameter shows the current value of the named parameter.
setenv parameter valueSet parameter to the given decimal or text value. (Changes are permanent, but usually only take effect after a reset.)
set-default parameterReset the value of the named parameter to the factory default.
set-defaultsReset parameter values to the factory defaults.
The following pages show how these commands can be used.
To display a list of the current parameter settings on your system, type:

  ok printenv  
  Parameter Name        Value                          Default Value  
  
  oem-logo              2c 31 2c 2d 00 00 00 00 ...  
  oem-logo?             false                          false  
  oem-banner  
  oem-banner?           false                          false  
  output-device         ttya                           screen  
  input-device          ttya                           keyboard  
  sbus-probe-list       03                             0123  
  keyboard-click?       false                          false  
  keymap  
  ttyb-rts-dtr-off      false                          false  
  ttyb-ignore-cd        true                           true  
  ttya-rts-dtr-off      false                          false  
  ttya-ignore-cd        true                           true  
  ttyb-mode             9600,8,n,1,-                   9600,8,n,1,-  
  ttya-mode             9600,8,n,1,-                   9600,8,n,1,-  
  diag-file  
  diag-device           net                            net  
  boot-file  
  boot-device           disk                           disk  
  auto-boot?            false                          true  
  watchdog-reboot?      false                          false  
  fcode-debug?          true                           false  
  local-mac-address?    false                          false  
  use-nvramrc?          false                          false  
  nvramrc  
  screen-#columns       80                             80  
  screen-#rows          34                             34  
  sunmon-compat?        false                          true  
  security-mode         none                           none  
  security-password  
  security-#badlogins   0  
  scsi-initiator-id     7                              7  
  version2?             true                           true  
  hardware-revision  
  last-hardware-update  
  testarea              0                              0  
  mfg-switch?           false                          false  
  diag-switch?          true                           false  
  ok  

In the displayed, formatted list of the current settings, numeric parameters are shown in decimal, except where noted otherwise.
To change a parameter setting, type:

  setenv parameter value  

parameter is the name of the parameter. value is a numeric value or text string appropriate to the named parameter. A numeric value is typed as a decimal number, unless preceded by 0x, which is the qualifier for a hexadecimal number. Most parameter changes do not take effect until the next power cycle or system reset.
For example, to change the setting of the auto-boot? parameter from true to false, type:

  ok setenv auto-boot? false  
  ok  

You can reset one or most of the parameters to the original defaults using the set-default parameter and set-defaults commands.
For example, to reset the auto-boot? parameter to its original default setting (true), type:

  ok set-default auto-boot?  
  ok  

To reset most parameters to their default settings, type:

  ok set-defaults  
  ok  

Setting Security Parameters

The NVRAM system security parameters are:
  • security-mode
  • security-password
  • security-#badlogins
security-mode can restrict the set of actions that unauthorized users are allowed to perform from the Forth Monitor. The three security modes, listed in order of least to most secure, are:
  • none
  • command
  • full
The Restricted Monitor is used to implement the command and full modes. When security is set to command or full mode, the OpenBoot firmware will come up in the Restricted Monitor. In none security mode, it will come up in either the Forth Monitor or the Restricted Monitor, depending on which one is the default.
In none security mode, any command can be typed in the Restricted Monitor, and no password is required. In command and full security modes, passwords are required to execute certain commands. For example, a password is required to get to the Forth Monitor. Once you enter the Forth Monitor, however, a password is never required.
As with many NVRAM parameters, security-mode can be changed with the operating system eeprom utility.

Command Security

With security-mode set to command, the system comes up in the Restricted Monitor. In this monitor mode,
  • A password is not required if you type the b command. However, if you use the b command with a parameter, a password is required.
  • The c command never asks for a password.
  • A password is required to execute the n command.
Examples are shown in the following screen.

  > b              (no password required)  
  > c              (no password required)  
  > b filename      (password required)  
  PROM Password: (password is not echoed as it is typed)  
  > n              (password required)  
  PROM Password: (password is not echoed as it is typed)  

To set the security password and command security mode, type the following at the ok prompt:

  ok password  
  ok New password (only first 8 chars are used):  
  ok Retype new password:  
  ok setenv security-mode command  
  ok  


Note - Although this example works, you should normally set the two security parameters with the eeprom command from the operating system.

The security password you assign follows the same rules as the root password: a combination of six to eight letters and numbers. The security password can be the same as the root password, or different from it. You do not have to reset the system; the security feature takes effect as soon as you type the command.

CAUTION Caution - It is important to remember your security password. If you forget this password, you cannot use your system; you will have to call Sun's customer support service to make your machine bootable again.

If you enter an incorrect security password, there will be a delay of about 10 seconds before the next boot prompt appears. The number of times that an incorrect security password is typed is stored in the security-#badlogins parameter. This parameter is a 32-bit signed number (680 years worth of attempts at 10 seconds per attempt).

Full Security

The full security mode is the most restrictive. With security-mode set to full, the system comes up in the Restricted Monitor. In this mode:
  • A password is required any time you type the b command.
  • The c command never asks for a password.
  • A password is required to execute the n command.
Examples are shown below.

  > c              (no password required)  
  > b              (password required)  
  PROM Password: (password is not echoed as it is typed)  
  > b filename      (password required)  
  PROM Password: (password is not echoed as it is typed)  
  > n              (password required)  
  PROM Password: (password is not echoed as it is typed)  

To set the security password and full security, type the following at the ok prompt:

  ok password  
  ok New password (only first 8 chars are used):  
  ok Retype new password:  
  ok setenv security-mode full  
  ok  

Changing the Power-on Banner

The banner configuration parameters are:
  • oem-banner
  • oem-banner?
  • oem-logo
  • oem-logo?
To view the power-on banner, type:

  ok banner  

The PROM displays the system banner. The following example shows a SPARCstation 2 banner. The banner for your SPARC system may be different.

Gráfico

The banner consists of two parts: the text field and the logo (over serial ports, only the text field is displayed). You can replace the existing text field with a custom text message using the oem-banner and oem-banner? configuration parameters.
To insert a custom text field in the power-on banner, type:

  ok setenv oem-banner Hello Mom and Dad  
  ok setenv oem-banner? true  
  ok banner  
  ok  

The system displays the banner with your new message, as shown in the following screen.

Gráfico

However, the graphic logo must be handled somewhat differently. oem-logo is a 512-byte array, containing a total of 4096 bits arranged in a 64 x 64 array. Each bit controls one pixel. The most significant bit (MSB) of the first byte controls the upper-left corner pixel. The next bit controls the pixel to the right of it, and so on.
To create a new logo, first create a Forth array containing the correct data; then copy this array into oem-logo. In the following example, the array is created using Forth commands. (It could also be done under the operating system using the eeprom command.) The array is then copied using the to command. The example below fills the top half of oem-logo with an ascending pattern.

  ok create logoarray d# 512 allot  
  ok logoarray d# 256 0 do i over i + c! loop drop  
  ok logoarray d# 256 to oem-logo  
  ok setenv oem-logo? true  
  ok banner  

To restore the original Sun power-on banner, set the oem-logo? and oem-banner? parameters to false.

  ok setenv oem-logo? false  
  ok setenv oem-banner? false  
  ok  

Because the oem-logo array is so large, printenv displays approximately the first 8 bytes (in hexadecimal). Use the oem-logo dump command to display the entire array. The oem-logo array is not erased by set-defaults, since it might be difficult to restore the data. However, oem-logo? is set to false when set-defaults executes, so the custom logo is no longer displayed.

Input and Output Control

The configuration parameters related to the control of system input and output are:
  • input-device
  • output-device
  • screen-#columns
  • screen-#rows
  • ttya-mode
  • ttyb-mode
You can use these parameters to assign the power-on defaults for input and output and to adjust the communication characteristics of the TTYA and TTYB serial ports. Except for the ttya-mode and ttyb-mode results, these values do not take effect until the next power cycle or system reset.

Selecting Input and Output Device Options

The input-device and output-device parameters control the system's selection of input and output devices after a power-on reset. The default input-device value is keyboard and the default output-device value is screen. Input and output can be set to the values in Table 3-3.
Table 3-3
OptionsDescription
device-specifierDevice identified by that device path name or alias.
keyboard(Input only) Default system keyboard.
screen(Output only) Default graphics display.
ttyaSerial port A.
ttybSerial port B.
When the system is reset, the named device becomes the default input or output device. (If you want to temporarily change the input or output device, use the input or output commands described in Chapter 4, "Using Forth Tools.")
To set TTYA as the power-on default input device, type:

  ok setenv input-device ttya  
  ok  

If you select keyboard for input-device, and the device is not plugged in, input is accepted from ttya after the next power cycle or system reset. If you select screen for output-device, but no frame buffer is available, output is sent to ttya after the next power cycle or system reset.
To specify an SBus "bwtwo" frame buffer as the default output device (especially if there are multiple frame buffers in the system), type:

  ok setenv output-device /sbus/bwtwo  
  ok  

Setting Serial Port Characteristics

The default settings for both TTYA and TTYB for most Sun systems are:
9600 baud, 8 data bits, no parity, 1 stop bit, no handshake
The communications characteristics for the two serial ports, TTYA and TTYB, are set using the following values for the ttya-mode and ttyb-mode parameters:
  • baud = 110, 300, 1200, 2400, 4800, 9600, 19200, or 38400 bits/second
  • #bits = 5, 6, 7, or 8 (data bits)
  • parity = n (none), e (even), or o (odd), parity bit
  • #stop = 1 (1), . (1.5), or 2 (2) stop bits
  • handshake = - (none), h (hardware (rts/cts)), or s (software (xon/xoff)).
For example, to set TTYA to 1200 baud, seven data bits, even parity, one stop bit, and no handshake, type:

  ok setenv ttya-mode 1200,7,e,1,-  
  ok  

Changes to these parameter values take effect immediately.

Note - rts/cts and xon/xoff handshaking are not implemented on some systems. When a selected protocol is not implemented, the handshake parameter is accepted but ignored; no messages are displayed.

Selecting Boot Options

You can use the following configuration parameters to determine whether or not the system will boot automatically after a power cycle or system reset.
  • auto-boot?
  • boot-device
  • boot-file
If auto-boot? is true, then the system boots automatically (using the boot-device and boot-file values).
These parameters can also be used during manual booting to select the boot device and the program to be booted. For example, to specify auto-booting from the Ethernet server, type:

  ok setenv boot-device net  
  ok boot  

Specified booting usually begins immediately.

Note - boot-device and boot-file are specified differently with diag-switch? set to true. See the next section for more information.

Controlling Power-on Self-test

The power-on testing parameters are:
  • diag-device
  • diag-file
  • diag-switch?
  • mfg-switch?
  • selftest-#megs
Most systems have a factory default of false for the diag-switch? parameter. To set diag-switch? to true, type:

  ok setenv diag-switch? true  
  ok  

Enabling diag-switch? causes the system to perform more thorough self-tests during any subsequent power-on process. Once diag-switch? is enabled, additional status messages are sent out (some to TTYA and some to the specified output device), all of memory is tested, and different default boot options are used. The boot PROM tries to boot the program specified by the diag-file parameter, from the device specified by diag-device.

Note - Some SPARC systems have a hardware diagnostic switch. The system runs the full tests on power-on if either the hardware switch or diag-switch? is set.

You can also force diag-switch? to true by using the Stop-D key sequence during power-on.
To set diag-switch? to false, type:

  ok setenv diag-switch? false  
  ok  

When diag-switch? is false, the system does not call out the diagnostic tests as they are run (unless a test fails) and runs a reduced set of diagnostics.

Using NVRAMRC

A portion of NVRAM, whose size depends on the particular SPARC system, is called NVRAMRC. It is reserved to store user-defined commands that are executed during start-up.
Typically, NVRAMRC would be used by a device driver to save start-up configuration parameters, to patch device driver code, or to define installation-specific device configuration and device aliases. It also could be used for bug patches or for user-installed extensions. Commands are stored in ASCII, just as the user would type them at the console.
There are two NVRAMRC-related configuration parameters:
  • nvramrc
  • use-nvramrc?
Commands in NVRAMRC are executed during system start-up if use-nvramrc? is set to true. Almost all Forth Monitor commands can be used here. The following are exceptions:
  • banner (use with caution)
  • boot
  • go
  • nvedit
  • password
  • reset
  • setenv security-mode

Editing the Contents of NVRAMRC

The NVRAMRC editor, nvedit, lets you create and modify the contents of NVRAMRC using the commands listed in Table 3-4.
Table 3-4
CommandDescription
nvalias alias device-pathStore the command "devalias alias device-path" in NVRAMRC. The alias persists until the nvunalias or set-defaults commands are executed.
nveditEnter the NVRAMRC editor. If data remains in the temporary buffer from a previous nvedit session, resume editing those previous contents. If not, read the contents of NVRAMRC into the temporary buffer and begin editing it.
nvquitDiscard the contents of the temporary buffer, without writing it to NVRAMRC. Prompt for confirmation.
nvrecoverRecover the contents of NVRAMRC if they have been lost as a result of the execution of set-defaults; then enter the editor as with nvedit. nvrecover fails if nvedit is executed between the time that the NVRAMRC contents were lost and the time that nvrecover is executed.
nvrunExecute the contents of the temporary buffer.
nvstoreCopy the contents of the temporary buffer to NVRAMRC; discard the contents of the temporary buffer.
nvunalias aliasDelete the corresponding alias from NVRAMRC.

Note - Not all OpenBoot 2.x systems include the nvalias and nvunalias commands.

The editing commands shown in Table 3-5 are used within the NVRAM editor.
Table 3-5 nvedit
KeystrokeDescription
Control-BMove backward one character.
Control-CExit the editor and return to the OpenBoot command interpreter. The temporary buffer is preserved but is not written back to NVRAMRC. (Use nvstore afterwards to write back the temporary buffer.)
Control-FMove forward one character.
Control-KIf at the end of a line, join the next line to the current line (that is, delete the new line).
Control-LList all lines.
Control-NMove to the next line of the NVRAMRC editing buffer.
Control-OInsert a new line at the cursor position and stay on the current line.
Control-PMove to the previous line of the NVRAMRC editing buffer.
DeleteDelete the previous character.
ReturnInsert a new line at the cursor position and advance to the next line.
Other standard line editor commands are described in Chapter 4, "Using Forth Tools."

Activating an NVRAMRC File

Use the following steps to activate an NVRAMRC command file:
  1. At the ok prompt, type nvedit

    Edit the contents of NVRAMRC using editor commands.

  2. Type Control-C to get out of the editor and back to the ok prompt.

  3. Type nvstore to save your changes.

  4. Enable the interpretation of NVRAMRC by typing: setenv use-nvramrc? true

  5. Type reset to reset the system and execute the NVRAM contents, or type nvramrc eval to execute the contents directly. If you have not yet typed nvstore to save your changes, type nvrun to execute the contents of the temporary edit buffer.

The following example shows you how to create a simple colon definition in NVRAMRC.

  ok nvedit  
  0: : hello ( -- )  
  1: ." Hello, world. " cr  
  2: ;  
  3: ^-C  
  ok nvstore  
  ok setenv use-nvramrc? true  
  ok reset  
  ....  
  ok hello  
  Hello, world.  
  ok  

Notice the nvedit line number prompts (0:, 1:, 2:, 3:) in the above example. These prompts may be different on some systems.