OpenBoot 3.x Command Reference Manual

Redirecting Input and Output

Normally, OpenBoot uses a keyboard for command input, and a frame buffer with a connected display screen for display output. (Server systems may use an ASCII terminal connected to a serial port. For more information on how to connect a terminal to your system, see your system's installation manual.) You can redirect the input, the output, or both, to a serial port. This may be useful, for example, when debugging a frame buffer.

Table 4-23 lists commands you can use to redirect input and output.

Table 4-23 I/O Redirection Commands

Command  

Stack Diagram 

Description 

input

( device -- ) 

Select device, for example ttya, keyboard, or device-specifier, for subsequent input.

io

( device -- ) 

Select device for subsequent input and output.  

output

( device -- ) 

Select device, for example ttya, keyboard, or device-specifier, for subsequent output.

The commands input and output temporarily change the current devices for input and output. The change takes place as soon as you enter a command; you do not have to reset your system. A system reset or power cycle causes the input and output devices to revert to the default settings specified in the NVRAM configuration variables input-device and output-device. These variables can be modified, if needed (see Chapter 3, Setting Configuration Variables).

input must be preceded by one of the following: keyboard, ttya, ttyb, or device-specifier text string. For example, if input is currently accepted from the keyboard, and you want to make a change so that input is accepted from a terminal connected to the serial port ttya, type:


ok ttya input
ok

At this point, the keyboard becomes nonfunctional (except perhaps for Stop-A), but any text entered from the terminal connected to ttya is processed as input. All commands are executed as usual.

To resume using the keyboard as the input device, use the terminal keyboard to type:


ok keyboard input
ok

Similarly, output must be preceded by one of the following: screen, ttya, or ttyb or device-specifier. For example, if you want to send output to a serial port instead of the normal display screen, type:


ok ttya output
ok

The screen does not show the answering ok prompt, but the terminal connected to the serial port shows the ok prompt and all further output as well.

io is used in the same way, except that it changes both the input and output to the specified place. For example:


ok ttya io
ok 

Generally, the argument to input, output, and io is a device-specifier, which can be either a device path name or a device alias. The device must be specified as a Forth string, using double quotation marks ("), as shown in the two examples below:


ok " /sbus/cgsix" output

or:


ok " screen" output

In the preceding examples, keyboard, screen, ttya, and ttyb are predefined Forth words that put their corresponding device alias string on the stack.