Go to main content

Writing Device Drivers for Oracle® Solaris 11.3

Exit Print View

Updated: March 2019

Testing With a Serial Connection

Using a serial connection is a good way to test drivers. Use the tip(1) command to make a serial connection between a host and a test system. With this approach, the tip window on the host console is used as the console of the test system See the tip(1) man page for additional information.

    A tip window has the following advantages:

  • Interactions with the test system and kernel debuggers can be monitored. For example, the window can keep a log of the session for use if the driver crashes the test system.

  • The test system can be accessed remotely by logging into a tip host system and using tip(1) to connect to the test ystem.

Note -  Although using a tip connection and a second system are not required to debug an Oracle Solaris device driver, this technique is still recommended.

To Set Up the Host for a tip Connection

  1. Connect the host to the test system using serial port A on both systems.

    This connection must be made with a null modem cable.

  2. On the host make sure there is an entry in /etc/remote for the connection. See the remote(4) man page for details.

    The terminal entry must match the serial port that is used. The operating system comes with the correct entry for serial port B, but a terminal entry must be added for serial port A:


    Note - The baud rate must be set to 9600.
  3. In a shell window on the host, run tip(1) and specify the name of the entry:
    % tip debug

    The shell window is now a tip window with a connection to the console of the test system.


    Caution  -  Do not use STOP-A for SPARC systems or F1-A for x86 architecture systems on the host o stop the test system. This action actually stops the host. To send a break to the test system, type ~# in the tip window. Commands such as ~# are recognized only if these characters on first on the line. If the command has no effect, press either the Return key or Control-U.

Setting Up a Target System on the SPARC Platform

A quick way to set up the test system on the SPARC platform is to unplug the keyboard before turning on the system. The system then automatically uses serial port A as the console.

Another way to set up the test system is to use boot PROM commands to make serial port A the console. On the test system, at the boot PROM ok prompt, direct console I/O to the serial line. To make the test system always come up with serial port A as the console, set the environment variables: input-device and output-device.

Example 124  Setting input-device and output-device With Boot PROM Commands
ok setenv input-device ttya
ok setenv output-device ttya

The eeprom command can also be used to make serial port A the console. As superuser, execute the following commands to make the input-device and output-device parameters point to serial port A. The following example demonstrates the eeprom command.

Example 125  Setting input-device and output-device With the eeprom Command
# eeprom input-device=ttya
# eeprom output-device=ttya

The eeprom commands cause the console to be redirected to serial port A at each subsequent system boot.

Setting Up a Target System on the x86 Platform

On x86 platforms, use the eeprom command to make serial port A the console. This procedure is the same as the SPARC platform procedure. See Setting Up a Target System on the SPARC Platform. The eeprom command causes the console to switch to serial port A (COM1) during reboot.

Note -  x86 systems do not transfer console control to the tip connection until an early stage in the boot process unless the BIOS supports console redirection to a serial port. In SPARC systems, the tip connection maintains console control throughout the boot process.