home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / HARDDISK / HDTST495.ZIP / HDTEST.DOC < prev    next >
Encoding:
Text File  |  1990-03-10  |  133.5 KB  |  2,429 lines

  1.           
  2.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  3.           _______________________________        _______________________________
  4.           
  5.           
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.                           HDTEST - Hard Disk Test/Repair Utility
  15.                           ______________________________________
  16.  
  17.                            Copyright (1984-1990), P. R. Fletcher
  18.                            _____________________________________
  19.                                     All Rights Reserved
  20.                                     ___________________
  21.  
  22.  
  23.  
  24.                         Distributed by:
  25.  
  26.                                P. R. Fletcher (Software)
  27.                                1515 West Montgomery Avenue
  28.                                Rosemont
  29.                                PA 19010
  30.  
  31.  
  32.  
  33.  
  34.  
  35.                                   _______
  36.                              ____|__     |               (tm)
  37.                           --|       |    |-------------------
  38.                             |   ____|__  |  Association of
  39.                             |  |       |_|  Shareware
  40.                             |__|   o   |    Professionals
  41.                           -----|   |   |---------------------
  42.                                |___|___|    MEMBER
  43.  
  44.            
  45.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  46.           _______________________________        _______________________________
  47.           
  48.           
  49.                                      TABLE OF CONTENTS
  50.                                      _________________
  51.  
  52.  
  53.           User-Supported Software                                    1
  54.           Introduction                                               2
  55.           Getting Started - Installation                             5
  56.                           - Testing a Disk                           5
  57.           Hardware and Software Requirements                         7
  58.           Limitations and Restrictions                               9
  59.           Command Line Options - HDCHEK                             10
  60.                                - HDTEST                             12
  61.           What does HDTEST do?                                      15
  62.           Using the Special Pre-Boot                                16
  63.           Dealing with Bad Clusters                                 18
  64.           Running HDTEST from a .BAT file                           19
  65.           Bugs and Other Unpleasant Subjects                        20
  66.           Changes from Previous Versions                            21
  67.           Appendix A - Summary of Flag Settings                     25
  68.           Appendix B - Disk Error Messages                          27
  69.           Appendix C - Example Program Runs                         34
  70.           Registration Form                                         37
  71.            
  72.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  73.           _______________________________        _______________________________
  74.           
  75.           
  76.                                   USER-SUPPORTED SOFTWARE
  77.                                   _______________________
  78.  
  79.           Much of the software which is available for your computer has, in the
  80.           past, been produced and sold on the assumption that you are a crook
  81.           and that you will take any available opportunity to cheat software
  82.           writers and vendors out of their rightful reward. Such software was
  83.           copy-protected within an inch of its (and your computer's) life and
  84.           was priced at a level which still guaranteed its producers a profit
  85.           even if four or five illegal copies were made for each one sold.
  86.           Thankfully, prices of commercial software have (for the most part)
  87.           come down somewhat, and copy-protection is becoming much less
  88.           prevalent, but buying such software remains something of a lottery -
  89.           you often cannot be sure that the software does what you want in the
  90.           way you want it done until you have paid for it. User-supported
  91.           software (Shareware) is different. You may have got a copy of this
  92.           package free from a friend or a bulletin board or (for a nominal fee)
  93.           from a users' group or software library. In any case, you have a
  94.           perfectly legal working copy of the HDTEST package. You are encouraged
  95.           to make as many copies of the package as you like and to distribute
  96.           them to all your friends. If, after trying the program out, you find
  97.           that it is useful and want to continue to keep and use it, you must
  98.           register your copy by sending the registration fee ($35.00, unless you
  99.           are already a registered user of DIREDIT, in which case it is $25.00)
  100.           together with the completed registration form, to the address on the
  101.           form. Only your conscience can make you do this (although you are
  102.                                          ____                              
  103.           probably breaking the law if you don't), but bear in mind that the
  104.           distributors of "user-supported" software are making the assumption
  105.           that you are honest and willing to pay a reasonable price for a useful
  106.           program, many commercial software vendors, on the other hand, would
  107.           still apparently rather believe you are a crook. You can decide who
  108.           you would rather prove right. Registered users are entitled to
  109.           support, upgrades, and help with HDTEST-related problems (including
  110.           telephone support) for a year from the date of registration.
  111.  
  112.           The author of this program is a member of the Association of Shareware
  113.           Professionals (ASP).  ASP wants to make sure that the shareware
  114.           principle works for you. If you are unable to resolve a shareware-
  115.           related problem with an ASP member by contacting the member directly,
  116.           ASP may be able to help. The ASP Ombudsman can help you resolve a
  117.           dispute or problem with an ASP member, but does not provide technical
  118.           support for members' products. Please write to the ASP Ombudsman at
  119.           P.O. Box 5786, Bellevue, WA 98006 or send a Compuserve message via
  120.           Easyplex to ASP Ombudsman 70007,3536"
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.           
  136.           
  137.                                           Page 1 
  138.            
  139.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  140.           _______________________________        _______________________________
  141.           
  142.           
  143.                                        INTRODUCTION
  144.                                        ____________
  145.  
  146.           HDTEST was originally written to allow comprehensive Read/Write
  147.           testing of hard disks on IBM PCs, XTs, ATs, and "true" compatibles.
  148.           The V4.10 release removed many of the hardware restrictions imposed by
  149.           earlier (V2.xx and V3.xx) versions of the program and made it useful
  150.           for testing most MS-DOS-compatible storage devices currently in use on
  151.           IBM-compatible computers, including removable (floppy and hard) disks
  152.           and logically partitioned hard disks. The V4.34 release included BIOS-
  153.           level support for DOS 3.3 (and above) "extended devices" and more
  154.           options for the handling of totally unreadable sectors. The V4.53
  155.           release added even more extensive support for IBM-incompatible
  156.           hardware and removed the requirement that ANSI.SYS be loaded to
  157.           support a proper screen display. The current release adds full support
  158.           for the large (> 32Mb) devices allowed by DOS 4.0, the ability to
  159.           locate bad spots physically (by track, head, and sector) on the disk,
  160.           and some support for the use of .BAT files to run HDTEST on multiple
  161.           disks at one "sitting".
  162.  
  163.           Although many programs, including IBM's diagnostics, allow "surface
  164.           scanning" and seek testing of hard disks, few that are available to
  165.           the average user test whether the whole disk can retain the data that
  166.           is or will be written to it. HDTEST's principal "claim to fame" is the
  167.           ability thoroughly to test the magnetic media in a device which
  168.           contains data while preserving the data (although data loss is
  169.                         _________________________                       
  170.           unavoidable if an area which is in use has become unreadable). HDTEST
  171.                                                               ____             
  172.           tests the disk much more thoroughly than programs such as DFixer,
  173.           Mace, and Norton's DT. Mace and DT, like many public domain "disk
  174.           test" programs, simply read every cluster on the disk and report on
  175.           any errors encountered.  DFixer does better, writing 4 test patterns
  176.           to every free cluster and checking that they can be read back
  177.           correctly, but it makes no attempt to test clusters that are already
  178.           in use - the very ones which contain your precious data! Disk
  179.           Technician (TM), a product which has come to market fairly recently,
  180.           is more closely comparable to HDTEST than any other disk testing
  181.           program that I know about. It is, however, much more expensive, is
  182.           (functionally, at least) copy-protected, and is not available as
  183.                                                           ___             
  184.           Shareware!
  185.  
  186.           In addition to its testing function, HDTEST has been reported to be
  187.           useful as an automatic disk repair utility for both hard and floppy
  188.           disks which have developed (especially) intermittent or persistent
  189.           read errors, preventing or impeding their normal use. Although HDTEST
  190.           cannot read the totally unreadable, it tries much harder that DOS does
  191.           and will almost always, in the course of its operation, allow you to
  192.           recover the entire readable portion(s) of a file with one or more
  193.                              ________                                      
  194.           unreadable clusters in it, optionally either remapping all of what it
  195.           reads from the disk or replacing bad sectors (the default) or clusters
  196.           with NULLs. HDTEST is not an alternative to backing up your floppies
  197.                                 ___                                           
  198.           and/or hard disk - it may sometimes be able to save your neck when you
  199.                                     _________                                   
  200.           forgot or your backup went bad too! On hard disks which have developed
  201.           intermittent read errors, running HDTEST can sometimes totally cure
  202.                                                    ___                       
  203.           the problem, presumably because the "flaky" sectors get rewritten and
  204.           the minor misalignments and/or weakening of the magnetic "image" which
  205.           were causing the trouble are corrected when the data is rewritten.
  206.  
  207.  
  208.           
  209.           
  210.                                           Page 2 
  211.            
  212.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  213.           _______________________________        _______________________________
  214.           
  215.           
  216.           In its default ("slow") mode, HDTEST writes 20 different test patterns
  217.           to every cluster on the disk and checks that each pattern can be read
  218.              _____                                                             
  219.           back correctly, while preserving (and eventually restoring) the
  220.           contents of the clusters that contain data.  HDTEST can even (on many
  221.           devices) detect hard disk errors which are minor enough to be
  222.           correctable (and corrected) by the disk controller's own "error-
  223.           correcting code" (ECC).  These errors are normally totally invisible
  224.           to programs running under DOS and will not usually be picked up by
  225.           other disk test utilities.  They may, however, be early signs of
  226.           problems that will become significant later, and HDTEST consequently
  227.           marks these clusters, too, as bad. As long as HDTEST can read the data
  228.           from a flaky cluster correctly once (and it tries quite hard) it will
  229.           be able to save the file of which that cluster is a part intact, while
  230.                                                                    ______       
  231.           marking the cluster so that DOS does not try to use it again. The
  232.           program was designed to minimize the likelihood of user error causing
  233.           data loss on a good (or slightly bad) disk, and to be as easy as
  234.           possible to use - it could not be made very fast, since multiple bit
  235.           patterns have to be written to and read from each cluster, and this
  236.           takes a significant time even on a fast hard disk. The program does,
  237.           however, have a less sensitive "fast" test mode, which writes only two
  238.           test patterns to each block and is recommended for use when
  239.           testing/repairing floppy disks and/or to correct intermittent problems
  240.           or rule out gross problems on a hard disk.
  241.  
  242.           The program can be used to test/repair single and double-sided 8- and
  243.           9-sector minifloppies (if you have plenty of patience!), as well as
  244.                                              ______                          
  245.           AT-format 1.2Mb minifloppies, 8" standard floppies, and 3.5"
  246.           microfloppies (with the same proviso regarding a need for patience).
  247.  
  248.           HDTEST's companion program, HDCHEK, simply examines the logical
  249.           structure of the system and target device and gives a short report on
  250.           what it finds. It does not write to the disk, and is provided
  251.                                  ___                                   
  252.           principally to allow a quick and easy, but fairly reliable, check on
  253.           the compatibility between HDTEST and a given software/hardware
  254.           configuration. As part of its report, HDCHEK notes at what level (DOS
  255.           interrupts only, INT 13, or direct entry to the BIOS) it was able to
  256.           access the target device, which has a bearing on HDTEST's ability to
  257.           detect certain types of errors. In general, if HDCHEK runs
  258.                                           __________                
  259.           successfully on a system and target device, then HDTEST can be
  260.           expected to do so, although the latter program requires much more
  261.           available memory.
  262.  
  263.           The HDTEST package is distributed as "User-supported Software". If you
  264.           intend to continue using the program, you are required to become a
  265.           Registered user. Send a completed copy of the Registration Form (which
  266.           is included in this documentation), together with a check or money
  267.           order for $35.00 (+ $5.00 for shipping outside the continent of North
  268.           America) to me at the address which appears on the form. Please also
  269.           add $2.50 (or equivalent) if you want the software on a 1.2 Mb HD
  270.           floppy or a 3.5" minifloppy, rather than a 360 Kb DSDD floppy, and
  271.           specify which you want on the Reg. form. Checks and money orders in
  272.           denominations other than U.S. dollars are acceptable, but please add a
  273.           further $10.00 for bank charges before using the current exchange rate
  274.           to calculate the fee in the currency in which you are paying. On
  275.           receiving your Registration, I will send you a personalized copy of
  276.           the latest, enhanced, version of the HDTEST package (currently V4.91),
  277.           and register you for a year's support. Registration entitles you to be
  278.           
  279.           
  280.                                           Page 3 
  281.            
  282.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  283.           _______________________________        _______________________________
  284.           
  285.           
  286.           notified of upgrades, bug fixes, newly discovered incompatibilities,
  287.           etc., and to ask for (and get) necessary help in adapting the program
  288.           to work on your hardware. I cannot guarantee to make HDTEST work with
  289.           every possible combination of hardware and software, but I will
  290.           promise to try to solve problems as they come up, and I will return
  291.           your Registration fee if I cannot support HDTEST on your system.
  292.           Support is available TO REGISTERED USERS ONLY by mail, BIXmail,
  293.                                ________________________                  
  294.           Compuserve EMail and telephone. Please also bear in mind that my
  295.           willingness and ability to continue to support and enhance these
  296.           programs will be directly dependent on users' willingness to pay the
  297.           Registration fee and (to some extent) inversely dependent on the
  298.           number of questions I get that could be answered by reading the docu-
  299.           mentation(!).
  300.  
  301.           The HD programs were written principally in C, compiled by the
  302.           Microsoft C compiler (Version 5.10) using its "small" memory model,
  303.           and linked with code from the distributed Microsoft C object libraries
  304.           using the Microsoft LINK program (Version 4.06). Portions of the
  305.           distributed program are consequently Copyright (C) by Microsoft Corp.,
  306.           1985 - 1988. All rights reserved. These portions are used under the
  307.           terms of a license from Microsoft Corp. Some low-level functions were
  308.           written in assembly language and assembled by the Microsoft MASM Macro
  309.           Assembler (Version 5.10).
  310.  
  311.           The HD programs were written with care and have been tested on a
  312.           number of different systems.  I cannot, however, give any guarantee as
  313.           to their performance on a specific system, nor can I accept liability
  314.           for any actual or consequential loss resulting from their use. The
  315.           programs may only be used and/or copied in their original form.
  316.           Unauthorized modifications and/or the use of all or part of the
  317.           programs in other software, commercial or otherwise, are strictly
  318.           prohibited.
  319.  
  320.           The HD programs owe a lot of their value to suggestions and bug
  321.           reports (more of the former than the latter, fortunately) from
  322.           Registered users. They were originally written in response to a
  323.           "challenge" issued by Roedy Green on Bix, and their further
  324.           development has also been significantly influenced by his input.
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.           
  345.           
  346.                                           Page 4 
  347.            
  348.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  349.           _______________________________        _______________________________
  350.           
  351.           
  352.  
  353.                               GETTING STARTED - INSTALLATION
  354.                               ______________________________
  355.  
  356.           1) If you received the HDTEST package on a disk, use the DOS DISKCOPY
  357.           program to make a duplicate of the distribution disk, put the original
  358.           away in a safe place, and use the duplicate as your working disk.
  359.           Otherwise, use COPY to save a copy of the HDTEST distributions files
  360.           to a floppy disk, and put it away.
  361.  
  362.           2) HDTEST does not require any special installation procedure. You may
  363.           run HDCHEK and HDTEST from your working floppy disk or from a
  364.           subdirectory on your hard disk. If you wish to keep and run the
  365.           programs on your hard disk, you will probably find it most convenient
  366.           to COPY them to a subdirectory which is one of those included in your
  367.           DOS PATH (see your DOS Reference Manual). Only the two main .EXE files
  368.           (HDTEST.EXE and HDCHEK.EXE) need normally be kept on-line.
  369.           BOOTLOAD.COM is only used or needed to create a special boot disk, if
  370.           you find you need to use one.
  371.  
  372.           3) If you wish to be able to refer to this documentation on-line, you
  373.           should follow the instructions in the README.1ST file on the
  374.           distribution disk to produce a .TXT file (without underlining) and
  375.           keep that file in your documentation subdirectory.
  376.  
  377.  
  378.                              GETTING STARTED - TESTING A DISK
  379.                              ________________________________
  380.  
  381.           This section gives step by step instructions for running HDCHEK and
  382.           HDTEST on the C: drive of a standard IBM PC, XT, AT, or 100%
  383.           compatible. Subsequent sections of this documentation go into much
  384.           more detail about some of the program's other features and options,
  385.           and should help to explain and let you deal with any problems which
  386.           you may encounter. Note that you should never attempt to run HDTEST
  387.                                                   _____                      
  388.           under a multi-tasking or multi-user operating system, nor activate any
  389.           "pop-up" program (e.g. SideKick) while the program is running.
  390.  
  391.           1) Make sure that you have current backups of all the files on drive
  392.           C:. This is particularly important when running the program for the
  393.           first time on a given system.
  394.  
  395.           2) Run DOS's CHKDSK program on drive C: and correct any errors
  396.           reported by it before proceeding further.
  397.  
  398.           3) Make the drive and/or directory which contains HDCHEK.EXE and
  399.           HDTEST.EXE your current drive and/or directory.
  400.  
  401.           4) If you are not running HDTEST from your A> drive, insert a
  402.           formatted, non-write-protected floppy disk in drive A. HDTEST will
  403.           write an ASCII log file called HDTESTC0.LOG to the disk in drive A -
  404.           any other files on it will be undisturbed.
  405.  
  406.           5) Give the command: "HDCHEK C:". After a certain amount of disk
  407.           activity has taken place, and certainly within a minute or two, your
  408.           screen should look like one of the examples given in Appendix C. If
  409.           any errors are reported, DO NOT PROCEED until you have read the rest
  410.                                    ______________                             
  411.           of the documentation and/or are sure you know what is going on.
  412.  
  413.           
  414.           
  415.                                           Page 5 
  416.            
  417.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  418.           _______________________________        _______________________________
  419.           
  420.           
  421.           6) If HDCHEK reported no errors, give the command "HDTEST C: A:".
  422.              ____________________________                                  
  423.           After some disk activity, the program will prompt for replies to three
  424.           questions - press <Return> in response to each prompt. The program
  425.           will report its progress to the screen and will record any problems
  426.           encountered in the log file on the floppy disk. Depending on the size
  427.           of your DOS partition and the access time of the disk, a complete run
  428.           of HDTEST (in its normal, "slow", mode) will take between 2 and 5
  429.           hours. Your intervention will only be required if a recovered bad
  430.           _____                                                            
  431.           cluster is found in a "hidden", "system", or write-protected file,
  432.           when you will be asked to approve remapping; otherwise, bad clusters
  433.           will be automatically remapped. HDTEST can be aborted at any time by
  434.           pressing <Esc> and responding to the "Are you sure...." prompt by
  435.           pressing <Return>.
  436.  
  437.           7) If HDTEST finishes testing without finding any bad clusters, it
  438.           will simply record that fact and the finishing time in the log file
  439.           and return to the DOS prompt. Otherwise, when read/write testing has
  440.           been completed (or terminated, by entering <Esc>), you will be
  441.           prompted for permission to complete the remapping process by updating
  442.           the disk FATs and Directories.  Pressing <Return> will allow this to
  443.           take place, and you will then be returned to the DOS prompt.
  444.  
  445.           8) N.B. If HDTEST reported and remapped any bad clusters and you are
  446.              ____                                                  ___        
  447.           using the DOS (3.3 and above) FASTOPEN utility, or any other
  448.           directory- or file-cacheing software, you should reboot your system
  449.           before proceeding with other work on it.
  450.  
  451.           9) In any event, if HDTEST reported and remapped some bad clusters,
  452.           you should read the section on "Dealing with bad clusters" later in
  453.           this documentation.
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.           
  482.           
  483.                                           Page 6 
  484.            
  485.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  486.           _______________________________        _______________________________
  487.           
  488.           
  489.                              HARDWARE & SOFTWARE REQUIREMENTS
  490.                              ________________________________
  491.  
  492.           HDTEST and HDCHEK make a number of assumptions about the environment
  493.           in which they are operating. They will, generally speaking, abort with
  494.           an informative error message if they find one of these assumptions to
  495.           be untrue! They require MS/PC-DOS 2.x or above and (for HDTEST) up to
  496.           about 320 Kb of free memory (the exact amount required depends on the
  497.           size and other characteristics of the device being tested) to run -
  498.           the presence of more memory may (slightly) increase HDTEST's speed
  499.           when testing devices with large cluster sizes. The device to be tested
  500.           must be usable as a normal DOS device - commands such as DIR, COPY,
  501.           and CHKDSK should be valid for it and for files and subdirectories on
  502.           it. It need not, however, be bootable. Only the DOS partition(s) of a
  503.           multi-operating-system disk can be tested, but all the partitions of a
  504.           disk that is divided into multiple DOS partitions can be tested (one
  505.                                              ___                              
  506.           by one). This version of HDTEST fully supports DOS 3.3 (and above)
  507.           extended partitions, and will test them as thoroughly as it does
  508.           normal DOS partitions. HDTEST's support for other disk partitioning
  509.           software is provided only to the extent that DOS support is provided
  510.           by the producers of that software.
  511.  
  512.           If you wish to use HDTEST to test a new hard disk which is to be
  513.                                        ____                               
  514.           configured to support multiple operating systems, you should first
  515.           configure it as one or more DOS partitions, test it in that
  516.           configuration, and then reconfigure it as you intend to use it. If you
  517.                                   __                                            
  518.           have low-level disk formatting software which allows you to specify
  519.           bad sectors and/or tracks to be "locked out", you can use HDTEST's /G
  520.           option on the DOS partition(s) to  produce a list of defects, which
  521.           can then be used in reformatting the disk. Note that HDTEST can only
  522.                                                                           ____
  523.           be used as a test for areas of the disk that are to be devoted to
  524.                        ____                                                
  525.           other operating systems - when you repartition the disk, any remapping
  526.           and/or marking of bad clusters which HDTEST may have done in the DOS
  527.           partition is lost.
  528.  
  529.           Ideally, for normal hard disks, the BIOS handler for interrupt 13
  530.           should be capable of handling (at least) normal disk reads and writes
  531.           (sub-functions 2 and 3) in a way that is compatible with that
  532.           documented for the XT hard disk adapter (and AT BIOS) in IBM's
  533.           technical documentation. This should be no problem for most disk
  534.           systems on IBM PCs and most compatibles.  HDTEST may, however, be
  535.           forced to use the (somewhat more limiting) DOS device interface when
  536.           used with non-bootable hard disks and/or with hard disks which require
  537.           special device drivers to be installed, and will be forced to use the
  538.           DOS device interface when dealing with disks partitioned by means
  539.           other that the DOS 3.3 (and above) utilities.
  540.  
  541.           Earlier V4.xx releases of HDCHEK and HDTEST would abort if run on
  542.           small (<= 10 Mb) hard disks which had been patched to use a cluster
  543.           size smaller than the DOS standard (and 16-bit FATs). This deficiency
  544.           has been corrected in the current version, but very small (less than
  545.           1024 clusters) partitions may still cause problems if 16-bit FATs are
  546.           used (there is no good reason why such partitions should use 16-bit
  547.           FATs).
  548.  
  549.           If run under DOS 3.0 or above on an IBM INT 13 compatible hard disk,
  550.           The HD programs attempt to locate and use the ROM BIOS INT 13 entry
  551.           point, rather than the normal INT 13 vector (which DOS 3.x intercepts
  552.           
  553.           
  554.                                           Page 7 
  555.            
  556.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  557.           _______________________________        _______________________________
  558.           
  559.           
  560.           and interferes with). By default, for machines with 8088, 8086, 80188,
  561.           80186, or equivalent CPUs the programs assume that, if a ROM is
  562.                                                               ___________
  563.           present at absolute address C8000H, it contains the hard disk BIOS and
  564.           _______                                                            ___
  565.           has initialization code starting at offset 3. This assumption is true
  566.           for all hard disks which "plug in" to the IBM PC and XT. It may not be
  567.           true for all clones which come with hard disks installed, although it
  568.           is likely to be true for most of them. Also by default, the programs
  569.           assume that the hard disk BIOS in systems with 80286 or 80386
  570.           processors is in the "system" ROM at absolute address F0000H, but make
  571.           no more specific assumptions about its exact location. Problems (up to
  572.           __                                                                    
  573.           and including system halts) may occur if none of the special flags is
  574.           set and your system is configured in a way that is not consistent with
  575.           these assumptions. Such problems are almost guaranteed for PC or XT
  576.           systems if the initialization code does not start at offset 3 in the
  577.           ROM. If you know that your hard disk ROM is located somewhere other
  578.           than at the default segment address and/or does not obey the "rules",
  579.           you can use the /H flag to tell the programs where to look for it.
  580.           Unless you know that your system is particularly non-IBM-compatible,
  581.           however, it is usually worth trying to run the HD programs in their
  582.           default mode first. Problem hardware should respond to one of the
  583.           approaches described in the "Using the Special Preboot" section of
  584.           this documentation. The use of all the command line flags is discussed
  585.           in more detail below.
  586.  
  587.           Note that, since HDTEST remaps bad clusters to free space, there is
  588.           not much point in running it on a disk which has none (as shown by DIR
  589.           or CHKDSK), since the program will abort immediately if it finds a bad
  590.           cluster.  Unless you have a really flaky disk, however, you should not
  591.           need more than a couple of hundred Kb free to remap any reasonably
  592.           probable number of bad clusters.
  593.  
  594.           This version of the HD programs does not require an ANSI console
  595.           driver (such as ANSI.SYS) to be loaded. The programs will, however,
  596.           continue to function correctly if such a driver is present.
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.           
  621.           
  622.                                           Page 8 
  623.            
  624.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  625.           _______________________________        _______________________________
  626.           
  627.           
  628.                                LIMITATIONS AND RESTRICTIONS
  629.                                ____________________________
  630.  
  631.           The current version of HDTEST still has a few (mainly theoretical)
  632.           limitations, most of which result from the way data is stored
  633.           internally by the program. None of them are "etched in stone",
  634.           although some could only be avoided at the cost of slowing down what
  635.           is already (and necessarily) far from a fast program. The known
  636.           limitations are as follows:
  637.  
  638.           1) Maximum cluster size = 65,528 bytes. I do not believe that a DOS
  639.           disk can ever have clusters larger than 64 Kb, but my limit is a few
  640.           less than that and may, since sector and cluster sizes tend to run in
  641.           powers of 2, effectively limit cluster size to 32 Kb - this should be
  642.           enough for most people!.
  643.  
  644.           2) Because of certain limitations of the chips used to support direct
  645.           memory access (DMA, the method used to transfer data from disk to
  646.           memory and vice versa) in the IBM PC and most clones and compatibles,
  647.           HDTEST may be unable to use available memory efficiently when cluster
  648.           sizes (and the buffers needed to hold them) are large. This
  649.           inefficiency can result in "Insufficient Memory" or "Memory
  650.           Allocation" errors, even on systems with more than the minimum 320 Kb
  651.           of free memory prescribed above. The only cure for this is to free up
  652.           (or buy!) more memory (remove RAMdisks, remove resident software,
  653.           etc.).
  654.  
  655.           3) The current version of HDTEST will run, in its default mode, on ATs
  656.           and most AT clones, but may not be able to detect corrected ECC errors
  657.           when run in that mode on some of the clones - a warning message will
  658.           be displayed when the program initializes itself if corrected ECC
  659.           errors are not being detected. Appropriate use of the extended form of
  660.           the /H flag or the /U flag, as described in the "Using the Special
  661.           Preboot" section of this documentation, will allow detection of
  662.           corrected ECC errors on almost all hardware. The program will not
  663.                                                                         ___
  664.           detect corrected ECC errors when invoked with the /I flag (under DOS
  665.           3.0 or above) or with the /D flag.
  666.  
  667.           4) For reasons which are poorly understood (at least by the author!),
  668.           HDTEST runs very slowly on Epson Equity II systems, particularly when
  669.                       ____                                                     
  670.           used to test "plug-in" hard drives of the "Hardcard" or "Flashcard"
  671.           variety. For this hardware, the estimated run times given elsewhere in
  672.           the documentation need to be multiplied by about 2.5. There is some
  673.                                        __________          ___               
  674.           reason to think that this problem may be related to an excessively
  675.           "optimistic" interleave setting on (at least) some of these systems.
  676.  
  677.           5) HDTEST or HDCHEK will, by default, abort with an informative error
  678.           message if the program detects that the (80286 or better) CPU that it
  679.           is running on is not in "real" mode, since this normally means that a
  680.           (possibly multitasking) OS other than MS/PC-DOS is running and that
  681.           HDTEST cannot be guaranteed unchallenged access to the hardware. The
  682.           presence of LIM 4.0 expanded memory emulators such as QEMM-386 or
  683.           386^Max, which use the 80386's "virtual 8086" mode to allow remapping
  684.           of extended memory into unoccupied space in the area between 640 Kb
  685.           and 1 Mb, will cause a similar abort, unless the driver is inactive
  686.           (turned "OFF"). This safety feature can be bypassed by the use of the
  687.           /V command line option (see below).
  688.  
  689.           
  690.           
  691.                                           Page 9 
  692.            
  693.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  694.           _______________________________        _______________________________
  695.           
  696.           
  697.           6) HDCHEK and HDTEST will operate normally (except than the /U or /H
  698.           flags will generally be needed to use the low-level interface) on
  699.           (very large) hard disks with more than 1024 cylinders, provided that
  700.           the partition being tested does not begin or end above cylinder 1023.
  701.                                                     ______                     
  702.           If the partition starts below and ends above this point, HDCHEK will
  703.           issue a warning and HDTEST will abort unless the /D flag is used. If
  704.           the partition starts above cylinder 1023, both HDCHEK and HDTEST will
  705.           abort without the /D flag.
  706.  
  707.  
  708.                                    COMMAND LINE OPTIONS
  709.                                    ____________________
  710.  
  711.           Always run HDCHEK on any new hardware/software configuration before
  712.           ______                                                             
  713.           you attempt to run HDTEST (at least the first time). The latter
  714.           program has been written as conservatively as possible, but it is not
  715.           possible to predict the behavior of every conceivable combination of
  716.           hardware and operating system when dealing with a program which
  717.           bypasses most of the controls which normally protect the user from
  718.           destroying his world. HDCHEK is invoked with the command line:
  719.  
  720.           HDCHEK device [/A] [/Cn | /CQ] [/D | /I | /U] [/Hnnnn[:nnnn] [/M] [/V]
  721.  
  722.           "device" is the device to be tested (e.g. A:, B:, etc. - the colons
  723.           are permitted but not required). For versions of HDCHEK from V4.35,
  724.                             ___                                              
  725.           the spaces between the device identifier and the flags (and between
  726.           different flags) are optional - the command lines "HDCHEK C:/C2/D" and
  727.           "HDCHEK C: /C2 /D" are equivalent.
  728.  
  729.           The /A(T) flag is used to tell the HD program that it is being run on
  730.           an IBM AT. Setting the /A flag allows the programs to deal correctly
  731.           with a known bug in the IBM AT floppy disk controller BIOS when HDTEST
  732.           is used on 1.2 Mb "AT format" 5.25" floppy disks. If the /A flag is
  733.           set and the CPU is not an 80286 or better, you will be asked to
  734.           confirm that you wish to use AT defaults (HD BIOS at F0000H).
  735.  
  736.           N.B. the definition of the /A flag changed (slightly) at V4.71 - it
  737.           ___________________________________________________________________
  738.           need now only be used if you are testing a 1.2 Mb floppy disk on a
  739.           __________________________________________________________________
  740.           "vanilla" IBM AT. It may still be used to change the default BIOS
  741.           _________________________________________________________________
  742.           segment to F0000H on a PC or XT class machine, but the use of the /H
  743.           ____________________________________________________________________
  744.           flag for this purpose is preferred.
  745.           ___________________________________
  746.  
  747.           The /C flag has two variants. It is used, immediately followed by a
  748.           single decimal digit ("n") in systems which do not support IBM's INT
  749.           11 "equipment determination" BIOS function (e.g. the Tandy 2000). The
  750.           parameter ("n") is the number of floppy drives attached to the system,
  751.           which would otherwise be determined by the program, using INT 11. The
  752.           second variant should be used on Compaq computers - here, the flag is
  753.           followed by a "Q", instead of a number. This variant enables large
  754.           device support (as for IBM DOS 4.00) under Compaq DOS 3.31.
  755.  
  756.           The /D(OS interrupts) flag forces HDCHEK to use the hardware-
  757.           independent DOS interrupt 25 for access to the target device. It is
  758.           usually not required, since the program is usually smart enough to
  759.           _______                                    _______                
  760.           recognize devices which have to be accessed this way (e.g. logical
  761.           disk partitions other than those created as DOS 3.3 (and above)
  762.           "Extended Devices", non-bootable hard disks, some removable-media hard
  763.           disks). If the /D flag is not used, the program will issue a warning
  764.                                     ___                                       
  765.           
  766.           
  767.                                          Page 10 
  768.            
  769.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  770.           _______________________________        _______________________________
  771.           
  772.           
  773.           message if it finds it has to use the DOS interrupts.
  774.  
  775.           N.B. the definition of the /D flag changed at V4.00 - the new /I flag
  776.           _____________________________________________________________________
  777.           has the same effect as the old (pre-V4.00) /D flag. Only one of these
  778.           _____________________________________________________________________
  779.           flags may be present on the command line.
  780.           _________________________________________
  781.  
  782.           The /I(nterrupt 13) flag has no effect under DOS 2.x.  Under DOS 3.0
  783.           or above, it forces HDCHEK to use the existing INT 13 vector (which it
  784.           always does under DOS 2.x), and prevents the program from trying to
  785.           determine the ROM BIOS entry point; the flag should be used if you
  786.           know that your system's fixed disk BIOS uses INT 13 but does not
  787.           follow IBM's "rules" or if the program crashes the system when invoked
  788.           without it.
  789.  
  790.           The /H(ex BIOS address) flag is normally used (with a single numeric
  791.           argument) to tell the HD programs that the ROM BIOS of the device
  792.           being tested is located at nnnn, which is interpreted as a Hexadecimal
  793.           segment address, rather than at C800, which is the default for PC and
  794.           XT class machines, or F000, which is the default for systems using a
  795.           80286 or better CPU. There must be no space between the H and the
  796.           number. The extended form of the /H flag (e.g. /HF000:80D5) forces the
  797.           HD programs to use the given address as the ROM BIOS INT 13 entry
  798.                                                ____________________________
  799.           point. Its use is documented in more detail in the "Using the Special
  800.           _____                                                                
  801.           Preboot" section of this documentation.
  802.  
  803.           The /M(ulti-track read problem) flag forces HDCHEK to split up disk
  804.           accesses that would otherwise require the BIOS to read data from more
  805.           than one track in a single "bite". Its use is documented in more
  806.           detail in the "Using the Special Preboot" section of this
  807.           documentation.
  808.  
  809.           The /U(se INT 68) flag forces the HD programs to use the existing INT
  810.           68 vector (which must have been set up to point to an appropriate
  811.           location!) instead of locating and using the INT 13 BIOS entry point.
  812.           The use of this flag is documented in more detail in the "Using the
  813.           Special Preboot" section of this documentation.
  814.  
  815.           The /V(irtual mode) flag bypasses the code which prevents the HD
  816.           programs from working when the (80286 or better) CPU is not in "real
  817.           mode". It should only be used when the programs are being run under a
  818.                            ____                                                
  819.           single-tasking operating system which is using "virtual mode" only for
  820.                                                                         ____    
  821.           memory-mapping. Certain LIM 4.0 expanded memory emulators for 386
  822.           machines use the processor's virtual mode for this purpose. The two
  823.           most well-known examples of this software are QEMM-386 and 386^Max.
  824.           The HD programs are "DESQview aware", and will abort if run under
  825.           DESQview, even if the /V flag is used. They will not be able to
  826.           protect you from the (probably disastrous) consequences of using the
  827.           /V flag to run them under other multi-tasking OSes (such as VM-386).
  828.  
  829.           After a short delay, during most of which the specified device will be
  830.           active, a description of the device's logical structure will be disp-
  831.           layed.  After a further delay, and more disk activity, a message will
  832.           be printed giving the number of files and subdirectories found on the
  833.           disk, and the program will exit back to DOS. Note that the total
  834.           number of files and subdirectories reported by HDCHEK will be greater
  835.           than the sum of the counts reported by CHKDSK. This is because HDCHEK
  836.           counts the "." and ".." entries in subdirectories and CHKDSK doesn't.
  837.           
  838.           
  839.                                          Page 11 
  840.            
  841.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  842.           _______________________________        _______________________________
  843.           
  844.           
  845.           Errors and/or problems encountered, if any, will be reported on in
  846.           some detail. A number of example screen displays and log files
  847.           produced by running HDCHEK (and HDTEST) on different systems will be
  848.           found in Appendix C at the end of this documentation. If HDCHEK tells
  849.           you that you have a bad 8088 chip, believe it - some early 8088s had a
  850.           bug which allowed them to be interrupted while changing their stack
  851.           frame*  - this is not benign, and can cause all sorts of rare,
  852.           otherwise almost inexplicable, problems. The only cure is to replace
  853.           the CPU (which is, fortunately, not a particularly expensive
  854.           proposition these days). If HDCHEK reports a discrepancy between the
  855.           two FATs, HDTEST will abort. The FIXFAT program (on the distribution
  856.           disk) may be able to correct this problem - see FIXFAT.DOC, also on
  857.           the distribution disk. 
  858.  
  859.           Always run the DOS CHKDSK program immediately before running HDTEST on
  860.           a disk. If CHKDSK reports any problems, its /F option (or other means)
  861.           should be used to correct them before HDTEST is run.
  862.                                          ____________________ 
  863.  
  864.  
  865.           HDTEST is invoked with the command line:
  866.  
  867.                HDTEST device1 [device2[:pathname]] [optional parameters]
  868.  
  869.           "optional parameters" may include one or more of the following:
  870.  
  871.           [/A] [/B] [/Cn | /CQ] [/D | /I | /U] [/F] [/G[V]] [/Hnnnn[:nnnn]] [/M]
  872.           [/N] [/P] [/R[n]] [/Snnnnn] [/U] [/V] [/X] [/Yn] [/Z[n]]
  873.  
  874.           "device1" is the name of the device to be tested, as for HDCHEK.
  875.           "device2" (which, if present, must be different from "device1") is the
  876.                                         ____                                    
  877.           name of a device on which a log file is to be written, which may be
  878.           immediately followed by  a file- or path-name for the log file. If
  879.           only a device name (with or without a colon) is specified for the log
  880.           file, a file called HDTESTdn.LOG will be written to the default
  881.           directory on the specified device. "d" in this file specification is
  882.           replaced by the single-character specifier of the device being tested,
  883.           while "n" is replaced by the lowest decimal digit which results in the
  884.           creation of a new file (previous log files will not be overwritten).
  885.                         ___                               ___                 
  886.           If all ten possible log file names for this test device have already
  887.           been used, the program will prompt for a new name. If a directory path
  888.           (ending in a backslash (\)) is specified as device2, HDTESTdn.LOG will
  889.           be created in the specified directory. If a full pathname is specified
  890.           (not ending in a backslash), a file with that pathname will be opened
  891.            ___                                                                 
  892.           as the log file. In this case (only), any pre-existing file of the
  893.           same name will be overwritten. If "device2" is not specified, errors
  894.           are reported to the console terminal. The DOS console redirection
  895.           facility should not be used to redirect them elsewhere.
  896.                           ___                                    
  897.  
  898.  
  899.  
  900.           _____________________________________________________________________
  901.  
  902.           * See "Chips in Transition", by Bob Smith. PC Tech J. 4:4 (Apr. 1986):
  903.                                                      __________                 
  904.           56-69. The code which the HD programs use to identify the CPU and
  905.           diagnose this problem is adapted from the CPUID program described in
  906.           this article and from code from subsequent, related, articles in that
  907.           (now defunct) magazine.
  908.           
  909.           
  910.                                          Page 12 
  911.            
  912.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  913.           _______________________________        _______________________________
  914.           
  915.           
  916.           For versions of HDTEST from V4.35, the spaces between the device
  917.           identifier and the flags (and between different flags) are optional -
  918.           the command lines "HDTEST C:/A/F" and "HDTEST C: /A /F" are
  919.           equivalent.
  920.  
  921.           The /A, /C, /D, /H, /I, /M, /U, and /V flags have the same meaning and
  922.           effect that they do for HDCHEK. When used for HDTEST, the /D flag
  923.           forces the use of INT 25 to read from and INT 26 to write to the
  924.           target disk.
  925.  
  926.           The /B(oot/Partition sector test) flag forces the program to include
  927.           the boot/partition sector (track 0, head 0, sector 1) in the DOS area
  928.           for the purposes of read/write testing. The default action is only to
  929.           perform read and seek tests on this sector, even if read/write testing
  930.           of the DOS area is specified. Since the boot/partition sector is
  931.           effectively read-only under normal circumstances (it is only written
  932.                                                                        _______
  933.           to during low-level formatting, and by FDISK and other disk
  934.           __                                                         
  935.           partitioning programs), read/write testing is less vital than for the
  936.           rest of the disk. In addition, at least one hard disk controller (a
  937.           Western Digital board which allows a single disk to be addressed as
  938.           two "physical" devices) will not allow test patterns to be written to
  939.           this sector. Certain devices (chiefly RAMdisks) appear to DOS to be
  940.           hard disks but do not, in fact, possess boot/partition sectors. On
  941.           these devices, HDTEST will report check/test results on the
  942.           boot/partition sector while actually reading/writing the device's boot
  943.           sector - the latter sector will simply end up being checked/tested
  944.           twice under these circumstances.
  945.  
  946.           The /F(ast mode) flag causes the program to use only two test patterns
  947.           (all 1s and all 0s) for read/write testing. It is intended for use on
  948.           floppy disks and for "quick and dirty" testing of other devices.
  949.  
  950.           The /G(ive error details) flag causes the program to determine the
  951.           location of errors occurring during testing of the disk's data area at
  952.           the sector level (they are normally handled at the cluster level), and
  953.           to report on the location of all bad sectors found. The report is
  954.           written to the log device or file after all testing is finished. By
  955.                                             _____________________________    
  956.           default, only an error code is given for each bad sector - if a V (for
  957.           "verbose"!) is appended to the flag, the error code is expanded to a
  958.           report similar to that given for each bad cluster. This flag is
  959.           ineffective (and ignored) if HDTEST is using DOS interrupts, either
  960.           because the /D flag was set or because the program was not able to
  961.           access the disk at the BIOS level.
  962.  
  963.           The /N(o Query) flag disables the individual prompts for confirmation
  964.           which the program normally issues before remapping clusters which are
  965.           marked as "Reserved" or which are part of a file which is marked as
  966.           "System", "Hidden", or "Readonly".  The /N flag does not prevent the
  967.                                                                ___            
  968.           program from prompting for confirmation before updating the disk.
  969.  
  970.           The /P(rint) flag causes the log file to be directed to the PRN device
  971.           (normally LPT1), and overrides any "device2" specification.
  972.  
  973.           The /R(epeat)n flag causes HDTEST to go through n complete testing
  974.           cycles. Omitting n, or setting it to zero, causes HDTEST to run
  975.           continuously until terminated by pressing <Esc>). Instead of stopping
  976.           after completing the testing of allocated data clusters, the program
  977.           
  978.           
  979.                                          Page 13 
  980.            
  981.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  982.           _______________________________        _______________________________
  983.           
  984.           
  985.           immediately starts again with the DOS area. Any bad clusters found and
  986.           flagged in the first pass should be reported as "already marked as
  987.           bad" in subsequent passes. The /R flag implicitly sets the /N flag.
  988.  
  989.           The /S(tart)nnnnn flag causes HDTEST to start testing occupied
  990.                                                                 ________
  991.           clusters at cluster number nnnnn (expressed as a decimal number).
  992.                                                            _______         
  993.           There must be no space between the "S" and the number. This option
  994.           will mainly be useful when a previous run of HDTEST was interrupted
  995.           (by pressing <Esc>), since it allows you to start where you left off.
  996.           Note that, in order to be sure that data is not remapped to a bad
  997.           area, HDTEST always tests all empty clusters before starting to test
  998.                        ______       ___                                       
  999.           occupied clusters. For this reason, using the /S flag will not result
  1000.           in a large time saving if your disk is nearly empty, and it will make
  1001.           the most difference on a full, or nearly full, disk.
  1002.  
  1003.           The /Y(es, please remap)n flag causes HDTEST to remap up to n (a
  1004.           decimal number) bad clusters without prompting for confirmation. It is
  1005.           effective only if HDTEST is allowed to run to completion, and is
  1006.           intended to allow the program to be run unattended on multiple disks
  1007.           from a .BAT file. If more than n bad clusters are found or if the
  1008.           program is aborted (by pressing <Esc>), the normal prompt for
  1009.           confirmation is issued before any bad clusters are remapped. See
  1010.           "Running HDTEST from a .BAT file".
  1011.  
  1012.           The /X(clude bad clusters) flag causes HDTEST not to test clusters
  1013.                                                         ___                 
  1014.           that are already marked as bad by FORMAT or previous runs of HDTEST
  1015.           (the default is to test all clusters every time the program is run).
  1016.                                   ___                                         
  1017.           This saves some time when testing a disk with a substantial number of
  1018.           known defects. The marked clusters will be reported as bad but will
  1019.           not be retested. The /X flag overrides the /G flag for previously
  1020.           marked clusters - no bad sector report will appear for these clusters
  1021.           if both flags are used.
  1022.  
  1023.           The /Z(ero bad sectors)n flag controls how HDTEST deals with sectors
  1024.           that could not be read correctly (due to unrecoverable read errors)
  1025.           when it remaps bad clusters. Versions of HDTEST up to and including
  1026.           V4.10 (somewhat cavalierly) disregarded the remaining contents of the
  1027.           entire cluster if one or more sectors in it were unreadable, and
  1028.           remapped it to a cluster of NULLs. The default action is now to
  1029.           replace only the unreadable sector(s) with NULLs, transferring the
  1030.                                       _________                             
  1031.           remaining sectors intact to the remapped cluster. There are, however,
  1032.           two other options, which can be chosen by setting n to 0 or 2 (if n is
  1033.           omitted, 1, or any other number, the default action is taken). Setting
  1034.           n to 0 uses the old default (remaps the bad cluster to a cluster of
  1035.                           ___                                      _______   
  1036.           NULLs), while setting n to 2 goes to the other extreme and copies all
  1037.           data read (some of which is almost certainly invalid) to the remapped
  1038.           cluster. It is always safe and often advisable to use the /Z2 option
  1039.           provided that you do not try to use any non-ASCII files that have been
  1040.           ______________________________________________________________________
  1041.           remapped with unrecovered read errors and this (/Z) option. Remapped
  1042.           ___________________________________________________________         
  1043.           ASCII files can be inspected with an editor and fixed up where
  1044.           necessary - non-ASCII files (e.g. .EXE, .COM, .WKS files) may appear
  1045.           to be undamaged (the program may run, the worksheet be readable, etc.)
  1046.           but they can still contain small changes which will cause trouble
  1047.           later, and they cannot easily be checked. The large "holes" which /Z
  1048.           options 0 and 1 leave in such files usually allows it to be much more
  1049.           obvious that they are defective!
  1050.  
  1051.           
  1052.           
  1053.                                          Page 14 
  1054.            
  1055.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  1056.           _______________________________        _______________________________
  1057.           
  1058.           
  1059.                                    WHAT DOES HDTEST DO?
  1060.                                    ____________________
  1061.  
  1062.           After displaying its copyright message, HDTEST reads the FATs and
  1063.           scans the root directory and all subdirectory trees of the specified
  1064.           device before initiating a short dialogue. All questions are of the
  1065.           "Yes/No" type and should be answered by typing "Y" or "N" (case does
  1066.           not matter) and pressing the <Return> key.  Pressing the <Return> key
  1067.           alone is equivalent to giving the default response (which appears in
  1068.           square brackets at the end of each prompt).  HDTEST then proceeds to
  1069.           test the specified device. By default, the DOS area (boot sector,
  1070.           FATs, and root directory) is not subjected to Read/Write testing,
  1071.           since failures in this area usually make themselves apparent fairly
  1072.           rapidly. The user can, however, choose to run these tests on the DOS
  1073.           area too, or to limit testing to read and seek tests only over the
  1074.           whole partition.
  1075.  
  1076.           In its reports to the screen, HDTEST uses the convention that read-
  1077.           only testing is "Checking" while read/write testing is "Testing" - it
  1078.           always "checks" the boot/partition sector and the rest of the DOS
  1079.           area, but only "tests" them if requested to do so.
  1080.  
  1081.           In "checking" or "testing" a block (sector or cluster), HDTEST first
  1082.           reads it (retrying, if necessary, up to five times) and then does the
  1083.           longest possible seek away from it before attempting to read it again.
  1084.           "Checking" is complete at this point. "Testing" continues with the
  1085.           program sequentially writing 20 (or 2, for "fast mode") different bit
  1086.           patterns to the block and checking that each one can be read
  1087.           correctly, before rewriting the original contents of the block (and
  1088.           reading it again to ensure that it has been restored correctly).
  1089.           Errors that occur at any point in this process are reported and (if
  1090.           the block is in the data area - errors in the DOS area are always
  1091.           treated as fatal) the block is remapped. If an error is detected in a
  1092.           "Reserved" cluster or in one that is part of a file which is marked as
  1093.           "System", "Hidden", or "Readonly", the user is normally asked for
  1094.           confirmation before the cluster is remapped, otherwise it is assumed
  1095.           that remapping is desired.
  1096.  
  1097.           HDTEST keeps a copy of the FAT and a map of the device's directory
  1098.           structure in memory. A bad cluster is remapped by transferring its
  1099.           contents to a free cluster and (if the bad cluster was in use)
  1100.           changing all necessary FAT and directory entries in memory so that the
  1101.           pointer chain which maintains the structure of the affected file or
  1102.           subdirectory remains valid. The bad cluster's FAT entry is then
  1103.           altered to identify it as bad to DOS. The device's FATs and
  1104.                                                     ________         
  1105.           directories are not altered until the whole device has been scanned,
  1106.           and then only after the user has confirmed that it is OK to proceed.
  1107.           This means that a power failure and/or an inadvertent power-off which
  1108.           occurs while the program is running will cause the loss of, at most,
  1109.           one cluster of data and of no FAT or root directory information
  1110.           (unless you are very unlucky and it happens after you have confirmed
  1111.                           ____                                                
  1112.           that you want a damaged data area to be remapped and while this is
  1113.           being done). If a power failure and/or power-off occurs while a
  1114.           cluster which contains the directory information of a subdirectory is
  1115.           being tested, part or all of that subdirectory will probably become
  1116.           inaccessible to DOS, although the data in it will remain on the disk
  1117.           and be potentially recoverable with the aid of (e.g.) the Norton
  1118.           Utilities (TM).
  1119.           
  1120.           
  1121.                                          Page 15 
  1122.            
  1123.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  1124.           _______________________________        _______________________________
  1125.           
  1126.           
  1127.           You can safely interrupt the testing process part way through (by
  1128.           pressing the <Esc> key) with no risk of leaving a partially updated
  1129.           FAT or directory. If you do interrupt the program in this way, you
  1130.           will be given the option of updating the disk, so that bad clusters
  1131.           which were detected before <Esc> was pressed can be remapped.
  1132.  
  1133.           Errors which occur in the program's initialization phase cause it to
  1134.           abort with an error message and (sometimes) a hexadecimal error code.
  1135.           The meaning of the error code is context-dependent and it is useful
  1136.           only to technical support personnel (i.e. the author!). Errors
  1137.           detected during read-write testing only cause the program to abort if
  1138.           they occur during testing of the DOS area, or if remapping is
  1139.           impossible (only likely to happen if the disk is full). In any event,
  1140.           a description of the error is written to the log file (if any) and/or
  1141.           to the screen. This specifies the cluster or (for the DOS area) sector
  1142.           number and the name of the affected file (if any), and defines the
  1143.           type(s) of error which occurred. Appendix B contains a discussion of
  1144.           some of the more technical aspects of data storage on disks (floppy
  1145.           and hard), and includes more information about some of the possible
  1146.           errors that may be encountered.
  1147.  
  1148.           HDTEST takes a very long time to run to completion because of the
  1149.                          ____                                              
  1150.           large number of reads and writes it does for each cluster. A typical
  1151.           time for full testing ("slow" mode) of an XT disk (10 Mb) would be 2
  1152.           hrs; full disk testing on a 30 Mb Enhanced AT takes at least 4 hrs.
  1153.           Note also that using the /D or /G flags will substantially slow down
  1154.           the testing of disks with significant numbers of bad spots. Using the
  1155.           /X flag as well will allow the physical location of new defects to be
  1156.           reported without requiring that known bad areas be exhaustively
  1157.           retested.
  1158.  
  1159.  
  1160.                                 USING THE SPECIAL PRE-BOOT
  1161.                                 __________________________
  1162.  
  1163.           All IBM systems (at least non-PS/2 ones - I have little experience,
  1164.           yet, with the new line of IBM hardware) - and almost all clones
  1165.           capable of running IBM PC-DOS (rather than "generic" MS-DOS) should
  1166.           also run the HD programs with no problems, and should allow them to
  1167.           locate and use the ROM BIOS INT 13 entry point with no help from the
  1168.           user. Less compatible systems have presented more problems in the
  1169.           past, but this version of HDTEST is distributed with a supplemental
  1170.           program (BOOTLOAD) which can be used to modify the boot sector on a
  1171.           floppy disk and create a special pre-boot floppy to allow
  1172.           identification and use of the "real" INT 13 entry point on almost any
  1173.           MS-DOS-compatible system. Once created by BOOTLOAD, the special boot
  1174.           sector will be correctly duplicated if copy the disk by using the DOS
  1175.                  ____                                                          
  1176.           "DISKCOPY" command - it will not be copied by a "COPY *.*" command.
  1177.                                        ___                                   
  1178.           Further documentation for the BOOTLOAD program (BOOTLOAD.DOC) should
  1179.           have been included in this package.
  1180.  
  1181.           After using BOOTLOAD to create the special pre-boot disk, insert it in
  1182.           the boot drive (normally drive A), then (re)boot your system as you
  1183.           normally do (either by switching it on or by pressing the <Ctrl>-
  1184.           <Alt>-<Del> combination or its equivalent for your hardware). After
  1185.           performing its self-test, the system's BIOS will load and pass control
  1186.           to the code on the boot sector of the floppy. On a normally FORMATTed
  1187.           floppy disk, this code attempts to locate the MS-DOS system files at
  1188.           
  1189.           
  1190.                                          Page 16 
  1191.            
  1192.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  1193.           _______________________________        _______________________________
  1194.           
  1195.           
  1196.           the beginning of the disk's root directory and to load and execute
  1197.           them. The HDTEST boot disk will not load DOS (even if you SYS the
  1198.           disk) - it simply reads and reports on the contents of the INT 13
  1199.           vector (which DOS has not yet had a chance to tamper with, since it
  1200.           has not been loaded) and conditionally transfers the vector to the INT
  1201.           68 location. The INT 68 location is normally unused in MS-DOS systems
  1202.           - it is defined that way by IBM - and is usually loaded either with
  1203.           zeroes or with a pointer to some "do-nothing" code by the BIOS
  1204.           bootstrap. The HD programs use it for the "real" INT 13 vector,
  1205.           normally saving the original contents of the location on entry and
  1206.           restoring them on exit. This behavior is modified by specifying the /U
  1207.           switch on the command line. The HDTEST boot sector code will only
  1208.           transfer the "real" INT 13 BIOS entry point to the INT 68 location if
  1209.           the latter contains either zeroes or the same vector as INT 69. In the
  1210.                               ______        __                                  
  1211.           latter case (since there is no point in having two "real" interrupt
  1212.           vectors pointing at the same place), it is assumed that both are
  1213.           pointing at "do-nothing" code. If the INT 68 vector is neither 0:0 nor
  1214.                                                                  _______     ___
  1215.           the same as the INT 69 vector, the preboot code will leave it alone
  1216.           and report that the INT 13 vector was not transferred, otherwise it
  1217.           will confirm that the transfer has taken place - in any event, you
  1218.           will be given an opportunity to write down the vector and can then
  1219.           remove the disk and press a key to allow the boot process to complete.
  1220.           If you need to boot from a floppy disk, for some reason, a new,
  1221.           bootable, disk can be inserted before you press the key to continue.
  1222.  
  1223.           If the preboot reported that the INT 13 vector was successfully
  1224.           transferred, you should simply specify the /U flag on the HDTEST or
  1225.           HDCHEK command line, in addition to the "short" form of the /H flag
  1226.                                ______________                                
  1227.           (if the BIOS ROM is at an unusual location for the class of machine).
  1228.           The requirement for the /H flag with unusual hardware allows the
  1229.           program to do some additional "reasonableness checking". Unless some
  1230.           other software interferes with it, the INT 68 vector will then
  1231.           continue to be set up correctly for use by the HD programs until the
  1232.           system is switched off or rebooted.
  1233.  
  1234.           If the preboot was not able to transfer the vector, or if you know
  1235.           that a device driver or resident program loaded by your DOS uses INT
  1236.           68, you should invoke the HD programs with the "long" form of the /H
  1237.           flag, specifying the full address displayed by the preboot. No error
  1238.           checking is attempted in this case - if you mistype the address, the
  1239.           first time the program attempts to access the disk, it will jump to a
  1240.           (effectively) random location in ROM, with potentially disastrous
  1241.           results. If it is feasible, use of the pre-boot disk and the /U flag
  1242.           is preferable (in terms of safety, if for no other reason) to that of
  1243.           the "long" form of /H.
  1244.  
  1245.           The following example may help to clarify matters. You have a clone
  1246.           system with a BIOS ROM location that is non-standard. The HDTEST boot
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.           
  1257.           
  1258.                                          Page 17 
  1259.            
  1260.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  1261.           _______________________________        _______________________________
  1262.           
  1263.           
  1264.           disk reports that the INT 13 entry point is at E000:13AC, and that the
  1265.           vector has been successfully transferred. You may now run HDTEST with
  1266.           the command line:
  1267.  
  1268.           HDTEST C: A: /U /HE000
  1269.                             ____
  1270.  
  1271.           You may also, now or later, with or without prior use of the pre-boot,
  1272.                                       _______________                           
  1273.           run HDTEST with the command line:
  1274.  
  1275.           HDTEST C: A: /HE000:13AC
  1276.                          _________
  1277.  
  1278.           Note that the /H flag is not needed with the /U flag if the segment
  1279.                                    ___                                       
  1280.           address of the hard disk BIOS is the usual value for the system type
  1281.                                                            ___________________
  1282.           (as determined by the processor). For a system based on an 8088, 8086,
  1283.           80188, or 80186 processor, this "usual" value is C800. For all other
  1284.           systems, the "usual" value is F000.
  1285.  
  1286.           One further problem may be encountered - certain hard disk BIOSes do
  1287.           not exactly comply with IBM standards in dealing with disk accesses
  1288.           that cross track boundaries, and will produce frequent errors when
  1289.           such accesses are attempted. It was this "multi-track read" problem
  1290.           which resulted in a number of previously apparently 99.99% IBM-
  1291.           compatible systems failing to run IBM PC-DOS 3.3 (which was the first
  1292.           version of DOS actually to attempt such accesses). IBM issued a "fix"
  1293.           for this problem, in the form of a program which, when run on the
  1294.           "bad" system, creates a device driver which protects the BIOS from
  1295.           being asked to do something that it can't. This device driver does its
  1296.           job by intercepting INT 13, and will, of course, do nothing to help
  1297.           the HD programs if they are bypassing that interrupt. Use the /M flag
  1298.           with the HD programs if you have a system on which PC-DOS 3.3 or above
  1299.           will not run without being "fixed" as described. It forces the
  1300.           programs to split up the multi-track accesses into manageable chunks -
  1301.           this can be expected to cause a substantial slowing of the programs'
  1302.           operation.
  1303.  
  1304.  
  1305.                                  DEALING WITH BAD CLUSTERS
  1306.                                  _________________________
  1307.  
  1308.           It is not unusual for a new hard disk to have a small, constant,
  1309.                                                           _____  ________ 
  1310.           number of bad clusters. IBM's quality control standards allow, for
  1311.           example, 5% of the surface area of a disk to be bad (!). These pre-
  1312.           existing bad clusters, which correspond to imperfections in the
  1313.           magnetic coating on the disk, will normally be detected and marked by
  1314.           the DOS FORMAT program, and HDTEST will report them as "already marked
  1315.           as bad". This should not be regarded as evidence of any real problem
  1316.           with the disk, although some suppliers (not including IBM) will
  1317.                                                   ___                    
  1318.           replace such disks under warranty if pressed to do so. It is also not
  1319.           unusual for a disk to develop a few more defects as it ages. When
  1320.                                           ___                              
  1321.           these do develop, they are also subsequently constant in size and
  1322.           position, and will be reported as "already marked as bad" by HDTEST on
  1323.           runs subsequent to that during which they are first found. The
  1324.           occasional appearance (and subsequent persistence) of a new bad
  1325.           __________                                                     
  1326.           cluster is, therefore, not necessarily evidence of serious trouble
  1327.           developing.  However, if more than one or two new bad clusters are
  1328.           reported by HDTEST, and especially if two consecutive runs (or passes,
  1329.           if the /R flag is set) of HDTEST report different bad clusters, there
  1330.                                                   _________                    
  1331.           is a good chance that the hard disk or controller is developing a
  1332.           
  1333.           
  1334.                                          Page 18 
  1335.            
  1336.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  1337.           _______________________________        _______________________________
  1338.           
  1339.           
  1340.           serious problem - the disk should be backed up immediately and the
  1341.           disk and/or controller sent for repair at the earliest opportunity.
  1342.  
  1343.           New bad clusters in the data area are automatically mapped out by
  1344.           HDTEST, and no further action is necessary. Bad sectors in the DOS
  1345.           area can be handled in two ways:
  1346.  
  1347.           1) If you are able to do a low-level format on your hard disk (most
  1348.                                      _________                               
  1349.           makers of "add-on" hard disks supply a method of doing this, either in
  1350.           the form of a short program, or by giving instructions for running a
  1351.           program in the ROM BIOS from DEBUG), back up the entire hard disk
  1352.                                                            ______          
  1353.           (including any non-DOS partitions), run the low-level format, use
  1354.           FDISK to repartition the disk, and then run the DOS FORMAT program. If
  1355.           HDTEST now reports no errors in the DOS area you can restore all your
  1356.           files and continue to use the disk. You should, however, use HDTEST to
  1357.           test (at least) the DOS area fairly frequently for a month or so to be
  1358.           sure that the problems are not going to recur.
  1359.  
  1360.           2) If you do not have the means to do a low-level format, or if you
  1361.           follow the above instructions and HDTEST continues to report errors in
  1362.           the DOS area, your only other choice is to back up the DOS partition,
  1363.           reconfigure the disk with FDISK so that the new DOS partition starts
  1364.           above the bad area, reFORMAT it, and restore all of the old files to
  1365.           the new DOS partition (which will unavoidably be a little smaller than
  1366.           the old).
  1367.  
  1368.           If the hard disk's boot/partition sector (track 0, Head 0, sector 1)
  1369.           becomes bad, the disk is useless and must be replaced. This sector is
  1370.           only subjected to read/write testing if the /B flag is specified on
  1371.                             __________                                       
  1372.           the command line, so any reported errors (in sector -1) during normal
  1373.                                                               __               
  1374.           testing represent a problem reading the sector and are likely to be
  1375.                                       _______                                
  1376.           significant. Problems encountered during read/write testing of this
  1377.           sector do not always indicate a significant problem - certain
  1378.                     ___                                                
  1379.           controller cards may not allow test patterns to be written to it,
  1380.           resulting in a report of multiple errors on read/write testing.
  1381.           Consequently, if multiple errors are reported on read/write testing of
  1382.           the boot/partition sector, but read-only testing proceeds without
  1383.           problems and the rest of the disk seems to be OK, there is probably no
  1384.           cause for concern.
  1385.  
  1386.  
  1387.                               RUNNING HDTEST FROM A .BAT FILE
  1388.                               _______________________________
  1389.  
  1390.           Versions of HDTEST from V4.75 can be run from a .BAT file (e.g. for
  1391.           unattended testing of multiple disks) without the user losing the
  1392.           ability to "escape" cleanly from the program. The /Y flag also allows
  1393.           the user to specify a maximum number of new bad clusters for each disk
  1394.           to be remapped "automatically", so that the .BAT file will normally
  1395.           just keep going but will pause and wait for input if something
  1396.           terrible seems to have happened to a disk. In order to run HDTEST from
  1397.           a .BAT file, it is necessary to prepare both the .BAT file with your
  1398.                                                   ____                        
  1399.           usual HDTEST command lines, generally including the /Y and /N flags,
  1400.           and a second ASCII file containing the answers to HDTEST's initial
  1401.           ___                                                               
  1402.           questions, one per line. DOS's input redirection ("<") command is used
  1403.  
  1404.  
  1405.  
  1406.           
  1407.           
  1408.                                          Page 19 
  1409.            
  1410.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  1411.           _______________________________        _______________________________
  1412.           
  1413.           
  1414.           to "feed" these answers to HDTEST. If the "answer" file is called
  1415.           (e.g.) ANSWERS.TXT, each line in the .BAT file will look like:
  1416.  
  1417.               HDTEST dev1 dev2 /opt1 /opt2 <ANSWERS.TXT
  1418.                                            ____________
  1419.  
  1420.           If you do not wish to read/write test the DOS area of the disk, your
  1421.           answer file can consist of three blank lines. If you do wish to
  1422.                                                                __        
  1423.           read/write test the DOS area, the first line of the answer file can be
  1424.           blank, the next two must start with a "y" and the fourth can be blank.
  1425.                           ___                                                   
  1426.           In order to allow HDTEST to be interrupted from the keyboard, if
  1427.           necessary, the program terminates input redirection before starting
  1428.           testing the disk, so anything in the answer file after the answers to
  1429.                                                            _____               
  1430.           HDTEST's initial questions will be ignored.
  1431.  
  1432.           On exit, HDTEST now returns a meaningful ERRORLEVEL, which can be
  1433.           tested from a .BAT file by means of DOS's "IF ERRORLEVEL" syntax.
  1434.           Versions of the program prior to V4.81 returned an ERRORLEVEL of 1 on
  1435.           aborts and 0 otherwise - HDCHEK still does this. The current version
  1436.           of HDTEST normally returns an ERRORLEVEL equal to the number of new
  1437.           bad clusters found. On aborts it returns 254, and, if deliberately
  1438.           terminated by the user (either by answering "N" to the last question
  1439.           in the introductory dialogue or by pressing and confirming <Esc>
  1440.           during testing), it returns 255.
  1441.  
  1442.           Note that this application of HDTEST is really intended for advanced
  1443.           users, and I am aware that this description is somewhat cursory - more
  1444.           help in using it can, if necessary, be obtained directly from me.
  1445.  
  1446.  
  1447.                             BUGS AND OTHER UNPLEASANT SUBJECTS
  1448.                             __________________________________
  1449.  
  1450.           Although, like all programmers, I like to think that my product is
  1451.           perfect, it is possible that there are a few bugs lurking in the
  1452.           depths of the program, and likely that some combination of software
  1453.           and hardware exists which HDTEST cannot figure out and/or cope with.
  1454.           If you think you have found a bug and/or if you cannot get either of
  1455.           the programs to work on your system, do the following:
  1456.  
  1457.           1) Reread this documentation! Make sure that you are doing exactly
  1458.           what the documentation says to do. Make sure (if you are testing a
  1459.           drive with removable media) that the media is not write-protected.
  1460.  
  1461.           2) Boot your system from a "virgin" DOS disk - preferably a copy of
  1462.           your DOS distribution disk - and try to run the HD programs again. If
  1463.           they run in this environment but not in your normal DOS environment,
  1464.           try reconstructing the system under which they failed by adding things
  1465.           one by one until the problem recurs. If you find a specific piece of
  1466.           software which causes the trouble, let me know about the
  1467.           incompatibility.
  1468.  
  1469.           3) If the above approaches do not help, or if HDCHEK runs but HDTEST
  1470.           bombs (the reverse should never happen), send me as detailed a
  1471.           description of the problem as possible and I will do my best to
  1472.           diagnose and fix it. A bug report should always include a full
  1473.                                                    ______               
  1474.           description of the system being used (hardware and software), as well
  1475.                                                          ___                   
  1476.           as a copy of the output from a run of HDCHEK.
  1477.  
  1478.           
  1479.           
  1480.                                          Page 20 
  1481.            
  1482.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  1483.           _______________________________        _______________________________
  1484.           
  1485.           
  1486.           I can be contacted by U.S. mail at the address given earlier in the
  1487.           documentation, by BIXMail to pfletcher, or by Compuserve EMail to
  1488.           72255,305.
  1489.  
  1490.  
  1491.                               CHANGES FROM PREVIOUS VERSIONS
  1492.                               ______________________________
  1493.  
  1494.           The first version of the HD programs actually released (not including
  1495.           beta-test versions) was V2.60. The programs have grown and developed
  1496.           gradually, for the most part, but the pre-V4.65 releases listed below
  1497.           have constituted the most significant "watersheds" - features added
  1498.           and changes made between the listed releases are treated here as if
  1499.                            _______                                           
  1500.           first included in the next listed release, so some individuals for
  1501.                                 ____                                        
  1502.           whom this is an upgrade may have packages with some, but not all, of
  1503.           the features listed for a given release. Note that the previous V4.45
  1504.           Shareware version of the program is not listed here - it was identical
  1505.           to V4.41 except that it included the "fix" for the deficiency which
  1506.           was corrected at V4.70 in the Registered version. Unless otherwise
  1507.           noted, both programs were affected by the listed changes.
  1508.  
  1509.  
  1510.           Version 4.95 (this version)
  1511.           ____________               
  1512.  
  1513.           1) Added code to prevent undetected "wrap-around" when using existing
  1514.           INT 13 on a disk with more than 1024 cylinders.
  1515.  
  1516.  
  1517.           Version 4.94
  1518.           ____________
  1519.  
  1520.           1) Copyright screen displayed for minimum of 2 seconds (may be longer
  1521.           if program is being run on a large device).
  1522.  
  1523.  
  1524.           Version 4.93
  1525.           ____________
  1526.  
  1527.           1) Deficiency allowing "queueing" of keystrokes in typeahead buffer
  1528.           fixed. <Esc> now produces (almost) immediate response even if other
  1529.           key(s) have been pressed first.
  1530.  
  1531.  
  1532.           Version 4.92
  1533.           ____________
  1534.  
  1535.           1) /V option added to bypass "virtual mode" prohibition.
  1536.  
  1537.  
  1538.           Version 4.91
  1539.           ____________
  1540.  
  1541.           1) Problem with FAT comparison error report for > 64 Kb FATs
  1542.           introduced at V4.90 corrected (HDCHEK).
  1543.  
  1544.  
  1545.           (Version 4.90
  1546.            ____________
  1547.  
  1548.           1) Previous restriction on testable FAT size (was 64 Kb) removed.
  1549.  
  1550.  
  1551.  
  1552.           
  1553.           
  1554.                                          Page 21 
  1555.            
  1556.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  1557.           _______________________________        _______________________________
  1558.           
  1559.           
  1560.           Version 4.84
  1561.           ____________
  1562.  
  1563.           1) Minor change to reporting of initialization errors (HDCHEK).
  1564.  
  1565.  
  1566.           Version 4.83
  1567.           ____________
  1568.  
  1569.           1) Remainder of fix for bug noted at V4.80!
  1570.  
  1571.  
  1572.           Version 4.81
  1573.           ____________
  1574.  
  1575.           1) Meaningful ERRORLEVEL returned on exit (see "Running HDTEST from a
  1576.           .BAT file) (HDTEST).
  1577.  
  1578.  
  1579.           Version 4.80
  1580.           ____________
  1581.  
  1582.           1) Bug causing the programs to fail if a subdirectory were physically
  1583.           located beyond the 32 Mb boundary on a large (> 32 Mb) device
  1584.           partially located and corrected.
  1585.  
  1586.  
  1587.           Version 4.75
  1588.           ____________
  1589.  
  1590.           1) Log file specification capabilities enhanced (HDTEST).
  1591.  
  1592.           2) /Y flag and .BAT file support added (HDTEST).
  1593.  
  1594.  
  1595.           Version 4.71
  1596.           ____________
  1597.  
  1598.           1) Fully automatic setting of default ROM BIOS location by CPU type.
  1599.           Meaning of and requirement for /A flag modified.
  1600.  
  1601.  
  1602.           Version 4.70
  1603.           ____________
  1604.  
  1605.           1) Deficiency causing "fallback" to DOS interrupt level under some
  1606.           circumstances when attempting to test "extended devices" on a second
  1607.           physical hard drive fixed. The Shareware V4.45 also included this
  1608.           "fix".
  1609.  
  1610.  
  1611.           Version 4.66
  1612.           ____________
  1613.  
  1614.           1) Support for large devices under Compaq DOS 3.31 added (see
  1615.           description of /C flag).
  1616.  
  1617.  
  1618.           Version 4.65
  1619.           ____________
  1620.  
  1621.           1) DOS 4.0 support added (including BIOS-level access to large
  1622.           partitions), but see notes on V4.8x.
  1623.  
  1624.           2) Minor changes made to final screen & file output format (HDTEST).
  1625.  
  1626.           
  1627.           
  1628.                                          Page 22 
  1629.            
  1630.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  1631.           _______________________________        _______________________________
  1632.           
  1633.           
  1634.           3) Minor improvements made to memory allocation algorithms.
  1635.  
  1636.           4) /G option added (HDTEST).
  1637.  
  1638.           5) /X option added (HDTEST).
  1639.  
  1640.  
  1641.           Version 4.54
  1642.           ____________
  1643.  
  1644.           1) Deficiency in CPU recognition code (which caused fast AT clones
  1645.           sometimes not to appear to be ATs) fixed.
  1646.                     ___                            
  1647.  
  1648.           2) ANSI.SYS requirement removed.
  1649.  
  1650.           3) Semi-automatic CPU recognition added.
  1651.  
  1652.           4) Pre-boot functionality, /M option, /U option, and extended
  1653.           (segment:offset) form of /H option added.
  1654.  
  1655.  
  1656.           Version 4.41
  1657.           ____________
  1658.  
  1659.           1) Deficiency (introduced at V4.00) causing HDCHEK to issue an
  1660.           incorrect error report on an abort resulting from a FAT comparison
  1661.           error corrected.
  1662.  
  1663.           2) Minor deficiency, causing HDTEST to create an empty log file on the
  1664.           specified device when both a log device and the /P option were
  1665.           specified, corrected.
  1666.  
  1667.           3) Work-around for hardware multi-sector read ECC problem (see
  1668.           Appendix B) added (HDTEST).
  1669.  
  1670.           4) Support for small (<= 10 Mb) hard disks patched to have small
  1671.           clusters and 16-bit FATs added.
  1672.  
  1673.           5) Requirement that command line option flags be separated by one or
  1674.           more spaces or tabs removed.
  1675.  
  1676.           6) /R option added (to HDTEST) for multi-pass disk testing.
  1677.  
  1678.  
  1679.           Version 4.30
  1680.           ____________
  1681.  
  1682.           1) Support for BIOS-level access to DOS 3.3 extended partitions added.
  1683.  
  1684.           2) /Z option added (to HDTEST) to control remapping of unreadable
  1685.           sectors in bad clusters.
  1686.  
  1687.  
  1688.           Version 4.10
  1689.           ____________
  1690.  
  1691.           1) Assorted minor changes made to screen displays.
  1692.  
  1693.           2) /C option added to allow the programs to be used on some non-IBM
  1694.           compatible MS-DOS systems.
  1695.  
  1696.           
  1697.           
  1698.                                          Page 23 
  1699.            
  1700.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  1701.           _______________________________        _______________________________
  1702.           
  1703.           
  1704.           3) /D option redefined - old /D option became new /I option.
  1705.  
  1706.           4) /F option added (to HDTEST).
  1707.  
  1708.           5) "Short" form of /H option added.
  1709.  
  1710.  
  1711.           Version 3.13
  1712.           ____________
  1713.  
  1714.           1) Assorted minor bugs and deficiencies in error reporting and
  1715.           termination routines fixed (HDTEST).
  1716.  
  1717.           2) Minor bug affecting reporting of multiple corrected ECC errors
  1718.           fixed (HDTEST).
  1719.  
  1720.           3) Disk reset added before retry on all errors (HDTEST).
  1721.  
  1722.           4) Absolute limit on number of files and directories on device
  1723.           removed.
  1724.  
  1725.           5) Display of total sector/cluster count during testing added
  1726.           (HDTEST).
  1727.  
  1728.           6) /A option added.
  1729.  
  1730.           7) /B option added (HDTEST).
  1731.  
  1732.  
  1733.           Version 2.73
  1734.           ____________
  1735.  
  1736.           1) Bug (in V2.60) which could cause bad termination and possible
  1737.           subdirectory inconsistencies if a sector which was not in use was
  1738.           found to be bad, fixed (HDTEST).
  1739.  
  1740.           2) Bug (in V2.70) which caused HDTEST to enter a terminal input loop
  1741.           if ANSI.SYS was not loaded and <Esc> was entered to abort it, fixed.
  1742.  
  1743.           3) Minor bug in V2.60 (which resulted in a failed directory scan if
  1744.           the program was run on a write-protected device) fixed.
  1745.  
  1746.           4) Internal changes made to avoid interference with expanded memory
  1747.           device handlers.
  1748.  
  1749.           5) Ability to update disk after HDTEST terminated by user (typing
  1750.           <Esc>) added.
  1751.  
  1752.           6) /S option to start checking occupied clusters at a given cluster
  1753.           number added (HDTEST).
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.           
  1764.           
  1765.                                          Page 24 
  1766.            
  1767.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  1768.           _______________________________        _______________________________
  1769.           
  1770.           
  1771.                            APPENDIX A - SUMMARY OF FLAG SETTINGS
  1772.                            _____________________________________
  1773.  
  1774.           /A(T) - used to tell the HD program that it is being run on an IBM AT
  1775.           (HDCHEK and HDTEST). /A is not equivalent to /HF000.
  1776.  
  1777.           /B(oot/Partition sector test) - used to include the hard disk
  1778.           boot/partition sector in the DOS area for the purposes of read/write
  1779.           testing (HDTEST only).
  1780.  
  1781.           /C(lone BIOS)n - used in systems which do not support the IBM BIOS's
  1782.           INT 11 "equipment determination" BIOS function (e.g. the Tandy 2000).
  1783.           The parameter ("n") is the number of floppy drives attached to the
  1784.           system, which is otherwise determined automatically (HDCHEK and
  1785.           HDTEST).
  1786.  
  1787.           /CQ (Compaq) - used to indicate that the program is running on a
  1788.           Compaq system. If DOS 3.31 (or above) is in use, large (> 32 Mb)
  1789.           devices are supported (HDCHEK and HDTEST).
  1790.  
  1791.           /D(OS interrupts) forces the program to use only DOS interrupts
  1792.           (INT 25 and INT 26) for access to the target device. May not be
  1793.           combined with the /I, /H, or /U flag (HDCHEK and HDTEST).
  1794.  
  1795.           /F(ast mode) limits read/write testing to the use of two patterns only
  1796.           (HDTEST only).
  1797.  
  1798.           /G(ive error details) allows the physical disk location of bad sectors
  1799.           to be identified (HDTEST only).
  1800.  
  1801.           /H(ex BIOS address)nnnn[:nnnn] - used to tell the HD programs that the
  1802.           ROM BIOS of the device being tested is located at nnnn, which is
  1803.           interpreted as a Hexadecimal segment address, rather than at the (CPU-
  1804.           dependent) default. The extended (segment:offset) form of the command
  1805.           is used to force the programs to use the given address as the INT 13
  1806.           entry point (HDCHEK and HDTEST).
  1807.  
  1808.           /I(nterrupt 13) - forces the program to use the existing INT 13
  1809.           vector.  This is the default under DOS 2.x. May not be combined with
  1810.           the /D, /H, or /U flag (HDCHEK and HDTEST).
  1811.  
  1812.           /M(ulti-track read problem) - bypasses the multi-track read problem
  1813.           which also prevents certain otherwise IBM-compatible clones from
  1814.           running PC-DOS 3.3 (HDCHEK and HDTEST).
  1815.  
  1816.           /N(o Query) - disables the individual prompts for confirmation which
  1817.           the program normally issues before remapping "special" clusters - does
  1818.           not prevent the program from prompting for confirmation before
  1819.           ___                                                           
  1820.           updating the disk (HDTEST only).
  1821.  
  1822.           /P(rint) - causes the log file to be directed to the PRN device
  1823.           (HDTEST only).
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.           
  1831.           
  1832.                                          Page 25 
  1833.            
  1834.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  1835.           _______________________________        _______________________________
  1836.           
  1837.           
  1838.           /R(epeat)n - causes HDTEST to perform n complete testing cycles (or to
  1839.           continue until interrupted for n=0) (HDTEST only).
  1840.  
  1841.           /S(tart from)nnnnn - causes HDTEST to start testing occupied clusters
  1842.                                                               ________         
  1843.           at cluster number nnnnn (expressed as a decimal number) (HDTEST only).
  1844.  
  1845.           /U(se existing INT 68 vector) - causes the HD programs to use the
  1846.           existing INT 68 vector as the INT 13 entry point (HDCHEK and HDTEST).
  1847.                    ______                                                      
  1848.  
  1849.           /V(irtual mode) - bypasses normal prohibition on running program if
  1850.           80286 or better CPU is operating in "virtual mode". Allows use with
  1851.           QEMM-386 and 386^Max.
  1852.  
  1853.           /X(clude marked bad sectors) - causes HDTEST to report on but not
  1854.           retest clusters that are already marked as bad (HDTEST only).
  1855.  
  1856.           /Y(es, please remap)n - allows HDTEST to update the disk by remapping
  1857.           up to n new bad sectors without prompting for confirmation (HDTEST
  1858.                                   _______                                   
  1859.           only).
  1860.  
  1861.           /Z(ap bad sectors)n - controls remapping of unreadable sectors in bad
  1862.           clusters (HDTEST only) - n may have one of the following values:
  1863.               0 - Remap clusters with any unreadable sectors to all NULLs
  1864.               1 (default) - Remap only actual unreadable sectors to NULLs
  1865.               2 - Transfer all data read to the new cluster
  1866.  
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.           
  1899.           
  1900.                                          Page 26 
  1901.            
  1902.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  1903.           _______________________________        _______________________________
  1904.           
  1905.           
  1906.                              APPENDIX B - DISK ERROR MESSAGES
  1907.                              ________________________________
  1908.  
  1909.           Users of earlier versions of this software repeatedly requested that I
  1910.           provide a more detailed explanation of the significance of some of the
  1911.           error messages displayed by HDTEST when it encounters a bad sector or
  1912.           cluster on the disk. It is not possible to do this without assuming
  1913.           (or imparting) a more detailed understanding of the "nitty-gritty"
  1914.           details of data storage on hard and floppy disks than most people want
  1915.           or need, let alone possess. This Appendix is not, therefore, "required
  1916.           reading" for the safe or effective use of the HD programs. It is
  1917.           intended as a tutorial for those who would like to understand some-
  1918.           thing more of what is really going on on their hard or floppy disk
  1919.                                 ______                                      
  1920.           drive when the little red light comes on.
  1921.  
  1922.           For the purposes of what follows, it is (fortunately) not necessary to
  1923.           know or understand exactly how changes in magnetic flux on the surface
  1924.           of a hard (or floppy) disk are translated into binary data, or vice
  1925.           versa. That could be the subject of another long dissertation. I will
  1926.           simply take for granted that binary data, conceptually organized into
  1927.           8-bit bytes, can be read and written by the disk drive hardware under
  1928.           the command of its controller (which usually resides on a separate
  1929.           card plugged into one of the computer's expansion slots). I will be
  1930.           describing how blocks of data are physically arranged on a disk and
  1931.           how the disk controller goes about ensuring that the data it reads has
  1932.           not been corrupted since it was written.
  1933.  
  1934.           I propose to start off by referring to some of the error-detection and
  1935.           error-correction techniques and procedures that are applied to data
  1936.           stored on magnetic media. These techniques and procedures are
  1937.           necessary because, although magnetic media are very reliable and the
  1938.           technology of recording and playback is well understood, there always
  1939.           remains the possibility that a defect in the medium or some other
  1940.           intercurrent problem may cause the sequence of bytes read back from a
  1941.           disk or tape to be something other than a perfect duplicate of the
  1942.           sequence that was stored. If a single copy of the raw data were all
  1943.           that were recorded, there would be no way of immediately detecting
  1944.           (let alone correcting) such an error. It might be brought to light
  1945.           when the file that was changed caused problems when it is used by or
  1946.           executed as a program, but it might not become apparent until it had
  1947.           propagated itself through and caused problems or errors in multiple
  1948.           other programs or files. This would clearly be an unacceptable state
  1949.           of affairs. In order to prevent this from occurring, then, there
  1950.           should be some means of checking data which is read in from storage
  1951.           for errors, and/or (preferably) of correcting any errors which may
  1952.           have occurred before any use is made of the data.
  1953.                         ______                             
  1954.  
  1955.           Although error checking and/or correction can (and sometimes does)
  1956.           take place at any level from that of the application program down to
  1957.           that of the device controller, I am only going to describe the means
  1958.           that are used by hard and floppy disk controllers. When a block of
  1959.           data is passed to the controller to be written to the disk, a series
  1960.           of arithmetical operations is performed in sequence on all the bytes
  1961.           in the block, to produce a 2-byte (for diskettes) or multi-byte (for
  1962.           hard drives) code. The diskette controller implements what is known as
  1963.           a cyclic redundancy check (CRC) algorithm, which is optimized to allow
  1964.           detection of all single bit errors and many longer error bursts (it is
  1965.           _________                                                             
  1966.           reasonable to assume that errors will most probably either affect a
  1967.           
  1968.           
  1969.                                          Page 27 
  1970.            
  1971.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  1972.           _______________________________        _______________________________
  1973.           
  1974.           
  1975.           single bit at random or, if they result from media defects, a number
  1976.           of adjacent bits). The longer (at least 32-bit) error correcting code
  1977.           (ECC) calculated by a hard disk controller gives enough information to
  1978.           allow detection and correction of, at least, all single bit errors and
  1979.                           ______________                                        
  1980.           detection of most likely longer error bursts. The CRC or ECC is saved
  1981.           on disk with the data and is read back in by the controller when the
  1982.           data is read. The controller then compares the saved CRC or ECC with
  1983.           one newly calculated from the data. If the two are identical, the data
  1984.           is assumed to be valid and a successful read is signalled. If there is
  1985.           a discrepancy, a diskette controller always returns the data with a
  1986.           "CRC error", since the CRC code does not contain enough information to
  1987.           allow the incorrect bit or bits to be identified. On a hard disk, if
  1988.           the ECC comparison suggests a correctable error, it will be corrected,
  1989.           and the read call will return with a "Corrected ECC Error" code but
  1990.           with (presumably) valid data in the transfer buffer. If a more
  1991.           extensive error is detected, on the other hand, the call returns with
  1992.           a "Uncorrectable ECC Error" code (which is the same as the CRC error
  1993.           code).
  1994.  
  1995.           The 32-bit ECC used by IBM and many compatible disk manufacturers
  1996.           allows correction of single-bit errors only. Manufacturers of other,
  1997.                                                  ____                         
  1998.           usually more expensive, controllers use longer and more complex ECCs,
  1999.           to allow the correction of some multi-bit errors, but the necessity to
  2000.           minimize the time taken to calculate the ECC (which is part of "access
  2001.           time") sets tight limits on how complex it can be. ECC error
  2002.           correction is unfortunately not infallible. It is possible for a
  2003.                                       ___                                 
  2004.           complex, uncorrectable error to result in the same ECC disparity as a
  2005.                    __                                                          
  2006.           different, correctable, error, so that invalid "corrected" data can be
  2007.                                                                           ______
  2008.           returned. The longer and more complex the ECC, the less likely this
  2009.           becomes, but there is no way of completely avoiding this ambiguity,
  2010.           short of keeping multiple copies of the data on the disk. In addition,
  2011.           some hard disk controllers* apparently abort with the "corrected ECC
  2012.           error" code immediately on encountering a sector containing such an
  2013.                       ___________                                            
  2014.           error, even if it is not the last sector in the block specified by a
  2015.                                ___                                            
  2016.           (multi-sector) read request. This non-intuitive (to say the least of
  2017.           it) behavior can combine with DOS 3.x's habit of ignoring corrected
  2018.                                                            ________          
  2019.           ECC errors to result in apparently inexplicable disk-related problems,
  2020.           up to and including system crashes (if the file in which the problem
  2021.           occurred contained executable code). This hardware deficiency may be
  2022.           related to the problems which have plagued users of DOS 3.3 on some
  2023.           (previously) apparently IBM-compatible non-IBM hardware, since these
  2024.           also result from (similar but distinct) deficiencies in the clones'
  2025.           handling of multi-sector disk reads. Prior to V4.36, HDTEST did retry
  2026.                                                                       ___      
  2027.           corrected ECC errors which were reported on the first read of a
  2028.           cluster, but would eventually (if the corrected error persisted)
  2029.           accept the data read as valid and copy and remap it to a "good"
  2030.           cluster. This could cause trouble if the controller had the "immediate
  2031.           abort on corrected ECC error" problem described above and the ECC
  2032.                                                                 ___        
  2033.           error were not in the last sector of the cluster, since the sectors
  2034.           after the "bad" one would not have been read, and would be lost
  2035.           (actually replaced by the corresponding sectors from the previous
  2036.                                                                    ________
  2037.           cluster read) after remapping. On a machine with this problem, DOS
  2038.  
  2039.           _____________________________________________________________________
  2040.  
  2041.           * This behavior is known to occur with some early Western Digital
  2042.           controllers (1002A-WX1, 1002S-WX2) but it may occur with others, too.
  2043.           
  2044.           
  2045.                                          Page 28 
  2046.            
  2047.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  2048.           _______________________________        _______________________________
  2049.           
  2050.           
  2051.           would not, of course, have done any better than the earlier versions
  2052.           of HDTEST at reading the bad cluster, and HDTEST at least warned you
  2053.           that there was a problem, but the behavior described was certainly not
  2054.           ideal. From V4.36, HDTEST rereads clusters in which a persistent
  2055.           corrected ECC error is reported on the initial read sector by sector,
  2056.                                                               ________________ 
  2057.           to ensure that all the data in the cluster is transferred when it is
  2058.                          ___                                                  
  2059.           remapped. In most cases (as long as the ECC error was really
  2060.                                                                 ______
  2061.           correctable), this will save the cluster (and the file of which it is
  2062.           a part) intact.
  2063.  
  2064.           DOS allows the programmer and/or computer user to think of and deal
  2065.           with disk data in terms of files, lines, and/or records, but data is
  2066.           always moved between a disk and memory a sector at a time. Any disk
  2067.           read or write request passed to DOS eventually gets translated into a
  2068.           command to read or write one or more sectors on the disk, commencing
  2069.           at a specified head, track, and sector. A floppy disk may have either
  2070.           one or two usable surfaces, corresponding to the top and bottom of the
  2071.                             ________                                            
  2072.           disk. A hard disk usually has at least two surfaces, and may have
  2073.           more, since multiple physical "platters" are frequently incorporated
  2074.           in a single device. Each surface is normally accessed by and
  2075.           corresponds to a single read/write head, which moves radially across
  2076.                                              ____                             
  2077.           it, although one surface on newer disks is often reserved for "servo"
  2078.           tracks, which are written with a special pattern that allows the
  2079.           controller to ensure that the read/write heads are kept exactly
  2080.           aligned with the data tracks. For a single device, the (data) heads
  2081.           are, by convention, numbered sequentially from zero up to one less
  2082.           than the total number present. Each surface is further divided into a
  2083.           number of circumferential tracks (or cylinders) and each track is
  2084.                                     ______     _________                   
  2085.           divided into a number of sectors. Again by convention, the tracks on
  2086.                                    _______                                    
  2087.           each surface are also numbered sequentially from zero, with track zero
  2088.           being the outermost track. The sectors on each track are normally
  2089.           numbered from one to a number corresponding to the total number of
  2090.                         ___                                                 
  2091.           sectors on the track, but adjacent sectors do not normally have
  2092.                                                         ___              
  2093.           consecutive sector numbers. A typical arrangement of the seventeen
  2094.           sectors on a single track of an XT hard disk, for example, would be as
  2095.           follows: 1,8,15,5,12,2,9,16,6,13,3,10,17,7,14,4,11. This "inter-
  2096.                                                                     ______
  2097.           leaving" of sectors helps to make multi-sector disk reads and writes
  2098.           _______                                                             
  2099.           more efficient. The controller requires a finite time to process the
  2100.           data from one sector before it can start reading (or writing) the
  2101.           next. During this time, of course, the disk continues to rotate and
  2102.           one or more of the sectors which physically "follow" the one that was
  2103.           last accessed pass under the read/write head unread. Ideally, the
  2104.           interleave (number of physical sectors separating consecutively
  2105.           numbered sectors) should be such that the next sector is just about to
  2106.           come under the read-write head when the controller is free to deal
  2107.           with it, but, because this time is not exactly predictable, it is
  2108.           better to be too conservative (as IBM usually is) and make it one or
  2109.           two sectors longer than necessary than to be too optimistic. Too small
  2110.           an interleave value is very undesirable, because it results in the
  2111.           controller having to wait almost a complete disk rotation time for
  2112.           each sector it misses to come round again.
  2113.  
  2114.           At the beginning of each disk sector is an address mark, a short,
  2115.                                                      ____________          
  2116.           recognizable (to the controller) bit sequence containing the track and
  2117.           sector number. The process of writing the address marks for each
  2118.           sector on a disk is known as "low-level" or "sector" formatting. The
  2119.           DOS FORMAT program does this when it is run on floppy disks, but on
  2120.           
  2121.           
  2122.                                          Page 29 
  2123.            
  2124.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  2125.           _______________________________        _______________________________
  2126.           
  2127.           
  2128.           hard disks the DOS program merely makes sure that all required address
  2129.           marks are present - they are created by the disk manufacturer or
  2130.           supplier's low-level format program, which may or may not be available
  2131.           to the end user. After each address mark there follows a short gap (to
  2132.           allow the controller time to recognize and respond to the address
  2133.           mark), then the raw data, then the CRC or ECC data. A sector normally
  2134.           contains 512 bytes of raw data, but DOS (and HDTEST) can recognize and
  2135.           deal appropriately with devices with non-standard sector sizes.
  2136.  
  2137.           When a sector read/write command is passed to the disk controller, it
  2138.           (the controller) causes the disk's read/write head to move (seek) to
  2139.                                                                       ____    
  2140.           the specified track, waits a few milliseconds for it to settle down,
  2141.           and then starts to "pay attention to" the data passing underneath it.
  2142.           The controller locates and reads the address marks to confirm that the
  2143.           read/write head is positioned at the correct track and to identify
  2144.           each sector. If data is being read from the disk, the raw data and
  2145.           recorded CRC or ECC from the requested sector(s) are transferred into
  2146.           the disk controller's internal buffers and (assuming that no errors
  2147.           are detected), thence to main memory. If data is being written, the
  2148.           controller derives the error-checking data from the raw data and
  2149.           writes both to the disk. Some of this process is under the direct
  2150.           control of the controller hardware, but it is supervised by the
  2151.           device's ROM BIOS, which is responsible for error-reporting. Errors
  2152.           can occur at almost any stage of the read/write process, but (if the
  2153.           disk is working at all) usually result from media defects or problems
  2154.           developing in the mechanical components of the hard disk drive. Media
  2155.           defects, once present, are generally constant in size and position
  2156.           (although jarring a disk while it is being written to may sometimes
  2157.           generate a temporary bad sector).
  2158.                      _________             
  2159.  
  2160.           When HDTEST detects an error during read/write testing of a sector or
  2161.           cluster which has not previously been marked as bad, a (normally)
  2162.           four-line error message is printed, either to the screen (by default),
  2163.           to the printer (/P option), or to the logging file (if an output
  2164.           device was specified). The first line of the message simply indicates
  2165.           the sector or cluster number at which the error occurred. The second
  2166.           line indicates what sort of error was detected and during what phase
  2167.           of read/write testing it occurred. The third line indicates whether
  2168.           HDTEST was able to recover and/or remap the data from the bad sector
  2169.           or cluster, and the fourth indicates either the file which a bad
  2170.           cluster formed part of or that the cluster was not in use. If it was
  2171.           not possible to read one or more sectors from a cluster which
  2172.           contained data (unrecoverable read error), a further two-line message
  2173.           is printed which notes how many sectors were unreadable and how the
  2174.                                           _______                            
  2175.           data from the bad cluster has been remapped (which depends on whether
  2176.           a /Zn option was specified on the command line). If the /M flag is not
  2177.           specified when HDTEST is run on a system that suffers from the "multi-
  2178.           track read" problems discussed in the main part of the documentation,
  2179.           multiple bad clusters may be reported with no errors persisting on
  2180.                                                      __                     
  2181.           sector-by sector reading. These reports should disappear if the /M
  2182.           flag is used.
  2183.  
  2184.           If the "verbose" form of the /G option is used, the bad sector report
  2185.           will contain the equivalent of the second and third lines of the bad
  2186.           cluster report for each bad sector. Note that, if the /X option is not
  2187.                          ___________________                                    
  2188.           used to prevent testing of previously flagged bad clusters, these may
  2189.           give rise to spurious warnings of possible data loss in the third line
  2190.           
  2191.           
  2192.                                          Page 30 
  2193.            
  2194.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  2195.           _______________________________        _______________________________
  2196.           
  2197.           
  2198.           of the bad sector report. If no unrecoverable bad clusters were
  2199.                                                             ________     
  2200.           reported, such warnings can safely be ignored. If the default form of
  2201.           the /G option is used, the bad sector report gives only a Hex error
  2202.           code for each bad sector. The LSB of this code is the value returned
  2203.           (in AH) by INT 13. The MSB of the code depends on the phase of testing
  2204.           during which the error occurred. In general, if the first digit (of a
  2205.           four digit code) is C or above, an unrecoverable error occurred, but
  2206.           error codes FFFD through FFFF have special meanings and indicate
  2207.           recovered errors.
  2208.  
  2209.           When the program detects an error during read/write testing of a
  2210.           sector in the DOS area, only the first three lines described above are
  2211.           printed and the program aborts. The remainder of this Appendix
  2212.           contains more details of and further information on the possible
  2213.           contents of lines two and three of HDTEST's disk error message.
  2214.  
  2215.           The second line of the disk read/write error message will usually take
  2216.           the form: "[Error Type] occurred during [phase of testing]". Possible
  2217.           values for [Error Type] are as follows (in alphabetical order):
  2218.  
  2219.           Address Mark Not Found - this is a fairly common error reported for
  2220.           bad blocks which are present from "scratch" on a new disk, since a
  2221.           significant media defect may well not retain sector formatting data
  2222.           and/or the manufacturer may have made sure that a known bad track on
  2223.           the disk will not be used by deliberately not writing address marks
  2224.           there. If new bad clusters are reported with this error message, it is
  2225.           likely that the hard disk surface has been physically damaged (perhaps
  2226.           by a shock to the drive) but possible that the controller has a
  2227.           problem.
  2228.  
  2229.           Bad Controller - this means what it says, but check that all boards
  2230.           and cables are properly seated before giving up.
  2231.  
  2232.           Bad Sector - the BIOS was instructed to read a sector number which
  2233.           should not (according to its configuration data) exist on the device.
  2234.           This indicates either an internal program error or that the program is
  2235.           having a problem determining the physical layout of the disk. Check
  2236.           the values reported by HDCHEK against those in the disk documentation.
  2237.  
  2238.           Bad Track - analogous to "Bad Sector".
  2239.  
  2240.           Buffer Comparison - the data read from a sector differs from that
  2241.           written to it. This should not happen, since it suggests either that
  2242.           the device's error-detection functionality has failed or that it has
  2243.           been overwhelmed. If it does occur, the most likely causes are
  2244.           controller and memory problems (in that order of likelihood).
  2245.  
  2246.           Corrected ECC - as discussed at some length above, the data retrieved
  2247.           from a hard disk was incorrect but the device's error-correction
  2248.           hardware was (probably) able to correct it.
  2249.  
  2250.           DMA Boundary Violation - should not occur (HDTEST positions its
  2251.           buffers to avoid crossing segment boundaries). Suggests either an
  2252.           internal program error or a controller/BIOS problem.
  2253.  
  2254.  
  2255.  
  2256.           
  2257.           
  2258.                                          Page 31 
  2259.            
  2260.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  2261.           _______________________________        _______________________________
  2262.           
  2263.           
  2264.           Hardware Timeout - a seek or other operation was not completed within
  2265.           the maximum time allowed by the BIOS. Check connections, reseat
  2266.           boards, otherwise suspect the mechanics of the disk.
  2267.  
  2268.           Init Fail - should not occur (on a working disk).
  2269.  
  2270.           Internal - internal program error. Make sure that your working copy of
  2271.           HDTEST has not been corrupted. The disk is probably not defective.
  2272.  
  2273.           Invalid Command - should not occur. Treat as Internal Error.
  2274.  
  2275.           Multiple Errors - one or more additional errors occurred while HDTEST
  2276.           was attempting to recover from an initial one. Multiple phase report
  2277.           lines will be printed but the error types cannot be further specified.
  2278.  
  2279.           Recovered - HDTEST recovered from the error and did not report on the
  2280.           error type (should not occur).
  2281.  
  2282.           Reset Fail - The device could not be reset (after an error). Usually
  2283.           indicates major problems with the disk or controller, but check
  2284.           connections, etc.
  2285.  
  2286.           Sector Not Found - the requested sector's address mark was not found.
  2287.           Likely to result from a media defect.
  2288.  
  2289.           Seek Fail - after a seek to a track, the controller found that the
  2290.           read/write head was not positioned correctly. Usually indicates a
  2291.           significant problem with the (drive) hardware.
  2292.  
  2293.           Sense Fail - the controller cannot find the drive! Check connections,
  2294.           etc.
  2295.  
  2296.           Uncorrected ECC - data error too major to be corrected. Usually a
  2297.           media defect. This message will also be produced if a CRC error is
  2298.           detected on a floppy disk.
  2299.  
  2300.           Undefined - the BIOS cannot figure out what went wrong, but something
  2301.           did!
  2302.  
  2303.           Unknown - likewise!
  2304.  
  2305.           Write Protection - HDTEST is attempting to write to a write-protected
  2306.           device.
  2307.  
  2308.  
  2309.           Possible forms for the rest of the second line are as follows:
  2310.  
  2311.           ... Error (unrecovered) occurred during first read - the cluster could
  2312.           not be read without error in five tries before a seek to the other
  2313.           "end" of the disk.
  2314.  
  2315.           ... Error occurred during first read - the error occurred during the
  2316.           first read but was recovered after one or more retries.
  2317.  
  2318.           ... Error occurred during read after seek - the error occurred when
  2319.           the cluster was read after a seek away.
  2320.  
  2321.           
  2322.           
  2323.                                          Page 32 
  2324.            
  2325.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  2326.           _______________________________        _______________________________
  2327.           
  2328.           
  2329.           ... Error occurred during pattern read/writes - the error occurred
  2330.           during the pattern read/write phase of testing.
  2331.  
  2332.           ... Error occurred during final write - the error occurred when the
  2333.           saved copy of the cluster was being restored to the disk.
  2334.  
  2335.           ... Error occurred during read after final write - the error occurred
  2336.           when the restored cluster was being read back.
  2337.  
  2338.           ... (Buffer comparison) error occurred after final read - the copy of
  2339.           the cluster read back after restoration to the disk differed from its
  2340.           original memory image.
  2341.  
  2342.  
  2343.           There are only three basic forms of the third line:
  2344.  
  2345.           This error is (or "These errors are") recoverable (no data loss has
  2346.           occurred). - the bad cluster was read successfully and has been
  2347.           successfully restored to its original form, but it remains suspect and
  2348.           will (with your permission) be remapped.
  2349.  
  2350.           This error is unrecoverable, but remapping is possible. - the bad
  2351.           cluster was read successfully but has not been restored to its
  2352.                                                 ___                     
  2353.           original form. Remapping should be successful, but the data will be
  2354.           lost if this is not permitted.
  2355.  
  2356.           This error is unrecoverable, and data may be lost! - the bad cluster
  2357.           was not read successfully and will be remapped as provided by the
  2358.           value of the /Z switch parameter if remapping is permitted. In any
  2359.           event, some data loss has almost certainly occurred.
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387.           
  2388.           
  2389.                                          Page 33 
  2390.                 
  2391.                Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  2392.                _______________________________        _______________________________
  2393.                
  2394.                
  2395.  
  2396.                    APPENDIX C - EXAMPLE PROGRAM RUNS
  2397.                    _________________________________
  2398.  
  2399.      Screen display from successful run of HDCHEK on partition occupying the
  2400.      whole of a 20 Mb hard disk:
  2401.  
  2402. Device C: appears to be the DOS partition of a hard disk
  2403. It contains 41531 sectors
  2404. It starts at absolute sector 17 on the disk      {THIS IS CORRECT}
  2405.                                                   _______________ 
  2406. The total partition size is approximately 20 Mb
  2407. There are 4 heads and 17 sectors/track
  2408. Sector size is 512 bytes
  2409. Each of the 2 (16 bit) FATs occupies 41 sectors
  2410. The Root Directory occupies 32 sectors
  2411. The data area starts at DOS sector 115, and contains 10354 clusters, each
  2412. consisting of 4 sectors
  2413. The directory scan was successful; a total of 1260 files and subdirectories
  2414. was found.
  2415.  
  2416.  
  2417.  
  2418.      Screen display from successful run of HDCHEK on a freshly FORMATted DSDD
  2419.      9-sector floppy disk:
  2420.  
  2421. Device A: is not a hard disk - using DOS interrupts
  2422.  
  2423.  
  2424. Device A: is a floppy disk
  2425. The disk contains 720 sectors
  2426. There are 2 heads and 9 sectors/track
  2427. Sector size is 512 bytes
  2428. Each of the 2 (12 bit) FATs occupies 2 sectors
  2429. The Root Directory occupies 7 sectors
  2430. The data area starts at DOS sector 12, and contains 354 clusters, each
  2431. consisting of 2 sectors
  2432. The directory scan was successful; a total of 0 files and subdirectories
  2433. was found.
  2434.  
  2435.  
  2436.      Screen display from run of HDCHEK on 20 Mb DOS partition - directory
  2437.      structure bad or unrecognizable:
  2438.  
  2439. Device C: appears to be the DOS partition of a hard disk
  2440. It contains 41531 sectors
  2441. It starts at absolute sector 17 on the disk
  2442. The total partition size is approximately 20 Mb
  2443. There are 4 heads and 17 sectors/track
  2444. Sector size is 512 bytes
  2445. Each of the 2 (16 bit) FATs occupies 41 sectors
  2446. The Root Directory occupies 32 sectors
  2447. The data area starts at DOS sector 115, and contains 10354 clusters, each
  2448. consisting of 4 sectors
  2449. The preliminary directory scan failed.
  2450.  
  2451.  
  2452.  
  2453.  
  2454.                
  2455.                
  2456.                                               Page 34 
  2457.                 
  2458.                Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  2459.                _______________________________        _______________________________
  2460.                
  2461.                
  2462.      Screen display from run of HDCHEK on 20 Mb DOS partition - FATs not
  2463.      identical:
  2464.  
  2465. FATS are different
  2466. FAT discrepancy at byte 20F - FAT 1 has FF; FAT 2 has F8
  2467. Continue comparison (Y/N)? [Y]: n     {user input}
  2468.                                 _                 
  2469.  
  2470. Device C: appears to be the DOS partition of a hard disk
  2471. It contains 41531 sectors
  2472. It starts at absolute sector 17 on the disk
  2473. The total partition size is approximately 20 Mb
  2474. There are 4 heads and 17 sectors/track
  2475. Sector size is 512 bytes
  2476. Each of the 2 (16 bit) FATs occupies 41 sectors
  2477. The Root Directory occupies 32 sectors
  2478. The data area starts at DOS sector 115, and contains 10354 clusters, each
  2479. consisting of 4 sectors
  2480.  
  2481.  
  2482.  
  2483.      Screen display from run of HDCHEK - program unable to deduce disk
  2484.      structure - disk not recognizable as a DOS device:
  2485.  
  2486. Unrecognized media descriptor byte! - see error code
  2487. Error Code = F1      {F1 is not a media descriptor byte used by DOS}
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519.  
  2520.                
  2521.                
  2522.                                               Page 35 
  2523.            
  2524.           Documentation for HDTEST V4.95          Copyright 1990, P. R. Fletcher
  2525.           _______________________________        _______________________________
  2526.           
  2527.           
  2528.      Log file from successful run of HDTEST on 20 Mb DOS partition:
  2529.  
  2530.      HDTEST Log File - Wed Jan 07 11:44:52 1986
  2531.      Testing Device C:
  2532.  
  2533.      No new bad clusters identified - HDTEST finished.
  2534.      Wed Jan 07 16:10:41 1987
  2535.  
  2536.  
  2537.      Log file from run of HDTEST on 20 Mb DOS partition - one bad cluster
  2538.      detected and remapped:
  2539.  
  2540.      HDTEST Log File - Mon Jan 05 21:09:32 1987
  2541.      Testing Device C:
  2542.  
  2543.      Read/Write error at cluster number 7623!!
  2544.      Corrected ECC error occurred during pattern read/writes
  2545.      This error is recoverable (no data loss has occurred).
  2546.      Bad cluster is in file \MYFILES\DATA5\FFT1234.DAT
  2547.  
  2548.      1 new bad clusters identified, marked, and remapped - HDTEST finished.
  2549.      Tue Jan 06 05:08:04 1987
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.           
  2586.           
  2587.                                          Page 36 
  2588.  
  2589.                         REGISTRATION FORM - HDTEST V4.95
  2590.                         ________________________________
  2591.  
  2592.      Please complete this form and return it with a check or money order for
  2593.      $35.00 (+ $5.00 for shipping outside North America) or equivalent to:
  2594.  
  2595.                      Peter R. Fletcher
  2596.                      1515 West Montgomery Avenue
  2597.                      Rosemont
  2598.                      PA 19010
  2599.                      U.S.A.
  2600.  
  2601.      None of the information on this form will be passed on to any other
  2602.      individual or commercial organization.
  2603.  
  2604.      --------------------------------------------------------------------------
  2605.  
  2606.      This information is required to process your Registration:
  2607.  
  2608.      Last Name:____________________________  Other Names:______________________
  2609.  
  2610.      Address:______________________________  Town/City:________________________
  2611.  
  2612.      State:_____________  Post Code:____________  Telephone:_________________
  2613.                                                            (evenings/weekends)
  2614.  
  2615.      I understand that this software is supplied without warranty, express or
  2616.      implied, and agree not to hold its author liable for any direct or
  2617.      consequential loss arising out of my use of it.
  2618.  
  2619.      Signature:______________________________
  2620.  
  2621.      -------------------------------------------------------------------------
  2622.  
  2623.      You are requested, but not required, also to answer the following
  2624.      questions:
  2625.  
  2626.      On What type(s) of computer are you using HDTEST? _________________________
  2627.  
  2628.      CPU (8088, 8086, etc.)? __________   Amount of RAM (kB)? ____________
  2629.  
  2630.      Type & Size of Hard Disk(s)? ____________________________________
  2631.  
  2632.      Make and Type of Hard Disk Controller(s)? ______________________________
  2633.  
  2634.      Do you own a Modem?                                             Y  N
  2635.  
  2636.      Are you a member of BIX?   Y  N        Compuserve?              Y  N
  2637.  
  2638.      How did you obtain/hear about this program?
  2639.  
  2640.      Did you think that the $35.00 registration fee for this program was:
  2641.  
  2642.      Very Good Value?              About Right?             Excessively High?
  2643.  
  2644.  
  2645.      Are there any other utility programs that you would like to see made
  2646.      available as "User Supported Software"? What sort of programs?
  2647.  
  2648.  
  2649.