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.
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.
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
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
Comment