README - WDAT_IDE

This utility scans the media and remaps any grown defects on a Western
Digital drive. It also provides performance data such as seek times and data
access times.


COMMAND LINE OPTIONS:

To run the menu-driven test, type 'WDAT_IDE' from the DOS prompt.

The following options may be included on the command line after 'WDAT_IDE':
              L = open log file WDAT_IDE.LOG (only use this option when
                  running the test from a floppy, since hard disk data
                  corruption will occur!!!)
              1 = run quick scan of first drive with no menu
              2 = run quick scan of second drive with no menu 
              S = skip pause at end of 'no menu' run
              B = adjust bit map formats if necessary and quit
              P = update P list instead of G list
              G = skip update of grown defect list, but still relocate
                     sectors and tracks
              F = relocate addresses shown in file WDAT_IDE.DAT
              D = operate on second drive if F option chosen

The 'L' option may be combined with either the '1' or '2' option. Either
'1' or '2' may be specified, but not both.

The data file for the 'F' option should be an ASCII text file with a C, H and
S specified for each address to be relocated. To relocate a track, specify
the C and H and set the S to 255. All addresses must be specified in decimal.
All addresses are for physical locations, and the sector address is the
sector from index. The first sector is specified as 1, not 0. For example, to 
relocate the 23rd sector from index at C10 H1 and the track at C20 H3, store 
the following text in WDAT_IDE.DAT:

                    10, 1, 23
                    20, 3, 255


For a description of the command line options, type 'WDAT_IDE ?'.


PROGRAM CHARACTERISTICS:

   - runs with WDI13
   - retries disabled
   - identifies drive models and number of drives
   - if CMOS is set for no drives, sets CMOS to drive type 1 and issues 
        cold boot 
   - revectors INT41 and INT46 to new tables that contain physical drive
        parameters
   - menu driven
   - preserves user data whenever possible (uncorrectable errors cannot be
        recovered)


MENU OPTION DESCRIPTIONS:

        MAIN MENU SELECTION: 

        0 - Quick Surface Scan       ... 2-3 minutes
        1 - Comprehensive Analysis   ... 8-12 hours
        2 - Performance Data         ... Access and Xfer
        3 - Select Drive             ... 0 or 1
        4 - Park Drives and Quit"
                               

        MENU SELECTION "0 - Quick Surface Scan" description:

        1. Read verifies, sequentially, a track at a time. No writes are
              issued.
        2. Performs appropriate defect management if errors are detected:
              See section below for details regarding defect management.
        3. Saves and restores user data, if possible.


        MENU SELECTION "1 - Comprehensive Analysis" description:

        1. Read verifies, sequentially, a track at a time.
              This step executes the 'quick scan' described above.
        2. Writes/Reads, sequentially, a track at a time.
              In this step, each track is written with 11 data patterns, and
              10 reads are issued after each write. So each track is read a
              minimum of 110 times, more if errors occur. The data patterns 
              are:
                 pattern  0: 00
                 pattern  1: 33
                 pattern  2: 5ab6b5ab6b
                 pattern  3: c086043021800c086043021800
                 pattern  4: 136b31136bb3
                 pattern  5: 0101
                 pattern  6: 492492
                 pattern  7: cf3cf3
                 pattern  8: c6319c6319
                 pattern  9: d6b5ad6b5a
                 pattern 10: random data
        3. Performs appropriate defect management:
              See section below for details regarding defect management.
        4. Saves and restores user data, if possible.


        MENU SELECTION "2 - Performance Data" description:

        1. Track-track access time seek test (200 seeks)
        2. Average access time seek test (1000 random seeks)
        3. Full stroke access time seek test (200 seeks)
        4. Data transfer test (average from 200 times)
              This test sets the block size to the number of sectors per
              logical cylinder, or to 64, whichever is less. 200 Read 
              commands are issued at address C:0 H:0 S:1. If any error occurs
              during any Read, then the error message "Data Error in Cyl 0" 
              is displayed, and the test is aborted. The data rate in bytes 
              per second is calculated by dividing A by B, where 
              A = (200*Blocks per transfer*512) and B = the total time in 
              seconds.


DEFECT MANAGEMENT DETAILS:

If an error is detected while reading a track, the following steps occur:

   1) The track data is stored in memory. If the data cannot be read, then
      a message will appear at the end of the test that not all of the data
      was restored. For example, the data can not be read if a servo error or
      ID Not Found error occurs. However, the data can be read if the most
      common type of error, a correctable ECC error, occurs. Retries are
      enabled for reading the data into memory to recover as many sectors
      as possible.
   2) If a Bad Block error is detected, then the sector is re-formatted as no
         longer bad, and the test continues with step 3.
   3) The sector in error is re-read 20 times with cache disabled. 
         If any error occurs, the relocation alogorithm shown below is executed.
         If no error occurs during any of the re-reads, the sector is not 
         relocated.
   4) Each sector on the track is read 20 times, including the original sector
         in error. 
   5) If an error occurs during any read, the relocation algorithm is
         executed, and reverification of the track as shown here in step 4
         is repeated.
   6) Steps 4-5 are repeated until no errors are detected on the track.
   7) The data that was stored in step 1 is rewritten to the track. 

