To enumerate all drives, and their capacities

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
j.vimal_

To enumerate all drives, and their capacities

Post 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
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:To enumerate all drives, and their capacities

Post 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...
Post Reply