Description:
    This batch file attempts to verify that the level 2 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 2 commands.
   ******************************************************************************************
    -/CQ2                               Level C 'Q' Command: Display ASCII Command Information
   
******************************************************************************************
    Change to Command Level 2.
   ******************************************************************************************
    -/2                                 All Level '/' Command: Change Diagnostic Command Level
   
******************************************************************************************
    Display the active error log.
   ******************************************************************************************
    -E                                  'E' Command: Display / Edit Log
   
******************************************************************************************
    Test the buffer memory access commands by loading the diagnostic write buffer with
    each of the predefined buffer patterns and then displaying the first block of the
    write buffer.
   ******************************************************************************************
    -P1111                              'P' Command: Set Buffer Pattern - Incrementing Pattern
    -B250F,,2,1                         'B' Command: Buffer Display
    -P1212                              'P' Command: Set Buffer Pattern - Random Pattern
    -B250F                              'B' Command: Buffer Display
    -P1313                              'P' Command: Set Buffer Pattern - Alternating Pattern
    -B250F                              'B' Command: Buffer Display
    -P1414                              'P' Command: Set Buffer Pattern - Isolated Pulse Pattern
    -B250F                              'B' Command: Buffer Display
    -P1515                              'P' Command: Set Buffer Pattern - Incrementing 2-Byte Pattern
    -B250F                              'B' Command: Buffer Display
    -P1616                              'P' Command: Set Buffer Pattern - Repeating 127-bit Pattern
    -B250F                              'B' Command: Buffer Display
    -P1717                              'P' Command: Set Buffer Pattern - Repeating 15 byte 6T Pattern
    -B250F                              'B' Command: Buffer Display
   
******************************************************************************************
    Test the buffer memory access commands by loading the diagnostic write buffer with
    a user specified 128 bit pattern and then displaying the first block of the write
    buffer.
   ******************************************************************************************
    -P1818,FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0,80   'P' Command: Set Buffer Pattern - Repeating 1 to 128 bit user specified pattern
    -B250F                                       'B' Command: Buffer Display
   
******************************************************************************************
    Test the buffer memory access commands by loading the diagnostic write buffer with
    a user specified 3 bit pattern and then displaying the first block of the write
    buffer as both 8 bit and 3 bit symbols.
   ******************************************************************************************
    -P4,,3                              'P' Command: Set Buffer Pattern - 492492...
    -B250F                              'B' Command: Buffer Display - 8 bit symbols
    -B250F,,,,3                         'B' Command: Buffer Display - 3 bit symbols
   
******************************************************************************************
    Test the buffer compare command.  Copy the first block of the diagnostic write buffer
    to the diagnostic read buffer, modify 2 bytes of the diagnostic read buffer and then
    comparing the first block of the diagnostic read buffer to the first block of the
    diagnostic write buffer.
   
    Note: This should generate 2 Buffer Miscompare errors (DiagError 1003).
   ******************************************************************************************
    -C250F,1DBD                         'C' Command: Buffer Copy
    -/1U3B7A00,,FF                      Level 1 'U' Command: Edit Buffer Memory Byte
    -/1U3B7A04,,FF                      Level 1 'U' Command: Edit Buffer Memory Byte
    -/2B                                'B' Command: Buffer Display
    -*A,1003,2,2                        All Level '*' Command: Special Batch File Function - Set Expected Error
    -c,,1,1                             'c' Command: Buffer Compare
    -C                                  'C' Command: Buffer Copy
    -B                                  'B' Command: Buffer Display
    -c,,,1                              'c' Command: Buffer Compare
   
