At www.ata-atapi.com, Mr. Landis has published some nice (MS-DOS)
C-source code library to perform ATA/ATAPI operations on
the legacy IDE-interface (port I/O 0x1F8.) Unfortunately, that
only works under real-mode MSDOS.
I started reading about organization of the ATA/ATAPI devices under
Windows/XP (atapi.sys? IDE miniport driver) over in the Platform SDK.
But honestly, I'm not a Windows programming expert, and if someone
could narrow down my search, or just tell me, "go find a professional
driver developer", that would help me a lot.
So usingn Visual C++ 6, how would I go about doing something similar
under Windows/XP? I'm hoping this can be done on user/application side,
and not require writing a custom device-driver/port-driver (or whatever
you call it.)
"talkb" <no...@talkb.com> wrote in message
news:O1Upj.7044$nK5....@nlpi069.nbdc.sbc.com...
"talkb" <no...@talkb.com> wrote in message
news:O1Upj.7044$nK5....@nlpi069.nbdc.sbc.com...
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
"David Craig" <dri...@nowhere.us> wrote in message
news:Ot$iK38ZI...@TK2MSFTNGP05.phx.gbl...
Well, you and everyone else were pretty much correct.
I fooled around with Visual C++ 2008 Express Edition, and a sample-program
from
ftp://ftp.heise.de/pub/ct/listings/0207-218.zip
Under Windows/XP, the sample-program WINATA.exe uses IOCTL_IDE_PASS_THROUGH
to get the drive's AAM (Acoustic) info. I couldn't get to that stage, but
the initial ATA "IDENTIFY" command succeeds on some of my drives.
Now here's the weird-part... on Windows XP/Pro SP2 (32-bit), and an
Intel P35/ICH9R motherboard (with onboard Jmicron JMB363 Parallel/ATA):
The Jmicron Parallel/ATA port works with IOCTL_IDE_PASS_THROUGH. The
"IDENTIFY" command successfully returns the drive's name & serial#.
The Intel ICH9R SATA AHCI controller (yes, I'm in AHCI mode) returns blank
info. The return-code indicates success, but the name&serial# aren't
there.
The Jmicron Serial/ATA (AHCI) port fails, it can't identify an attached
drive.
So I modified WINATA.cpp to use IOCTL_ATA_PASS_THROUGH:
Now, the Jmicron Parallel/ATA port fails -- I guess it doesn't support
IOCTL_ATA...
The ICH9R SATA AHCI controller works! It successfully returns
name&serial#.
The Jmicron Serial/ATA (AHCI) still fails.
I probably need to double-check the return-codes and buffer-validation in
the
sample-program.
I guess the next step is to see if I can send *real* Compactflash-ATA
commands
(and not just "ATA IDENTIFY", which every IOCTL probably supports)
...
Anyway, I have 1 more question.
If I start with the PhysicalDrive handle
CreateFile("\\\.\\PhysicalDrive0", ),
how hard is it to traceback to the parent IDE/SCSI host-bus-adapter name?
(For example, if the user selects a physicaldrive, how would a C++ program
determine which ATA/SATA/SCSI HBA it's attached to?)