OpenBoot 2.x Command Reference Manual

Redirecting Input and Output

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

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

Table 4-15 I/O Redirection Commands

Command  

Stack Diagram 

Description 

input

( device -- ) 

Select device (keyboard, or device-specifier) for input.

io

( device -- ) 

Select device for input and output.  

output

( device -- ) 

Select device (screen, or device-specifier) for output.

The commands input and output temporarily change the current devices for input and output. The change occurs when 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 parameters input-device and output-device. These parameters can be modified, if needed (see Chapter 3, Setting Configuration Parameters for information about changing defaults).

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 non-functional (except 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. For example, if you want to send output to TTYA instead of the normal display screen, type:


ok ttya output 

The screen does not show the answering ok prompt, but the terminal connected to TTYA 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.

Generally, input, output, and io take 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, ttya, screen, and keyboard are Forth words that put their corresponding device alias string on the stack.