2008-03-21 Robert Millan * disk/i386/pc/biosdisk.c (grub_biosdisk_rw): Fix CHS limit check, as per http://www.allensmith.net/Storage/HDDlimit/Int13h.htm diff -urp grub2/disk/i386/pc/biosdisk.c tmp/disk/i386/pc/biosdisk.c --- grub2/disk/i386/pc/biosdisk.c 2008-02-03 09:27:15.000000000 +0100 +++ tmp/disk/i386/pc/biosdisk.c 2008-03-21 16:11:20.000000000 +0100 @@ -237,15 +237,17 @@ grub_biosdisk_rw (int cmd, grub_disk_t d { unsigned coff, hoff, soff; unsigned head; - unsigned real_sector = (unsigned) sector; - /* It is impossible to reach over 2TB with the traditional - CHS access. */ - if (sector > ~0UL) + /* It is impossible to reach over 8064 MiB (a bit less than LBA24) with + the traditional CHS access. */ + if (sector > + 1024 /* cylinders */ * + 256 /* heads */ * + 63 /* spt */) return grub_error (GRUB_ERR_OUT_OF_RANGE, "out of disk"); - soff = real_sector % data->sectors + 1; - head = real_sector / data->sectors; + soff = sector % data->sectors + 1; + head = sector / data->sectors; hoff = head % data->heads; coff = head / data->heads;