add another workaround for buggy BIOSes into get_diskinfo.

This commit is contained in:
okuji 2000-11-10 15:33:10 +00:00
parent d917526690
commit e3daf570b2
2 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2000-11-11 OKUJI Yoshinori <okuji@gnu.org>
* 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 <okuji@gnu.org>
* stage2/disk_io.c (make_saved_active): Set ERRNUM to

View file

@ -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;
}
}