Description:
    This batch file attempts to verify that the level 7 serial port diagnostic commands
    can be executed.
   
******************************************************************************************
    Clear the Expected Batch File Errors.
   ******************************************************************************************
    -*9                                 All Level '*' Command: Special Batch File Function - Clear Expected Errors
   
******************************************************************************************
    Enable error logging and clear the error log.
   ******************************************************************************************
    -/LE1                               Level L 'E' Command: Enable / Disable Logging
    -/LiFFFC                            Level L 'i' Command: Initialize Log File
   
******************************************************************************************
    Display the help information for the Level 7 commands.
   ******************************************************************************************
    -/CQ7                               Level C 'Q' Command: Display ASCII Command Information
   
******************************************************************************************
    Change to Command Level 7.
   ******************************************************************************************
    -/7                                 All Level '/' Command: Change Diagnostic Command Level
   
******************************************************************************************
    Display the active error log.
   ******************************************************************************************
    -E                                  'E' Command: Display / Edit Log
   
******************************************************************************************
    Test the buffer memory access commands.
   ******************************************************************************************
    -P                                  'P' Command: Set Buffer Pattern
    -B                                  'B' Command: Buffer Display
    -C                                  'C' Command: Buffer Copy
   
******************************************************************************************
    Test the hardware access commands.
   
    Display the Preamp Head Resistance.
    Display Preamp Register 0.
    Display Channel Register 0.
    Display the Termistor Temperature.
    Display the Preamp Temperature.
   ******************************************************************************************
    -X                                  'X' Command: Display Preamp Head Resistance
    -t0,0                               't' Command: Read Peripheral Register - Preamp Register 0
    -t1,0                               't' Command: Read Peripheral Register - Channel Register 0
    -D                                  'D' Command: Display Temperature - Thermistor
    -D,2                                'D' Command: Display Temperature - Preamp
   
******************************************************************************************
    Test the spin commands.
   ******************************************************************************************
    -Z                                  'Z' Command: Spin Down Drive
    -/2U                                Level 2 'U' Command: Spin Up Drive
    -/7                                 All Level '/' Command: Change Diagnostic Command Level
   
******************************************************************************************
    Test the seek commands.  Set the Test Space to single track mode  before testing the
    seek commands.  This will initialize the diagnostic current and target address for
    future commands that use them.
   ******************************************************************************************
    -A0                                 All Level 'A' Command: Set Test Space
    -S200,0                             'S' Command: Seek to Logical Cylinder and Head
    -.                                  Online '.' Command: Display Active Status
    -H0                                 'H' Command: Select Logical Head
    -.                                  Online '.' Command: Display Active Status
   
******************************************************************************************
    Test the address translation commands.
   ******************************************************************************************
    -x                                  'x' Command: Display Zone Information
   
******************************************************************************************
    Test the retry commands by displaying the current retry configuration.
   ******************************************************************************************
    -Y                                  'Y' Command: Set Retries
    -y                                  'y' Command: Set DERP Retry State
   
******************************************************************************************
    Disable and enable Write Faults.
   ******************************************************************************************
    -u0                                 'u' Command: Enable / Disable Write Fault - Disable
    -u1                                 'u' Command: Enable / Disable Write Fault - Enable
   