******************************************************************************************
    Test spin up and hold with the actuator latched then advance to spin up complete.
   ******************************************************************************************
    -Z                                  'Z' Command: Spin Down Drive
    -.                                  Online '.' Command: Display Active Status
    -U3                                 'U' Command: Spin Up Drive - Hold with the actuator latched
    -.                                  Online '.' Command: Display Active Status
    -U1                                 'U' Command: Spin Up Drive - Advance to next hold state
    -.                                  Online '.' Command: Display Active Status
    -U1                                 'U' Command: Spin Up Drive - Advance to next hold state
    -.                                  Online '.' Command: Display Active Status
    -U1                                 'U' Command: Spin Up Drive - Advance to next hold state
    -.                                  Online '.' Command: Display Active Status
    -Z                                  'Z' Command: Spin Down Drive
    -.                                  Online '.' Command: Display Active Status
    -U3                                 'U' Command: Spin Up Drive - Hold with the actuator latched
    -.                                  Online '.' Command: Display Active Status
    -U2                                 'U' Command: Spin Up Drive - Release the hold state
    -.                                  Online '.' Command: Display Active Status
   
******************************************************************************************
    Test spin up and hold prior to demod sync then advance to spin up complete.
   ******************************************************************************************
    -Z                                  'Z' Command: Spin Down Drive
    -.                                  Online '.' Command: Display Active Status
    -U4                                 'U' Command: Spin Up Drive  - Hold prior to demod sync
    -.                                  Online '.' Command: Display Active Status
    -U1                                 'U' Command: Spin Up Drive - Advance to next hold state
    -.                                  Online '.' Command: Display Active Status
    -U1                                 'U' Command: Spin Up Drive - Advance to next hold state
    -.                                  Online '.' Command: Display Active Status
    -Z                                  'Z' Command: Spin Down Drive
    -.                                  Online '.' Command: Display Active Status
    -U4                                 'U' Command: Spin Up Drive  - Hold prior to demod sync
    -.                                  Online '.' Command: Display Active Status
    -U2                                 'U' Command: Spin Up Drive - Release the hold state
    -.                                  Online '.' Command: Display Active Status
   
******************************************************************************************
    Test spin up and hold prior to track follow then advance to spin up complete.
   ******************************************************************************************
    -Z                                  'Z' Command: Spin Down Drive
    -.                                  Online '.' Command: Display Active Status
    -U5                                 'U' Command: Spin Up Drive  - Hold prior to track follow
    -.                                  Online '.' Command: Display Active Status
    -U1                                 'U' Command: Spin Up Drive - Advance to next hold state
    -.                                  Online '.' Command: Display Active Status
    -Z                                  'Z' Command: Spin Down Drive
    -.                                  Online '.' Command: Display Active Status
    -U5                                 'U' Command: Spin Up Drive  - Hold prior to track follow
    -.                                  Online '.' Command: Display Active Status
    -U2                                 'U' Command: Spin Up Drive - Release the hold state
    -.                                  Online '.' Command: Display Active Status
   
******************************************************************************************
    Spin down and spin back up without using any hold states.  This will resynchronize the
    diagnsotic and read / write code.  Attempt to track follow on cylinder 200 head 0.
   ******************************************************************************************
    -Z                                  'Z' Command: Spin Down Drive
    -.                                  Online '.' Command: Display Active Status
    -U,0,200                            'U' Command: Spin Up Drive and seek to head 0, track 200h
    -.                                  Online '.' Command: Display Active Status
   
******************************************************************************************
    Test the seek commands.  The commands that perform multiple seeks are tested first,
    then the Test Space is set to single track mode and the singlr seek commands are
    tested.  This will initialize the diagnostic current and target address for future
    commands that use them.
   ******************************************************************************************
    -O,,5,1                             'O' Command: Seek Repeatedly Between Physical Cylinders
    -A0                                 All Level 'A' Command: Set Test Space
    -s200,0,22                          's' Command: Seek to Physical Cylinder and Head
    -.                                  Online '.' Command: Display Active Status
    -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
    -K                                  'K' Command: Set Tracking Offset
    -.                                  Online '.' Command: Display Active Status
   
