[syslinux] After USB boot problems on Gigabyte GA-M55Plus-S3G
H. Peter Anvin
hpa at zytor.com
Tue Jan 21 06:31:30 PST 2014
On 01/21/2014 12:22 AM, Thomas Schmitt wrote:
>
>> If we take the ENDing CHS values as valid:
>> 982 / 254 / 63
>> and we calculate the corresponding LBA:
>> ( ( 982 + 1 )
>> x ( 254 + 1 )
>> x ( 63 ) )
>> - 1
>> ___________
>> 15'791'894
>
> Is this calculation generally valid ? It seems to assume that
> the end is aligned to a full cylinder. (The start is not.)
It isn't. To calculate the LBA from an arbitrary CHS address when the
geometry is C':H':S':
LBA = (C * H' * S') + (H * S') + (S - 1)
or equivalently
LBA = ((C * H') + H) * S' + S - 1
> It is clear that S/H must be 63 and H/C must be 255, because we
> see the maximum possible values here. (H/C could be 256. But
> that is outruled by Wikipedia about MBR.)
>
> Nevertheless, this does not match the end LBA calculated
> from start LBA and number of blocks.
>
> Do i miss an essential point here ?
I think the essential point is that the CHS geometry offered on the
preformatted stick seems to be "impossible". Most likely the
manufacturer simply did not care.
Consider this:
8 GB Corsair:
Partition type 0x0b (Wikipedia: FAT32, CHS or LBA)
Start LBA 63 = CHS 0 1 1
End LBA 15794175 = CHS 982 254 63
If LBA 63 = CHS 0/1/1 then we know S'=62, but that is completely
inconsistent with the ending sector being 63. In other words, the CHS
information in this partition table is complete garbage.
>> If there is nothing to loose (some special feature in the USB drive,
>> data, etc.), probably it would be best to create a new partition
>> table, a new partition and then format them again.
>
> Seems advisable, given the numerical madness.
>
> This is were i see a gap in SYSLINUX wiki. The world could need
> prescriptions for a non-weird partitioning and a LBA driven
> filesystem.
Fortunately geometry is becoming a fading problem. We're dealing with
an old board and BIOS here.
> Biggest riddle for me, though, is how to achieve this with Linux
> tools and MS-Windows tools. (I know /sbin/fdisk -lu. Everything
> else i do by byte manipulations in images. Plumber style.)
-hpa
More information about the Syslinux
mailing list