diff --git a/ChangeLog b/ChangeLog index e4258a174..f28f3fdd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-11-11 OKUJI Yoshinori + + * stage2/bios.c (get_diskinfo): If BIOS supports LBA but doesn't + return the correct total number of sectors, compute this by + C/H/S returned by get_diskinfo_int13_extensions instead of + get_diskinfo_standard. + 2000-11-09 OKUJI Yoshinori * stage2/disk_io.c (make_saved_active): Set ERRNUM to diff --git a/stage2/bios.c b/stage2/bios.c index d9adfae1d..c374d65bb 100644 --- a/stage2/bios.c +++ b/stage2/bios.c @@ -173,7 +173,13 @@ get_diskinfo (int drive, struct geometry *geometry) /* FIXME: when the 2TB limit becomes critical, we must change the type of TOTAL_SECTORS to unsigned long long. */ - total_sectors = drp.total_sectors & ~0L; + if (drp.total_sectors) + total_sectors = drp.total_sectors & ~0L; + else + /* Some buggy BIOSes doesn't return the total sectors + correctly but returns zero. So if it is zero, compute + it by C/H/S returned by the LBA BIOS call. */ + total_sectors = drp.cylinders * drp.heads * drp.sectors; } }