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 NVRAM Configuration Parameters
Parameter |
Typical Default |
Description |
---|---|---|
auto-boot? |
true |
If true, boot automatically after power on or reset. |
boot-device |
disk |
Device from which to boot. |
boot-file |
empty string |
File to boot (an empty string lets secondary booter choose default). |
boot-from |
vmunix |
Boot device and file (1.x only). |
boot-from-diag |
le()vmunix |
Diagnostic boot device and file (1.x only). |
diag-device |
net |
Diagnostic boot source device. |
diag-file |
empty string |
File from which to boot in diagnostic mode. |
diag-switch? |
false |
If true, run in diagnostic mode. |
fcode-debug? |
false |
If true, include name fields for plug-in device FCodes. |
hardware-revision |
no default |
System version information. |
input-device |
keyboard |
Power-on input device (usually keyboard, ttya, or ttyb). |
keyboard-click? |
false |
If true, enable keyboard click. |
keymap |
no default |
Keymap for custom keyboard. |
last-hardware-update |
no default |
System update information. |
local-mac-address? |
false |
If true, network drivers use their own MAC address, not system's. |
mfg-switch? |
false |
If true, repeat system self-tests until interrupted with Stop-A. |
nvramrc |
empty |
Contents of NVRAMRC. |
oem-banner |
empty string |
Custom OEM banner (enabled by oem-banner? true). |
oem-banner? |
false |
If true, use custom OEM banner. |
oem-logo |
no default |
Byte array custom OEM logo (enabled by oem-logo? true). Displayed in hexadecimal. |
oem-logo? |
false |
If true, use custom OEM logo (else, use Sun logo). |
output-device |
screen |
Power-on output device (usually screen, ttya, or ttyb). |
sbus-probe-list |
0123 |
Which SBus slots are probed and in what order. |
screen-#columns |
80 |
Number of on-screen columns (characters/line). |
screen-#rows |
34 |
Number of on-screen rows (lines). |
scsi-initiator-id |
7 |
SCSI bus address of host adapter, range 0-7. |
sd-targets |
31204567 |
Map SCSI disk units (1.x only). |
security-#badlogins |
no default |
Number of incorrect security password attempts. |
security-mode |
none |
Firmware security level (options: none, command, or full). |
security-password |
no default |
Firmware security password (never displayed). Do not set this directly. |
selftest-#megs |
1 |
Megabytes of RAM to test. Ignored if diag-switch? is true. |
skip-vme-loopback? |
false |
If true, POST does not do VMEbus loopback tests. |
st-targets |
45670123 |
Map SCSI tape units (1.x only). |
sunmon-compat? |
false |
If true, display Restricted Monitor prompt (>). |
testarea |
0 |
One-byte scratch field, available for read/write test. |
tpe-link-test? |
true |
Enable 10baseT link test for built-in twisted pair Ethernet. |
ttya-mode |
9600,8,n,1,- |
TTYA (baud rate, #bits, parity, #stop, handshake). |
ttyb-mode |
9600,8,n,1,- |
TTYB (baud rate, #bits, parity, #stop, handshake). |
ttya-ignore-cd |
true |
If true, operating system ignores carrier-detect on TTYA. |
ttyb-ignore-cd |
true |
If true, operating system ignores carrier-detect on TTYB. |
ttya-rts-dtr-off |
false |
If true, operating system does not assert DTR and RTS on TTYA. |
ttyb-rts-dtr-off |
false |
If true, operating system does not assert DTR and RTS on TTYB. |
use-nvramrc? |
false |
If true, execute commands in NVRAMRC during system start-up. |
version2? |
true |
If true, hybrid (1.x/2.x) PROM comes up in version 2.x. |
watchdog-reboot? |
false |
If true, reboot after watchdog reset. |
Not all OpenBoot systems support all parameters. Defaults may vary depending on the type of system and the PROM revision.
NVRAM configuration parameters can be viewed and changed using the commands listed in Table 3-2.
Table 3-2 Viewing/Changing Configuration Parameters
Command |
Description |
---|---|
printenv |
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. |
set-defaults |
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 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 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 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
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.
security-mode can be changed with the operating system eeprom utility.
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, unless you use the command with a parameter.
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
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.
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).
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 when you type the b command.
The c command never asks for a password.
A password is required to execute the n command.
> 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
The banner configuration parameters are:
oem-banner
oem-banner?
oem-logo
oem-logo?
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 ok
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 ok
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 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.
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 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.
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 I/O Device Parameters
Options |
Description |
---|---|
device-specifier |
Device identified by that device path name or alias. |
keyboard |
(Input only) Default system keyboard. |
screen |
(Output only) Default graphics display. |
ttya |
Serial port A. |
ttyb |
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, 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
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.
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.
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.
boot-device and boot-file are specified differently with diag-switch? set to true. See the next section for more information.
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.
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.
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
The NVRAMRC editor, nvedit, lets you create and modify the contents of NVRAMRC using the commands listed in Table 3-4.
Table 3-4 NVRAMRC Editor Commands
Command |
Description |
---|---|
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. |
nvedit |
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. |
nvquit |
Discard the contents of the temporary buffer, without writing it to NVRAMRC. Prompt for confirmation. |
nvrecover |
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. |
nvrun |
Execute the contents of the temporary buffer. |
nvstore |
Copy the contents of the temporary buffer to NVRAMRC; discard the contents of the temporary buffer. |
nvunalias alias |
Delete the corresponding alias from NVRAMRC. |
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
Table 3-5 nvedit Keystroke Commands
Keystroke |
Description |
---|---|
Control-B |
Move backward one character. |
Control-C |
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.) |
Control-F |
Move forward one character. |
Control-K |
If at the end of a line, join the next line to the current line (that is, delete the new line). |
Control-L |
List all lines. |
Control-N |
Move to the next line of the NVRAMRC editing buffer. |
Control-O |
Insert a new line at the cursor position and stay on the current line. |
Control-P |
Move to the previous line of the NVRAMRC editing buffer. |
Delete |
Delete the previous character. |
Return |
Insert 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.
Use the following steps to activate an NVRAMRC command file:
At the ok prompt, type nvedit
Edit the contents of NVRAMRC using editor commands.
Type Control-C to get out of the editor and back to the ok prompt.
Type nvstore to save your changes.
Enable the interpretation of NVRAMRC by typing: setenv use-nvramrc? true
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.