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
To enumerate all drives, and their capacities
- Pype.Clicker
- 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
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...
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...