Total physical storage space = LBA 512 512=# of bytes/sector, LBA=total # of sectors.
via How To Determine Hd Size ? – Scenyx Entertainment Community.
The equation to convert from CHS to LBA follows:
LBA = ( ( CYL * HPC + HEAD ) * SPT ) + SECT - 1Where:
LBA: linear base address of the block CYL: value of the cylinder CHS coordinate HPC: number of heads per cylinder for the disk HEAD: value of the head CHS coordinate SPT: number of sectors per track for the disk SECT: value of the sector CHS coordinateThis equation is not used very often. Usually the software already has the LBA value and needs to calculate the CHS value for it.
From LBA to CHS
The equations to convert from LBA to CHS follow:
CYL = LBA / (HPC * SPT) TEMP = LBA % (HPC * SPT) HEAD = TEMP / SPT SECT = TEMP % SPT + 1Where:
LBA: linear base address of the block CYL: value of the cylinder CHS coordinate HPC: number of heads per cylinder for the disk HEAD: value of the head CHS coordinate SPT: number of sectors per track for the disk SECT: value of the sector CHS coordinate TEMP: buffer to hold a temporary valueThis equation is used very often by operating systems such as DOS to calculate the CHS values it needs to send to the disk controller or INT13h in order to read or write data.