[U-Boot] Fix wrap around bug in MBR sector counts

Stefan Monnier monnier at iro.umontreal.ca
Wed Nov 25 18:08:47 CET 2015


I just bumped into a problem where U-Boot refused to boot from my disk's
second partition because the sector number is "negative".

More specifically, my disk drive is 2TB, which means that the number of
512B blocks fits into an unsigned 32bit int but not into a signed 32bit
int. U-boot's "scsi part" displays the size (in blocks) correctly, but
the size of the first partition (which is around 1.8TB) is printed as
a negative number, and so is the start sector of the second partition.

This was tested on a BananaPi using v2015-07.



More information about the U-Boot mailing list