DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Driver testing and debugging

Setting up a remote console for debugging

It is useful to set up a remote serial terminal to act as the console during a debugging session. When the remote serial console is set up, all console output (including the boot: prompt) goes to the serial terminal.

Use the script(TC) command with cu from an xterm window to the remote console to display the debug output in the xterm window and save it to a file. For example:

   script
   cu -l /dev/tty2a
When you quit the shell started with script, the output is in the typescript file (or another file you specify). To append more data to that same file, use script -a.

Setting up a remote serial console on SVR5


NOTE: Early releases of SVR5 require the serial console patch in order to use this procedure.

When the system boots, go into the boot command line interface and add the boot parameter:

   CONSOLE=iasy(<minor> [, <line_mode>])

<minor>
Use 2 for COM1 or 6 for COM2. If you do not specify <minor>, the system defaults to minor 0, which does not work unless the terminal asserts the DCD line.

<line_mode>
See the boot manual page for a list of valid line parameters. If you do not specify any line parameters, the system defaults to 9600,N,8,1. Note that these are the same defaults used by the Linux minicom terminal emulator.

The serial root console does not do flow control, so data may be corrupted if the output exceeds the console's rate of data consumption. The maximum line speed of 115200 (set B115K2 as a baud rate) is usually adequate to display the data appropriately, but some problems may occur at 9600 baud and problems are likely at 2400 baud.

Setting up remote debug console for SVR5

You can set up either another SVR5 system or an SCO OpenServer 5 system to serve as a remote console for running the kernel debuggers on a SVR5 system. Yo can also use a Linux system running the minicom terminal emulator or a Windows system running HyperTerminal. To do this:

  1. Get a NULL Modem cable and set up the /usr/lib/uucp/Devices file on both systems to establish a simple serial session. For example, to use Com1 on the remote machine, add the following to the remote Devices file:
       Direct tty1a - 9600 direct
    
    To use Com2 on the local machine, add the following to the local Devices file:
       Direct tty2a - 9600 Direct
    

  2. Create the /stand/kdb.rc file on the local system. Insert at least two blank lines if you do not require other content.

  3. Add the following line to the /stand/boot file on the local machine:
       files+=kdb.rc
    

  4. On the remote machine, issue the cu command. If you are using Com1 on the remote machine, the command is:
       cu -l tty1a
    
    This entry matches the Devices file set up in Step #1. You can omit this step if you are using a real serial terminal.

  5. Test the connection by cating a file such as /etc/passwd:
       cat /etc/passwd >> /dev/tty1a
    
    The contents of the passwd file should appear on the remote cu session.

  6. Reboot the target machine and issue the <Ctrl><Alt>d sequence to initialize kdb. At the kdb>> prompt, issue the following command if Com2 is the port being used on the test target:
       kdb>> "iasy" 6 newterm
    
    6 is the minor number of the com port on the test target. If you are using Com1, substitute 0 for the 6.

  7. Press return and the output from kdb should appear on the remote terminal. All kdb commands can be typed on the remote system.

  8. To switch back to the local SVR5 console, issue the following at the kdb prompt:
       kdb>> "kd" 0 newterm
    

Setting up a serial terminal console on SCO OpenServer 5

To set up a serial terminal on SCO OpenServer 5, plug a serial console into a serial port and do one of the following to set that serial port to be the system console:


© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005