******************************************************************************************
    Test the read and write commands.
   
    The Erase Track operation is performed before the write operation to guarantee that
    the sector and buffer configuration will be restored to the standard mode before
    exiting.  After erasing the track attempt to read it and verify that a read error
    occurs.
   
    Writes are performed before reads to guarantee that the track has been written in the
    desired format.
   
    Note: Since we are reading and writing on a track whose defect status is unknown, the
    read commands may generate errors (DiagError 5003).
   ******************************************************************************************
    -b                                  'b' Command: Erase Track
    -.                                  Online '.' Command: Display Active Status
    -A0                                 All Level 'A' Command: Set Test Space
    -S200,0                             'S' Command: Seek to Logical Cylinder and Head
    -.                                  Online '.' Command: Display Active Status
    -*A,5003,1,1                        All Level '*' Command: Special Batch File Function - Set Expected Error
    -R                                  'R' Command: Read CHS
    -.                                  Online '.' Command: Display Active Status
    -W                                  'W' Command: Write CHS
    -.                                  Online '.' Command: Display Active Status
    -*A,5003,0,1                        All Level '*' Command: Special Batch File Function - Set Expected Error
    -R                                  'R' Command: Read CHS
    -.                                  Online '.' Command: Display Active Status
    -*A,5003,0,1                        All Level '*' Command: Special Batch File Function - Set Expected Error
    -Q                                  'Q' Command: Write, Read, Read CHS
    -.                                  Online '.' Command: Display Active Status
   
******************************************************************************************
    Test the Set Track Format command.
   
     - Select Single Sector per Wedge mode and perform a read and write operation on the
       test track.  (Note: Only Physical CHS writes and reads are supported in this mode.)
   
     - Select No Split Mode and perform a read and write operation on the test track.
       (Note: Only Physical CHS writes and reads are supported in this mode.)
   
     - Select Normal Track Format and perform a read and write on the test track.  This
       will restore the test track to its original state.
   
    Note: Since we are reading and writing on a track whose defect status is unknown, the
    read commands may generate errors (DiagError 5003).
   ******************************************************************************************
    -K2                                 'K' Command: Set Track Format - Single Sector per Wedge
    -W,,,1                              'W' Command: Write CHS - Physical
    -.                                  Online '.' Command: Display Active Status
    -*A,5003,0,1                        All Level '*' Command: Special Batch File Function - Set Expected Error
    -R,,,1                              'R' Command: Read CHS - Physical
    -.                                  Online '.' Command: Display Active Status
    -K1                                 'K' Command: Set Track Format - No Splits
    -W,,,1                              'W' Command: Write CHS - Physical
    -.                                  Online '.' Command: Display Active Status
    -*A,5003,0,1                        All Level '*' Command: Special Batch File Function - Set Expected Error
    -R,,,1                              'R' Command: Read CHS - Physical
    -.                                  Online '.' Command: Display Active Status
    -K0                                 'K' Command: Set Track Format - Normal Track Format
    -W                                  'W' Command: Write CHS
    -.                                  Online '.' Command: Display Active Status
    -*A,5003,0,1                        All Level '*' Command: Special Batch File Function - Set Expected Error
    -R                                  'R' Command: Read CHS
    -.                                  Online '.' Command: Display Active Status
   
******************************************************************************************
    Test the offtrack capability on the current track for 5 sectors starting at sector
    1B hex with a maximum offset count of 80 hex to each side.
   ******************************************************************************************
    -c1B,5,1,80                         'c' Command: Off Track Capability
   
