C H A P T E R 3

Setting Configuration Parameters

This chapter describes how to access and modify non-volatile RAM (NVRAM) configuration parameters.

S ystem 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 , for information about entering the Forth Monitor.

lists current NVRAM configuration parameters.

TABLE 3-1 NVRAM Configuration Parameters


Typical Default




If true, boot automatically after power on or reset.



Device from which to boot.


empty string

File to boot (an empty string lets secondary booter choose default).



Boot device and file (1. x only).



Diagnostic boot device and file (1. x only).



Diagnostic boot source device.


empty string

File from which to boot in diagnostic mode.



If true, run in diagnostic mode.



If true, include name fields for plug-in device FCodes.


no default

System version information.



Power-on input device (usually keyboard , ttya , or ttyb ).



If true, enable keyboard click.


no default

Keymap for custom keyboard.


no default

System update information.



If true, network drivers use their own MAC address, not system's.



If true, repeat system self-tests until interrupted with Stop-A .



Contents of NVRAMRC .


empty string

Custom OEM banner (enabled by oem-banner? true ).



If true, use custom OEM banner.


no default

Byte array custom OEM logo (enabled by oem-logo? true ).

Displayed in hexadecimal.



If true, use custom OEM logo (else, use Sun logo).



Power-on output device (usually screen , ttya , or ttyb ).



Which SBus slots are probed and in what order.



Number of on-screen columns (characters/line).



Number of on-screen rows (lines).



SCSI bus address of host adapter, range 0-7.



Map SCSI disk units (1. x only).


no default

Number of incorrect security password attempts.



Firmware security level (options: none , command , or full ).


no default

Firmware security password (never displayed). Do not set this directly .



Megabytes of RAM to test. Ignored if diag-switch? is true .



If true, POST does not do VMEbus loopback tests.



Map SCSI tape units (1. x only).



If true, display Restricted Monitor prompt (>).



One-byte scratch field, available for read/write test.



Enable 10baseT link test for built-in twisted pair Ethernet.



TTYA ( baud rate, #bits, parity, #stop, handshake).



TTYB (baud rate, #bits, parity, #stop, handshake).



If true, operating system ignores carrier-detect on TTYA.



If true, operating system ignores carrier-detect on TTYB.



If true, operating system does not assert DTR and RTS on TTYA.



If true, operating system does not assert DTR and RTS on TTYB.



If true, execute commands in NVRAMRC during system start-up.



If true, hybrid (1. x /2. x ) PROM comes up in version 2. x .



If 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 Viewing/Changing Configuration Parameters




Display 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 value

Set parameter to the given decimal or text value.

(Changes are permanent, but usually only take effect after a reset.)

set-default parameter

Reset the value of the named parameter to the factory default.


Reset 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?           false                          false
output-device         ttya                           screen
input-device          ttya                           keyboard
sbus-probe-list       03                             0123
keyboard-click?       false                          false
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-device           net                            net
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
screen-#columns       80                             80
screen-#rows          34                             34
sunmon-compat?        false                          true
security-mode         none                           none
security-#badlogins   0                              
scsi-initiator-id     7                              7
version2?             true                           true
testarea              0                              0
mfg-switch?           false                          false
diag-switch?          true                           false

In the displayed, formatted list of the current settings, numeric parameters are shown in decimal, except where otherwise noted.

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

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?

To reset most parameters to their default settings, type:

ok set-defaults

Setting Security Parameters

The NVRAM system security parameters are:

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:

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.

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,

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 

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 - 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:

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 

Changing the Power-on Banner

The banner configuration parameters are:

To view the power-on banner, type:.

ok banner
            SPARCstation 2, Type 4 Keyboard 
            ROM Rev. 2.0, 16MB memory installed, Serial # 289
            Ethernet address 8:0:20:d:e2:7b, Host ID: 55000121

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

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
             Hello Mom and Dad

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

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

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:

You can use these parameters to assign the power-on defaults for input and output and 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 I/O Device Parameters




Device identified by that device path name or alias.


(Input only) Default system keyboard.


(Output only) Default graphics display.


Serial port A.


Serial 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 .)

To set TTYA as the power-on default input device, type:

ok setenv input-device ttya

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 SBu s 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 

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:

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,- 

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.

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:

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 

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 

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.


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:

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 :

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 NVRAMRC Editor Commands



nvalias alias device-path

Store the command " devalias alias device-path " in NVRAMRC. The alias persists until the nvunalias or set-defaults commands are executed.


Enter 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 them.


Discard the contents of the temporary buffer, without writing it to NVRAMRC. Prompt for confirmation.


Recover 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.


Execute the contents of the temporary buffer.


Copy the contents of the temporary buffer to NVRAMRC; discard the contents of the temporary buffer.

nvunalias alias

Delete the corresponding alias from NVRAMRC.

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

The editing commands shown in are used within the NVRAM

TABLE 3-5 nvedit Keystroke Commands




Move backward one character.


Exit 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.)


Move forward one character.


If at the end of a line, join the next line to the current line (that is, delete the new line).


List all lines.


Move to the next line of the NVRAMRC editing buffer.


Insert a new line at the cursor position and stay on the current line.


Move to the previous line of the NVRAMRC editing buffer.


Delete the previous character.


Insert a new line at the cursor position and advance to the next line.

Other standard line editor commands are described in Chapter 4 .

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.

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

Copyright © 2001, Sun Microsystems, Inc. All rights reserved.