vanfanel wrote on 2025-04-25, 13:53:Well, I understand the simple equation where all this is derived from: […]
Show full quote
Well, I understand the simple equation where all this is derived from:
Disk Size = Cylinders * Headers * Sectors * Bytes per Sector
But then, if we set that:
Headers = 128
Sectors = 63
Bytes per Sector = 512
...We still have "Disk Size" and "Cylinders".
Is Cylinders derived from "Disk Size", or is it the other way around???
It's more a process of 'I want a geometry I can actually get DosBox to accept without errors or corruption, and it enforces the old 'large int13 restriction, and lacks an lba mode' issue.
This means your jumpoff point is the limitations imposed by large int13.
http://www.tldp.org/HOWTO/Large-Disk-HOWTO-4.html
The maximum values for each, is at most 1024 cylinders (numbered 0-1023), 256 heads (numbered 0-255), 63 sectors/track (numbered 1-63) .
So, you want a 2gb volume, or there abouts.
So, you do the naive starting point of wanting exactly 2GiB, (2048MiB), which is exactly 2147483648 bytes.
We take this number, and divide it by 512, to get the number of sectors, which comes out to
4194304
Next, we divide by the max sectors per track, 63, to get the number of tracks... but it does not divide equally!
66576.2539
Well, let's ignore the remainder, and go for 'best fit'. Trying to get sectors to align will make heads and cyls balloon like crazy.
Next, we go for heads. the max is 255, but that clearly wont divide equally (look at the last number, it's a six!), and we dont really want MORE rounding error, and 128 might just divide equally, so we try it... and are disappointed..
520.125
But the remainder is rather small, so we eat it.
This gives us a 'Best Fit' ECHS for a 'It's almost 2gb' volume of:
520 cyl, 128 heads, 63 sectors per track, 512 byte per sector
Which is VERY close to his suggested 519 cyl.
He might have backed off on the cyl count for other reasons.