******************************************************************************************
    Test the address translation commands.  The seek commands are tested prior to these
    commands to initialize the diagnostic current and target address.
   ******************************************************************************************
    -x                                  'x' Command: Display Zone Information
    -X                                  'X' Command: Display Track Information
    -h                                  'h' Command: Translate Physical Sector
    -l                                  'l' Command: Translate Logical Sector
    -t                                  't' Command: Translate Wedge
    -v                                  'v' Command: Convert Data Track Percentage To Servo Offset Count
   
******************************************************************************************
    Test the retry commands by displaying the current retry configuration.
   ******************************************************************************************
    -Y                                  'Y' Command: Set Retries
    -y                                  'y' Command: Set DERP Retry State
    -u                                  'u' Command: Enable/Disable Channel/Preamp Register Display
   
******************************************************************************************
    Test the read and write commands.
   
    Writes are performed before reads to guarantee that the track has been written in the
    desired format.  Wedge reads and writes are performed  before sector reads and write
    to guarantee that the sector and buffer configuration will be restored to the standard
    mode before exiting.
   
    Note: Since we are reading and writing on a track whose defect status is unknown, the
    Read Wedge command may generate a Wedge Read Failed error (DiagError 5005) and the Read
    command may generate a Read Failed error (DiagError 5003).
   ******************************************************************************************
    -z                                  'z' Command: Write Wedge
    -.                                  Online '.' Command: Display Active Status
    -*A,5005,0,1                        All Level '*' Command: Special Batch File Function - Set Expected Error
    -j                                  'j' Command: Read Wedge
    -.                                  Online '.' Command: Display Active Status
    -/2S200,0                           Level 2 'S' Command: Seek to Logical Cylinder and Head
    -.                                  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
    -B                                  'B' Command: Buffer Display
    -*A,5003,0,1                        All Level '*' Command: Special Batch File Function - Set Expected Error
    -r0,1                               'r' Command: Read Long CHS or Read System CHS
    -.                                  Online '.' Command: Display Active Status
    -B                                  'B' Command: Buffer Display
    -w0,1                               'w' Command: Write Long CHS or Write System 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
   
******************************************************************************************
    Corrupt an LBA, read it to verify that it generates an error (5003 - Read Failed) and
    then clean it up by rewriting it.
   ******************************************************************************************
    -PCCCC,CCCC                         'P' Command: Set Buffer Pattern
    -/AW9000000,1                       Level A 'W' Command: Write LBA
    -/2o9000000,1,64,0                  'o' Command: Corrupt LBA
    -.                                  Online '.' Command: Display Active Status
    -*A,5003,1,1                        All Level '*' Command: Special Batch File Function - Set Expected Error
    -/AR9000000,1                       Level A 'R' Command: Read LBA
    -.                                  Online '.' Command: Display Active Status
    -/AW9000000,1                       Level A 'W' Command: Write LBA
    -.                                  Online '.' Command: Display Active Status
    -/2                                 All Level '/' Command: Change Diagnostic Command Level
   
******************************************************************************************
    Test the defect management commands.  The Modify Track Defect List command is tested by
    adding LBA 3000 to the Alternate Sector List and then deleting it from the Alternate
    Sector List.
   ******************************************************************************************
    -F3000,A1                           'F' Command: Modify Track Defect List
    -.                                  Online '.' Command: Display Active Status
    -F3000,C1                           'F' Command: Modify Track Defect List
    -.                                  Online '.' Command: Display Active Status
   
******************************************************************************************
    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
    -*A,6004,0,1                        All Level '*' Command: Special Batch File Function - Set Expected Error
    -I,2                                'I,2' Command: Display / Modify SAP - humanized
    -I,3                                'I,3' Command: Display / Modify RW Working Parameters
   
******************************************************************************************
    Measure throughput.
   ******************************************************************************************
    -T                                  'T' Command: Measure Throughput
   
******************************************************************************************
    Display the current Diagnostic Idle Mode configuration.
   ******************************************************************************************
    -M                                  'M' Command: Set Diag Idle Mode
   
******************************************************************************************
    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