******************************************************************************************
    Mark a media flaw at Cylinder 300, Head 0, Sector 25.
   
     - Write the test track and 0x69 ( 0x3c Pointer Tracks + 0x1e Erase Band Tracks +
       0x0F Undisturbed Tracks ) tracks on both sides of the test track.
   
     - Mark the media flaw at Cylinder 300, Head 0, Sector 25.
   
     - Read the test track and 0x69 (0x3c Pointer Tracks + 0x1e Erase Band Tracks + 0x0F
       Undisturbed Tracks) tracks on both sides of the test track.  (Note: This should
       generate read errors (DiagError 5003).
   
          Minimum Count = 0xB4 (2*(0x3c Pointer Tracks + 0x1e Erase Band Tracks))
          Maximum Count = 0xD3 (1+(2*(0x3c Pointer Tracks + 0x1e Erase Band Tracks + 0x0F Undisturbed Tracks)))
   
     - Write the test track and 0x69 ( 0x3c Pointer Tracks + 0x1e Erase Band Tracks +
       0x0F Undisturbed Tracks ) tracks on both sides of the test track to clean it up.
   ******************************************************************************************
    -PCCCC,CCCC                         'P' Command: Set Buffer Pattern
    -A2                                 All Level 'A' Command: Set Test Space - Sequential Cylinders
    -S296,0                             'S' Command: Seek to Logical Cylinder and Head
    -L1,D3                              'L' Command: Enable Looping ( Loop Count = ( 2 * 69 hex ) + 1 )
    -W                                  'W' Command: Write CHS
    -h300,0,25                          'h' Command: Mark Media Flaw
    -S296,0                             'S' Command: Seek to Logical Cylinder and Head
    -*A,5003,B4,D3                      All Level '*' Command: Special Batch File Function - Set Expected Error
    -L1,D3                              'L' Command: Enable Looping ( Loop Count = ( 2 * 69 hex ) + 1 )
    -R                                  'R' Command: Read CHS
    -S296,0                             'S' Command: Seek to Logical Cylinder and Head
    -L1,D3                              'L' Command: Enable Looping ( Loop Count = ( 2 * 69 hex ) + 1 )
    -W                                  'W' Command: Write CHS
    -A0                                 All Level 'A' Command: Set Test Space - Single Cylinder
    -S200,0                             'S' Command: Seek to Logical Cylinder and Head
   
******************************************************************************************
    Tweak the Heater and Write Powers for the current temperature and then restore them
    back to the RAP values.
   ******************************************************************************************
    -U                                  'U' Command: Channel Temperature Adjustment - Tweak
    -U,,,,3                             'U' Command: Channel Temperature Adjustment - Restore
   
******************************************************************************************
    Test the Display / Modify Adaptives command by displaying the CAP, RAP, SAP and R/W
    Working Parameters.
   ******************************************************************************************
    -I,0                                'I,0' Command: Display / Modify CAP
    -I,1                                'I,1' Command: Display / Modify RAP
    -I,2,1                              'I,2' Command: Display / Modify SAP - humanized
    -I,3                                'I,3' Command: Display / Modify RW Working Parameters
    -*A,6004,0,1                        All Level '*' Command: Special Batch File Function - Set Expected Error
   
******************************************************************************************
    Read the SAP, RAP and CAP from non-volatile memory.
   
    Note: Currently, attempting to read the SAP and CAP from non-volatile memory will
    result in an Unsupported Adaptive Feature error (DiagError 7000).
   ******************************************************************************************
    -*A,7000,0,2                        All Level '*' Command: Special Batch File Function - Set Expected Error
    -r4                                 'r' Command: Read Non-Volatile Adaptive Parameters - SAP
    -r2                                 'r' Command: Read Non-Volatile Adaptive Parameters - RAP
    -r1                                 'r' Command: Read Non-Volatile Adaptive Parameters - CAP
   
******************************************************************************************
    Modify a RAP parameter.  Display the RAP parameter to verify that it has been modified.
    Read the non-volatile copy of the RAP to restore the modified parameter to its original
    value.  Display the RAP parameter to verify that it has been restored.
   ******************************************************************************************
    -I,1,4                              'I,1' Command: Display / Modify RAP
    -I5555,1,4,0,0                      'I,1' Command: Display / Modify RAP
    -I,1,4                              'I,1' Command: Display / Modify RAP
    -r2                                 'r' Command: Read Non-Volatile Adaptive Parameters - RAP
    -I,1,4                              'I,1' Command: Display / Modify RAP
   
******************************************************************************************
    Display the following Directed Offline Scan Information.
   
       Counter Values
       Counter Group Descriptors
       Miscellaneous DOS Data
       Cylinder and Head Data
       Number of ought to and need to scans due
   
******************************************************************************************
    -m1F                                'm' Command: Display Directed Offline Scan Information
   
******************************************************************************************
    Display the Active Error Log and check if the Batch File failed.
   ******************************************************************************************
    -*B                                 All Level '*' Command: Special Batch File Function - Display Log
    -|                                  '|' Command: Batch File Terminator