Control flow of the diagnostic controller

Use the topic to learn about the control flow of the Diagnostic Controller with the diag command.

Invoking the diag command without any flags starts the Diagnostic Controller which performs the following:

  1. Displays the Operating Instructions menu. The version number will reflect the version of the Diagnostic code installed.
  2. Displays the Function Selection menu, and starts the command associated with the user's selection.

Invoking the diag command with flags starts the Diagnostic Controller and passes the flags on to the Controller.

The Diagnostic Controller performs the following tasks:

  1. Initialize the user interface. It is assumed that if there is no display and keyboard, then the initialization will fail.
    • If -a, then performs configuration management.
    • If -s, then performs system checkout once.
    • If -S#, then runs diagnostics on the resources indicated by the Test Suite ID.
    • If a flag was not specified, Diagnostics prompts the user.
  2. From the Function Selection Menu, allows the user to select one of the following:
    • Select Diagnostics
    • Select Advanced Diagnostics
    • Select Task Selection Menu
    • Select Resource Selection Menu
  3. If Diagnostics or Advanced Diagnostics is selected, then the following happens:
    • The Diagnostic Mode Selection menu is displayed, to determine if System Verification or Problem Determination should be run.
    • If Problem Determination is chosen, then the Diagnostic Controller automatically scans the error log for any PERMANENT HARDWARE errors that have been logged within the last 7 days to determine if any devices should be automatically tested. A problem report may be generated.
    • Walks the configuration database to determine which resources in the current configuration can be tested. This information is presented in the Resource Selection Menu.
    • If Advanced Diagnostics Routines is chosen, and the system is in Online Service mode of operation, the Diagnostic Controller will display the Test Method menu to determine if the tests should be repeated.
    • Initializes the input parameters to the Diagnostic Application (DA), which are contained in the TMInput - Test Mode Input object class.
    • Runs the Diagnostic Application (DA) of the resource to be tested.
    • Waits for the DA to complete.
    • The Diagnostic Controller then:
      • Performs isolation process.
      • Presents conclusions to the screen.
      • If no trouble is found, diagnostics exits with a return value of 0. Otherwise, a value of 1 is returned if the hardware was tested bad.
  4. If Task Selection Menu is selected, then the following happens:
    • The Diagnostic Controller displays a list of Tasks that are available for the system.
    • After a task has been selected, a Resource Selection Menu appears if the selected task supports a resource selection. After selection of a Resource, the task is called with the selected resource name as a command-line argument.
    • If the selected task does not support resource selection, then the task is invoked.
  5. If Resource Selection Menu is selected, then the following happens:
    • The Diagnostic Controller displays a list of Resources available on the system.
    • After a Resource has been selected, a Task Selection Menu will appear containing the commonly supported tasks for each selected Resource. After selection of a task, the task is invoked.

Return Status

The Diagnostic Controller returns the following values:

Diagnostic Controller Value Meaning
DIAG_EXIT_GOOD 0 No problems found
DIAG_EXIT_DEVICE_ERROR 1 Error running diagnostics
DIAG_EXIT_INTERRUPT 2 Received an interrupt while running diagnostics
DIAG_EXIT_NO_DEVICE 3 Device to test was not found in system configuration
DIAG_EXIT_BUSY 4 Another Dctrl program is running
DIAG_EXIT_LOCK_ERROR 5 Cannot create lock file for diagnostic controller
DIAG_EXIT_OBJCLASS_ERROR 6 Error accessing ODM database
DIAG_EXIT_USAGE 7 Usage error
DIAG_EXIT_SCREEN 8 Screen size incorrect
DIAG_EXIT_NoPDiagDev 9 Device not supported by diagnostics
DIAG_EXIT_NO_DIAGSUPPORT 10 Diagnostics is not supported
DIAG_EXIT_NOT_MISSING 11 Device is not missing
DIAG_EXIT_NO_AUTHORIZATION 12 User is not authorized to run diagnostics
DIAG_EXIT_KERNSUPPORT 13 Device is not supported on the 64-bit kernel