Detect all connected hard drives under DOS
A small example on how to detect all connected hard drives under 32-bit DOS extender and Legacy ATA. The source code will compile under a recent version of WATCOM C++ (1.9 or higher). These are the steps executed by the code :
- INT13h extensions are used to detect all drives visible by the BIOS and starting at 0x80.
- If the drive is removable the user is informed and the loop continues until all BIOS drives are checked.
- If the drive is a hard drive INT13h extensions are used to detect base ATA port and control ATA port.
- ATA identify command is sent to the drive using the detected ATA ports.
- Information about drive model, drive serial number and drive firmware revision is displayed.
All code that is linked from forums is under MIT license.