Writing Device Drivers

Setting Up a tip(1) Connection

A serial connection can be made between a test system (the machine executing the code to be debugged) and a host system using tip(1). This connection enables a window on the host system, called a tip window, to be used as the console of the test machine. See tip(1) for additional information.


Note -

A second machine is not required to debug a Solaris 7 device driver. It is only required for the use of tip(1).


Using a tip window confers the following advantages:

Setting Up the Host System

To set up the host system, do the following:

  1. Connect the host system to the test machine using serial port A on both machines. This connection must be made with a null modem cable.

  2. On the host system, make an entry in /etc/remote for the connection if it is not already there (see remote(4)).

    The terminal entry must match the serial port being used. The Solaris 7 operating environment comes with the correct entry for serial port B, but a terminal entry must be added for serial port A:

    debug:\
    
    	:dv=/dev/term/a:br#9600:el=^C^S^Q^U^D:ie=%$:oe=^D:

    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:

    test% tip debugconnected

    The shell window is now a tip window connected to the console of the test machine.


    Caution - Caution -

    Do not use L1-A (for SPARC machines) or Control-ALT-D (for x86 machines) on the host machine to send a break to stop the test machine. This action actually stops the host machine. To send a break to the test machine, type ~# in the tip window. Commands such as this are recognized only if they are the first characters on a line, so press the Return key or Control-U first if there is no effect.


Setting Up the Test System for SPARC Platforms

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

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

ok setenv input-device ttyaok setenv output-device ttya

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

eeprom input-device=ttya
eeprom output-device=ttya

Executing the eeprom commands causes the console to switch to serial port A during reboot.

Setting Up the Test System for x86 Platforms

On x86 platforms, use the eeprom command to make serial port A the console. The procedure for this is the same as for SPARC platform and is discussed above. Executing the eeprom commands causes the console to switch to serial port A (COM1) during reboot.


Note -

Unlike SPARC machines, where the tip connection maintains console control throughout the boot process, x86 machines don't transfer console control to the tip connection until an early stage in the boot process.