Page 1 of 1
To enumerate all drives, and their capacities
Posted: Sun Feb 26, 2006 8:54 am
by j.vimal_
How do I enumerate the list of all devices (storage devices in this case) and then find out the maximum capacity of each of them?
Thanks
Vimal
Re:To enumerate all drives, and their capacities
Posted: Mon Feb 27, 2006 5:17 am
by Pype.Clicker
basically by probing the ATA controller to learn what devices are present and then sending ATA_IDENTIFY commands to learn (among other things) the disk geometry and largest valid block address.
You may want to have a look at
my wiki where informations about how to do this is under preparation before addition into the OSFAQ.
Hale's driver (which should be available from
http://www.osdev.org/osfaq2/index.php/AtapiCdrom) might look easier to understand at first sight, but once you know the very basic of ATA, indentifying a drive is among the easiest operations to perform
Note that this doesn't take into account for SCSI or USB devices, which do not use ATA...