Содержащиеся вНайти другие документыРесурсы поддержки | Загрузить это руководство в формате PDF (323 КБ)
Chapter 3 Setting Configuration ParametersThis 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
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 SettingsNVRAM configuration parameters can be viewed and changed using the commands listed in Table 3-2. Table 3-2 Viewing/Changing Configuration Parameters
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 Setting Security ParametersThe 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 SecurityWith 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 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. 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 SecurityThe full security mode is the most restrictive. With security-mode set to full, the system comes up in the Restricted Monitor. In this mode:
> 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 BannerThe 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: 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. Input and Output ControlThe 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 OptionsThe 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
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 CharacteristicsThe 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,- 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 OptionsYou 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-testThe 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 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 NVRAMRCA 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 NVRAMRCThe 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
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 Table 3-5 nvedit Keystroke Commands
Other standard line editor commands are described in Chapter 4, Using Forth Tools. Activating an NVRAMRC FileUse the following steps to activate an NVRAMRC command file:
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. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||