8/9/2023 0 Comments Disk geometry calculatorIs this method of calculating the CHS geometry of an emulated harddisk correct(the hard disks can be any amount of sectors)?ĭisk drives can be of any size, right? So given that an image can be calculated to be N sectors, there are multiple triplets of cyl*head*sec that makes N sector image.Īnother thing is, are you talking about the hardware geometry of the drive, or, the logical geometry seen by DOS, because these can be different if BIOS does a geometry translation.įortunately, since most likely you are dealing with images of DOS systems, you can assume there is a partition table, and usually partitions are aligned to cylinder boundary. Otherwise, it will use 16 heads and 63 sectors per track with cylinders being the maximum quotient possible with 16 heads and 63 sectors per track. It will use 63 sectors per track with 1 cylinder and heads being the maximum quotient up to 1008 sectors large. It will use the sectors as Sectors per Track with 1 head and cylinder up to 63 sectors large. Copy code to clipboard 1 OPTINLINE word get_SPT(uint_64 disk_size)ģ return (disk_size>=63)?63:disk_size //How many sectors use for each track? No more than 63!Ħ OPTINLINE word get_heads(uint_64 disk_size)Ĩ return ((disk_size/get_SPT(disk_size))>=16)?16:((disk_size/get_SPT(disk_size))?(disk_size/get_SPT(disk_size)):1) //1-16 heads!ġ4 cylinders = (uint_32)(disk_size / (63 * 16)) //How many cylinders!ġ5 return (cylinders>=0x3FFF)?0x3FFF:(cylinders?cylinders:1) //Give the maximum amount of cylinders allowed!
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |