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.
Note - 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 .
The following pages show how these commands can be used.
To display a list of the current parameter settings on your system, type:
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:
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:
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:
To reset most parameters to their default settings, type:
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.
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.
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.
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:
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:
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:
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 .
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:
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 .
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:
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:
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:
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. |
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:
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. |
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:
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:
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 :
The NVRAMRC editor, nvedit , lets you create and modify the contents of NVRAMRC using the commands listed in .
Note - Not all OpenBoot 2.x systems include the nvalias and nvunalias commands. |
The editing commands shown in are used within the NVRAM
Other standard line editor commands are described in Chapter 4 .
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.