Get max cylinders sectors heads from a hdd file size
Posted: Sat Dec 01, 2012 12:54 am
Looking at this from an x86 emulator point of view, is it possible to know the Max CHS just from the HDD image size.
I've tried assumptions like CHS = x/255/63 or x/15/63 but it does not appear to work fully.
Making a loop to guess what it might be. E.G. (In Basic)It shows a dozen possible answers. But is there a proper way?
I'm thinking the emulator should not need to know what filing system in on the HDD, otherwise I'll have to program in many file system type checks.
This is regarding basic interupt 13h, during the bootup/bootstrap time. I'm tring to run some various OS images I've downloaded from the web. I've got no problem with floppy images (obviously) but trouble with the HDD ones.
I've tried assumptions like CHS = x/255/63 or x/15/63 but it does not appear to work fully.
Making a loop to guess what it might be. E.G. (In Basic)
Code: Select all
lbaSize = (32 Meg or 112 Meg etc...) / 512
For C = 0 To 1023
For H = 0 To 255
For S = 1 To 63
If (C * H * S) = lbaSize Then Print C, H, S
Next S
Next H
Next C
I'm thinking the emulator should not need to know what filing system in on the HDD, otherwise I'll have to program in many file system type checks.
This is regarding basic interupt 13h, during the bootup/bootstrap time. I'm tring to run some various OS images I've downloaded from the web. I've got no problem with floppy images (obviously) but trouble with the HDD ones.