Finding Sector Count with AHCI
Posted: Tue Nov 24, 2020 8:45 pm
Hello.
I've had a minimal AHCI driver for a while, but I still haven't come across anything that talks about how you would get the count of the sectors of the disk.
The closest I've come is [this thread] about the ATA IDENTIFY command, but it seems like there is only one 32-bit spot for the sector count:However, this would limit hard disks to 2TB max. Obviously, modern AHCI is capable of addressing much more than just 2TB.
I've tried looking in the manual for "capacity" or "sector count" but turned up nothing.
Am I misinterpreting the IDENTIFY response? Is that the correct spot for the capacity, or is there another spot that I've overlooked that allows for more than 2TB?
I've had a minimal AHCI driver for a while, but I still haven't come across anything that talks about how you would get the count of the sectors of the disk.
The closest I've come is [this thread] about the ATA IDENTIFY command, but it seems like there is only one 32-bit spot for the sector count:
Code: Select all
...
unsigned int lba_capacity; /* total number of sectors */
...
I've tried looking in the manual for "capacity" or "sector count" but turned up nothing.
Am I misinterpreting the IDENTIFY response? Is that the correct spot for the capacity, or is there another spot that I've overlooked that allows for more than 2TB?