Relocation Algorithm Details:

   If a servo error occurs, the track is relocated.
   If an ID Not Found error occurs, the track is relocated.
   If a physical track already has 2 relocated sectors, the track is
      relocated.
   If an ECC or DAM error occurs, the sector is relocated. Since retries are
      disabled, correctable ECC errors are reported as uncorrectable and
      are relocated.
   If any other type of error occurs, an error message is displayed and the
      test is terminated.


   To relocate a track, updates must occur to the configuration sector, the
   track bit map, and the grown defect list. The following steps are taken:

      1) The number of spares available is determined from the configuration
            sector. If no spares are available, then an error message is
            displayed and the program is terminated.
      2) If spares are available, then an available spare address is
            determined based on the spare track bit map.
      3) The spare track list in the conguration sector is updated and 
            written to the drive. If the track in error is a spare, then the
            old spare is replaced with the new spare in the list. For example,
            if track 0 was relocated to track 2000, and track 2000 later
            appeared bad, then track 0 would be re-relocated to track 2001,
            and the bit for track 2000 would remain cleared so it could not
            be used in the future.
      4) The used bit is cleared and the new bit map is written to the drive.
      5) The new grown defect list is written to the drive.
      

   To relocate a sector, updates must occur to the sector bit map and the
   grown defect list. Also, the relocation address must be stored in the
   defective sector after it has been marked bad. The following steps are 
   taken:

      1) The spare sector bit map is checked for available spares. If no
            spares are available, then an error message is displayed, and
            the program is terminated.
      2) If spares are available, then an available spare address is
            determined based on the spare sector bit map. The search for a
            spare begins at the cylinder with an error, and then proceeds to
            check cylinders at +-1, then +-2, etc., until an unused spare is 
            located. If the sector in error is a spare itself, then it is
            relocated to a new spare, causing a 'chain' of relocations.
      3) The sector in error is marked bad, then the 'Write Relocation ID'
            command is issued so the sector contains the address of the spare.
      4) The used bit is cleared and the new bit map is written to the drive.
      5) The new grown defect list is written to the drive.


REVISION HISTORY:

   rev 2.1      2/12/92         Fix bug - no longer hangs before main menu -
                                   used to hang if FTS rev had a space before
                                   the number.
                                Fix bug - When parsing .DAT file, now 
                                   relocates address even when line does not 
                                   end with a linefeed.
                                Added P option to update P list instead of G
                                   list.
                                Because of lack of code space, rearranged seek 
                                   tests so now tk-tk test is followed by 
                                   full stroke test.

   rev 2.0      12/13/91        Supports AC2200.

   rev 1.9      9/24/91         Add option to immediately relocate bad blocks
                                   instead of formatting and testing them 
                                   first.
                                Relocate defects on cyl 0 and 1 during write
                                   error process instead of giving error 
                                   message.
                                Do not allow bad block errors during any
                                   write command (previously ignored these
                                   errors).
                                Fix bug so correct spare tracks get used
                                   (introduced in previous rev).
                                User must hit a key before re-boot occurs.
                                Fix bug: If track address from input file
                                   has already been relocated, modify existing
                                   entry instead of adding new entry.
                                To work with ACER BIOS, which doesn't allow
                                   retries to be disabled, test for corr.
                                   ecc errors at drive level in addition to
                                   testing BIOS error code.

   rev 1.8      9/10/91         Fix batch file so program gets executed if F
                                   option is enabled.
                                Fix bug: When running 2 drives, zone 
                                   information from second drive would be used
                                   when operating on first drive. This caused
                                   errors if drives were different models.

   rev 1.7      9/9/91          Relocates track if Write Fault bit is set
                                   or if Seek Complete bit is not set
                                   following Extract Interleave cmd.
                                Parks drives correctly (issues seek to cyl
                                   07ffh instead of ff07h).
  
   rev 1.6      9/6/91          Has option to get relocation addresses from
                                   file WDAT_IDE.DAT.
                                If bad block is detected, reformats sector
                                   and then checks for any error.
                                Skips park command for Tidbit drives.
                                Relocates track if Write Fault bit is set
                                    following Verify error.
                                Only issues REREAD PARMS cmd to Tidbit 
                                    (piranha was getting an error)
                                When selecting drive, no longer looks for 
                                    Seek Complete bit since want to relocate 
                                    tracks with this error

   rev 1.5      8/5/91          Supports AB130 (Tidbit 30MB)
                                Supports option to skip update of grown
                                   defect list

   rev 1.4      7/11/91         Parks drive with seek to cyl 2047 instead
                                   of 1023, and issues seek command directly
                                   instead of through BIOS
                                Doesn't show AB130 in list of drives supported
                                Relocates track if error occurs when
                                   relocating sector
                                Supports command line option to update bit
                                   map format and quit

   rev 1.3      6/24/91         Supports Tidbit and Caviar II
                                Lets user continue if unidentified drive is
                                   present
                                Allows defects on cylinders 0 and 1
                                Swaps bits in bit maps if necessary

   rev 1.2      3/12/91         Supports piranha
                                Re-scans correct track after relocating a
                                  sector (previous revision re-read wrong
                                  cylinder, which sometimes caused drive 
                                  to park)
                                Waits for keystroke at end of 'no menu' run
                                  so user can see results

   rev 1.1      12/4/90         Doesn't open log file unless requested
                                Displays new menu order

   rev 1.0      11/14/90        Initial release
