        IDEINFO.EXE                                     Page 1

                Contents

        Introduction.......................... 1
        Output................................ 2
        How to interpret the output........... 3
        Updating CMOS parameters...............5
        Making an autodetect floppy............6
        Speedtest..............................7

        Some notes............................ 8
        Credits............................... 8
        Me.................................... 8
        Changes, additions.................... 9


        Introduction
        -------------

        Try ? or H as parameter and you will see a short description of
        possible parameters. This is what the output looks like:
        ________________________________________________________________
IDEINFO [H || ?] || [R] || [CMOS] || [F [P xxx] [P xxx].. ]

Version 1.1g. Tries to tell all about all IDE drives, including ATA-2 stuff.

Options may be preceded with -, / or none
-H or -? prints this help.
-R Reads idedrive.* files from current directory.
-CMOS allows to update CMOS with new drive parameters,
 works with AMI BIOS if it has user definable types
-F Writes drive identify info to idedrive.* files to current directory.
-P xxx looks only adapter at port xxx, xxx in hex format

 File extension is next available number when writing.

 File size is 512 bytes.
 You may redirect output.

 Example: Look only for adapters at 1F0h (primary) and 170h (normal secondary)
 and write info to files.
 IDEINFO P 1f0 P 170 F
        ________________________________________________________________


        Default action is to scan all four addresses mentioned in ATA-2
        draft spec for IDE adapters(1f0h, 0170h, 0f0h, 070h), if found,
        report characteristics of master drive and search also for
        slave.
        File format will remain the same even when new versions of
        ideinfo appear. That is because ideinfo uses the same raw
        format that the drive sends.
        Better way than redirecting output is therefore to store
        drive info to files. New version of ideinfo may find new
        features or be more accurate. If you have a file stored
        with old version you just run new version with -R parameter.

                                                      Page 2
        Output
        --------

        Output for a normal ATA (not ATA-2) drive looks like this:
        Note: Identify Device information words used are in brackets.
        _______________________________________________________________
 DRIVE 0 Adapter 1 at base address 170h   Device is not removable.
                         Disk Reports    BIOS Reports
                     Default     Current
 # of Cylinders______: 665 [1]     665 [54]  0
 # of Heads__________:  16 [3]      16 [55]  0
 # of Sectors/Track__:  63 [6]      63 [56]  0
 Model Number________: Conner Peripherals 340MB - CFA340A [27-46]
 Serial Number_______:           BQBA27A                  [10-19]
 Controller Rev. #___: 6FT1.70                            [23-26]
 Double Word Transfer:     No [48] Buffer size (kB)____:     64 [21]
 # of ECC bytes______:      4 [22] DMA support              Yes [49]
 IORDY supported           No [49] IORDY can be disabled     No [49]
 Standby timer support:   No  [49] Secure Mode Supported:   No  [50]
 # of secs/interrupt_:     64[47]Current setting  16 [59]
 LBA support               No [49],[60-61],[53],[57-58]
 ATA compliant max. PIO transfer mode:   1 [51]
 SW DMA txfer cycle timing modes:       [62]  Active [62]
 MW DMA txfer cycle timing modes:        1, 0    Active 0 [63]
 Sorry, no ATA-2 features implemented

 Adapter 1 at 170h Drive 1 not found
 Last status  0h

        ______________________________________________________________
        The output above was generated running under OS/2 2.11. For some
        reason OS/2 lets user programs access secondary adapters and
        correctly inhibits access to primary adapter. Note the effect of
        /SMS (Set Multiple Support) parameter of OS/2 IDE driver
        IBM1S506.ADD (# of secs/interrupt_:, Current setting  16 ).


        For newer drives you might get also  something like this:
        _______________________________________________________________
 Congratulations, your drive supports ATA-2 [53]
 Advanced PIO transfer modes supported:            4, 3 [64]
 Min MW DMA transfer cycle time/word:              120 ns   16.7MB/s  [65]
 Mfg Recommended MW DMA transfer Cycle Time        120 ns   16.7MB/s  [66]
 Min PIO transfer Cycle Time w/o Flow Control      200 ns   10.0MB/s  [67]
 Min PIO transfer Cycle Time w IORDY Flow Control  120 ns   16.7MB/s  [68]
        ________________________________________________________________

        For ATA-2 reference I used Revision 2f july 26, 1994. I may have
        messed up some interpretations of spec, hope not too many.


                                                      Page 3

        How to interpret the output
        ---------------------------

        For a more complete reference you should get ATA-2 spec (draft)
        from:

        ATA Anonymous FTP Site
        fission.dt.wdc.com
        ATA directory is:  "/pub/ata"

        SCSI Bulletin Board 719-574-0424

        Document Distribution
        Global Engineering
        15 Inverness Way East
        Englewood, CO   80112-5704
        Tel: 303 -792-2181 or  800-854-7179
        Fax: 303 -792-2192

        Translation:
        ------------
                                Disk Reports
                            Default     Current
        # of Cylinders______: 665         665
        # of Heads__________:  16          16
        # of Sectors/Track__:  63          63

        First column is default translation and next is current. Current
        may be all -1 if validity bit is not set. Some drives accept any
        translation that doesn't exceed capacity and some accept only
        one translation.

        Multiple sector setting:
        ------------------------
        Normally the drive generates an interrupt for each sector
        read/written but enabling multiple sector setting and using
        read/write multiple commands enables the drive controller to
        work more efficiently and saves CPU cycles because interrupt is
        generated and processed only once for a given number of sectors.
        You must have BIOS support or a software driver to utilize this.
        Some drives get 30% data transfer speed boost, others only %5.

        Buffer size (kB)____:     64
        # of secs/interrupt_:     64    Current setting  16

        If Buffer size is half of secs/interrupt value and "Current
        setting" is missing the drive doesn't most propably support
        multiple sector per interrupt feature. If "Current setting"
        text (even with no number) is shown, the drive should work
        with multiple sector per interrupt.

        LBA support
        -----------
        Found in most drives with capacity over 528MB. Normal BIOS and
        IDE translation parameters together have a limit of 528MB. BIOS
        alone has a 8GB limit. IDE alone has a 137GB limit. LBA (Logical
        Block Address) uses no translation and blocks or sectors are
        addressed with 0 to a device specific maximum LBA number. The
        maximum LBA number cannot exceed 268 435 455 (137GB). Using LBA
        should save some CPU cycles.



                                                      Page 4

        DMA support
        -----------
        DMA (Direct Memory Access) means that the device writes directly
        to main memory thus freeing CPU from I/O handling. The other
        transfer mode is PIO (Programmable I/O). ISA bus has a limit of
        16MB DMA addressable memory.

        IORDY supported
        ---------------
        IORDY is needed with PIO mode 3 and 4.

        Transfer modes
        --------------

             +--------------------------------------------------+------+
             | PIO                  |Mode 0|Mode 1|Mode 2|Mode 3|Mode 4|
             | timing parameters    | nsec | nsec | nsec | nsec | nsec |
        +----+----------------------+------+------+------+------+------+
        | t0 | Cycle time (1) (min) | 600  | 383  | 240  | 180  | 120  |
               Transfer rate   MB/s | 3.3  | 5.2  | 8.3  | 11.1 | 16.6 |

        Modes 0 .. 2 are included in ATA spec, PIO mode 3 and 4 in
        ATA-2.

             +---------------------------------------------------------+
             | Single word DMA                 | Mode 0| Mode 1| Mode 2|
             | timing parameters               |  nsec |  nsec |  nsec |
        +----+---------------------------------+-------+-------+-------|
        | t0 | Cycle time                (min) |  960  |  480  |  240  |
        | Transfer rate (calculated) MB/s      |  2.1  |  4.2  |  8.3  |


              +------------------------------------+--------+--------+
              | Multiword DMA             | Mode 0 | Mode 1 | Mode 2 |
              | timing parameters         |  nsec  |  nsec  |  nsec  |
        +-----+---------------------------+--------|--------|--------|
        | t0  | Cycle time                | 480    | 150    | 120    |
        | Transfer rate (calculated) MB/s | 4.2    | 13.3   | 16.6   |

        DMA mode 0 is included in ATA spec, mode 1 and 2 in ATA-2.
                                                      Page 5

        Updating CMOS parameters

        New with version 1.1 is similar feature that is found in
        new BIOSes. Ideinfo does more. If the drive has already
        been partitioned the partition table is analyzed and
        suitable parameters are given as one possible set to
        feed in to CMOS. If the drive has FAT partition at the
        begining of the drive then also BPB (BIOS Parameter
        Block) from DOS boot sector is analyzed and suitable
        parameters are given as one possible set to feed in to
        CMOS. The other two suggestions come directly from the
        drive. If CMOS parameter is given to Ideinfo the output
        might look like this:
     Disk 0 or C:
                   Disk Reports        Part. table     BPB
                Default   Current
    Cylinders     1024      1024          1024          0
    Heads           16        16            16          0
    Sectors/Track   63        63            63          0
    Now you may update CMOS with new parameters for drive 0. Choose from above.
    Press D for Default, C for Current, P for Part. table, B for BPB or
    S for skip this drive

     Disk 1 or D:
                  Disk Reports        Part. table    BPB
                Default   Current
    Cylinders     1062     1062          1024          0
    Heads           16       16            16          0
    Sectors/Track   63       63            63          0
    Now you may update CMOS with new parameters for drive 1. Choose fom above.
    Press D for Default, C for Current, P for Part. table, B for BPB or
    S for skip this drive


        Only primary adapter is searched for drives.

        Limitations
        -----------

        Ideinfo can update CMOS succesfully only if the BIOS is by AMI
        and it uses drive type 47 as user definable drive parameters.
        CMOS has two checksum bytes and some BIOS versions might
        calculate them differently. Storage place for drive type 47
        parameters varies but AMI should place them at the same bytes.
        New four drive BIOSes might differ in that.
        Ideinfo does no checking at all. It does not check that the BIOS
        is by AMI. It does not check that drive type 47 is user definable.
        It does not check that the bytes to store type 47 are correct.
        But you may skip update CMOS and write down the parameters that
        seem correct. Later you just start BIOS setup and update the
        parameters manually.

                                                      Page 6

        When partition table or BPB parameters should be used
        instead of what the drive suggests
        ----------------------------------

        Some IDE drives work with any combination of parameters
        that don't exceed total capacity of the drive. Others
        work with two, possibly three set of parameters. If the
        drive has already been partitioned and the CMOS has lost
        its contents, the parameters that the drive suggests may
        not be the ones that were used when the drive was partitioned.
        If you use normal autodetect feature, the machine doesn't
        boot from hard disk, but hard disks are found when the
        machine is booted from floppy.
        BPB is DOS specific and cylinder count is calculated. If
        the first partition doesn't fill the entire drive then
        the cylinder count from BPB is too small. The other two
        parameters from BPB are reliable.
        Partition table has similar limitation. If the drive
        hasn't been all used up by partitions the cylinder count
        is too small. However, all existing partitions can be
        accessed if partition table is trusted.


        Making an autodetect floppy
        ---------------------------

        Ideinfo does not need BIOS to read IDE drives. To load
        Ideinfo into memory you need DOS. To load DOS you need
        at least a floppy. You may have to invoke BIOS setup to
        define your floppy drive.
        To make autodetect safe you should use CMOS utility to
        save current settings before autodetect.
        Make first a bootable floppy with "format a: /s" command,
        copy CMOS utility and Ideinfo to it and make following
        autoexec.bat
        -----------------------------
        @ECHO OFF
        ECHO Press Ctrl-C if you want to restore previously saved
        ECHO CMOS settings.
        PAUSE
        CMOS
        IDEINFO F
        IDEINFO CMOS
        -------------------------------
        CMOS saves first the current settings and if something goes
        wrong you may reboot with the same floppy, press Ctrl-C and
        after looking with "dir" what CMOS.* file is the latest, run
        CMOS nnn, where nnn is the same number that you saw as extension
        in the settings file you wish to restore to CMOS.
        Ideinfo F line stores drive identify data for later examination.
        It is not neccessary but convinient.


                                                      Page 7

        Speedtest
        ---------

        Speedtest is removed from Ideinfo, use separate Drvspeed
        instead.
                                                      Page 8

        Some notes
        ----------

        IDEINFO was compiled with BC++ 3.1 using 286 intructions. XT or
        8-bit interfaces were not even considered, so you should have a
        286 or better to use this program. Currently IDEINFO tries to
        read idedrive.0 .. idedrive.99 files with R parameter. I hope
        that 100 files is enough for a while. Increasing it would slow
        it down or extensions would have to be in sequence.

        The line # of secs/interrupt_:     64[47]Current setting  16 [59]
        apparently tells also if OS/2 (2.1, 2.11) IBM1S506.ADD will
        support /SMS parameter. Word 59 has a validity bit and if it is
        not set "Current setting" will not be displayed and IBM1S506.ADD
        ignores /SMS. There are some drives that have validity bit set
        but still IBM1S506.ADD ignores /SMS but the only such drive I
        have encountered is Seagate ST3391A.

        I am not sure about which last status values (displayed when
        adapter is not found) mean that there is no device responding. I
        have seen 7fh on EISA bus machine and OS/2, ffh on others. If
        you see some other value there is propably something using that
        address.


        Credits
        --------

        Great help in getting started was the source code of:
        DUG_IDE : Provides IDE disk info on both drives in the system
                  Version 1.0
        Copyright (c) 12 Jan 1993 by Doug Merrett - All rights reserved

        Linux 1.1 kernel sources were also consulted.



        Me
        ---

        Copyright (c) July 1994 by Raimo Koski - All rights reserved
        Postal Address: Uudenmaantie 23 K 3
                        20720
                        Finland
        I can receive Internet mail with address:
        raimo.koski@mikropc.fi
        You can also try Fidonet with address:
        2:222/70
                                                      Page 9

        Changes, additions
        -------

        8/29/94
        Checked that ATA-2 rev. F caused no changes. The original
        version of ideinfo was based on ATA-2 rev. c. Added PIO mode 4
        and MW DMA mode 2 to this document. Source remains the same.

        11/15/94
        Found a bug! PIO 4 and 5 were not reported correctly. Yes, there
        are PIO 4 drives commonly available. Some cosmetic changes.
        Raised timeout value. Only one person has complained about
        ideinfo not finding a drive. Hope the problems have not been
        common. The worst case seems to be fast CPU, slow drive and two
        drive IDE bus. If you encounter this problem, simply run ideinfo
        again. You can also read the drive that is not found with
        ordinary means (say DIR or something) and then try ideinfo
        again. Seems that ideinfo is not resetting drives properly. I
        should look at this sometime but it is not so important. Use
        your operating system (actually it usually calls BIOS to do
        this) to do resetting. Say DIR or similar.
        Had a possibility to test a drive with 108 sector/interrupt
        support. OS/2 WARP II used 16. Seems that OS/2 never uses more
        than 16 and if the drive can't accept that then OS/2 can use 8
        also. I haven't seen other values with OS/2.

        11/31/94
        Checked ATA-2 r.2i. Words 20 and 21 are now obsolete. Removed
        word 20 reporting and added removable/non removable reporting.
        Added delay(50) lines after writing to ports, that might be
        better than raising the time out value.
        On subject of time out, it seems to be the root of all trouble
        of drive light staying lit and drives not found errors. This
        version raises time out value once again.
        Changed max_cntr value to 3. Now only three adapters are searched.
        I have wondered about base address 0x70 mentioned in ATA-2
        informative annex. I think that it can't be used for secondary
        IDE adapter in normal AT class machines because that address
        belongs to CMOS. Anyway few people have more than two IDE
        adapters in their machines. I was one of the very few people
        that used secondary IDE adapter back in spring -93 when OS/2
        2.1 beta IDE driver was the first good driver to support two
        adapters. Now they are more common.
        Base address 120h is used by some Plus Hardcards.

        12/11/94
        Added CMOS update and smart autodetect. Now Ideinfo reads
        IDE drives without any help from BIOS or DOS. Identify
        device command output is generated usually by drive controller
        and not read from disks.

        06/08/95
        Added speedtest, check for AMI BIOS. A bug in second disk
        partition table cyls seek found and corrected. Updated to ATA-3 R1
        level. Added logic for avoiding divisions by zero (happened
        occasionally with older drives, which were reporting incorrect
        values).

                                                      Page 10

        08/03/96
        Moved speedtest to separate utility. Updated to ATA-4 level.
        Added ATAPI device detection. Added following fields for
        ATAPI devices:

        Device types [0]
        Direct-access device
        Sequential-access device
        Printer device
        Processor device
        Write-once device
        CD-ROM device
        Scanner device
        Optical memory device
        Medium changer device
        Communications device
        Array controller device
        Reserved device type!
        Reserved for ACS IT8
        Unknown or no device type

        Command packet length [0]
        with 16 byte command packet
        with 12 byte command packet
        with reserved length command packet

        Typical time from receipt of PACKET command to release: %6u ns [71]
        Typical time from receipt of SERVICE command to BSY cleared
                to zero: %6u ns [72]


        ATA devices:
        ATA version major, minor [80], [81]

        Power management features supported [82]
        Removable features supported [82]
        Security features supported [82]

        Security state [128]
        Security enabled
        Security locked
        Security frozen
        Security count expired
        Security level maximum / high

        SMART features supported [82]

        Most of these fields are untested. One reason is that I have not
        seen devices that support them, the other is that there propably
        are yet none that support them all :-) Third is that I have not seen
        yet other programs that report them, so I have no comparison.
