Announcement

Collapse
No announcement yet.

IDE vs EIDE?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • IDE vs EIDE?

    Is there a way of programmatically determining if a drive is an IDE or EIDE?

    I am resurrecting DOS forensics program I started a long time ago. Right now, I am trying to get the drive parameters.

    Testing on a two-drive machine, the program seems to return correct values on Drive-0 but incorrect results on Drive-1.
    Code:
    Displayed Drive=0 stats
    T = 4,960
    H = 16
    S = 63
    
    T * H * S = 4,999,680 and as diplayed
    
    Displayed Drive-1 stats
    T = 16,383
    H = 16
    S = 63
    
    T * H * S = 16,514,064  
    Program displays 58,633,344
    The only thing I can think of is that one of the drives is an IDE and the other is an EIDE.

    Here's a code snippet I am using. If you choose to test it (please), you will have to create a bootable floppy with DOS 5, 6x or 9x.


    Code:
    	$lib all off
            color 14,1
            cls
            drive = 1
            f$ = "###,###,###,###"
            t$ = DriveParameters$(Drive)
            locate 1,1 : print;t$;len(t$)
    
    	d$ = mid$(t$,1,2)
    	locate  3, 1 : print;"Buffer size: " + using$(f$,process(d$))
    
            d$ = mid$(t$,3,2)
    	locate  5, 1 : print;" Info Flags: " + using$(f$,process(d$))
    
            d$ = mid$(t$,5,4)
    	locate  7, 1 : print;"# of tracks: " + using$(f$,process(d$))
    
            d$ = mid$(t$,9,4)
    	locate  9, 1 : print;" # of heads: " + using$(f$,process(d$))
    
            d$ = mid$(t$,13,4)
    	locate 11, 1 : print;"  Sect/Trak: " + using$(f$,process(d$))
    
            d$ = mid$(t$,17,8)
    	locate 13,1 : print;"Total Sects: " + using$(f$,process(d$)),
    
            end
    $if 0
     00   00   0000     0111     1111     11122222
     12   34   5678     9012     3456     78901234
     xx   xx   xxxx     xxxx     xxxx     xxxxxxxx
    ---  ---  -------  -------  -------  ---------------
     |    |     |        |        |          |
     |    |     |        |        |          |_ Total sectors on drive
     |    |     |        |        |____________ Number of physical sectors
     |    |     |        |_____________________ Number of physical heads
     |    |     |______________________________ Number of physical cylinders
     |    |____________________________________ Information flags
     |_________________________________________ Buffer Size
    
    
    
    
    $endif
    
    function process(d$) as quad
    	for x = 1 to len(d$)
            h = asc(mid$(d$,x,1))
            t&& = t&& + (h * (256 ^ (x-1)))
            next x
    	function = t&&
    	end function
    
    function DriveParameters$(drive)
    	buffer$ = string$(32,chr$(1))
    	reg 1,&h4800
    	reg 4,drive + &h80
    	reg 5, strptr(buffer$)
    	reg 8, strseg(buffer$)
    	call interrupt &h13
            function = buffer$
    	end function
    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.

  • #2
    Originally posted by Mel Bishop View Post
    Is there a way of programmatically determining if a drive is an IDE or EIDE?
    Not simple, mostly because EIDE is a proprietary term invented by Western Digital, covering an ever changing & a bit confused set of features that improved on the then current IDE (better, ATA) standard.

    Bye!
    -- The universe tends toward maximum irony. Don't push it.

    File Extension Seeker - Metasearch engine for file extensions / file types
    Online TrID file identifier | TrIDLib - Identify thousands of file formats

    Comment


    • #3
      Okay. Thanks for the info, Marco.

      Then can I test it to see if it's an IDE drive. Then if something else comes up, assume it's an EIDE?
      There are no atheists in a fox hole or the morning of a math test.
      If my flag offends you, I'll help you pack.

      Comment


      • #4
        Knowing the number of tracks, heads, and sectors is not the way to determine capacity. The number of heads only reflects the number of platter surfaces being used. The real determination is the tracks, sectors, and number of bytes per sector. Also note that maximum capacity stated for hard drives is usually stated for an unformatted drive (the argument given is that different methods of formatting for different file systems would not be representative if the drive were used with a different file structure).

        Research IDE vs. EIDE for more information. EIDE covers a number of evolved standards that have increase capacity and speed. The Windows API can be used to determine the metrics of the hard drive, rather than trying to figure out how to detect this on your own.

        Comment


        • #5
          Hi Don. Thanks for the reply but you seem to misunderstand something.

          I am not trying to determine drive capacity. I need to find the parameters, tracks, heads, spt, (physical or translated) in order for the program to work correctly.

          ...The number of heads only reflects the number of platter surfaces...
          Not really. In my example, both drives have 16 heads. If what you said were true, both drives would have 8 platters. Not going to happen in a 3.5 inch drive. There are only two, maybe 3 platters in them. The parameters are translated by the onboard controller.

          Oh well, I'll figure something out.
          There are no atheists in a fox hole or the morning of a math test.
          If my flag offends you, I'll help you pack.

          Comment


          • #6
            Originally posted by Mel Bishop View Post
            Not really. In my example, both drives have 16 heads. If what you said were true, both drives would have 8 platters.
            Actually, those are only the logical parameters that the HD built-in controller present outside.

            But aside from this tech details, have you considered working on an HD image file, instead of directly on the HD? Wouldn't that be simpler and letting you concentrate on your "real/specific work"?

            Bye!
            -- The universe tends toward maximum irony. Don't push it.

            File Extension Seeker - Metasearch engine for file extensions / file types
            Online TrID file identifier | TrIDLib - Identify thousands of file formats

            Comment


            • #7
              How to tell IDE or EIDE.

              >Is there a way of programmatically determining if a drive is an IDE or EIDE?

              Any drive over 528MB will be EIDE while those under will be IDE given the 2 choices. The EIDE was developed to provide larger capacity due to size limitations above for IDE. Hope this helps. So you should be able to query drive capacity and then know whether it is IDE or EIDE.
              LEARNING EXPERIENCE: What you get when you didn't get what you THOUGHT you wanted!

              Comment


              • #8
                Also EIDE drives will have a LBA(Long Block Address) coded while IDE drives will not.
                LEARNING EXPERIENCE: What you get when you didn't get what you THOUGHT you wanted!

                Comment

                Working...
                X