fix potential bugs in some LBA code

This commit is contained in:
okuji committed 1999-08-12 09:38:44 +00:00
1 parent 0f4f88a9d9
commit 7e9a0794d0
7 files changed
+46 -9

No files matched your search

+5 -4
View File
@@ -159,10 +159,11 @@ get_diskinfo (int drive, struct geometry *geometry)
if (! err)
{
geometry->flags = BIOSDISK_FLAG_LBA_EXTENSION;
/* Check if CHS information is valid. */
if (drp.flags & 0x02)
total_sectors = drp.cylinders * drp.heads * drp.sectors;
/* 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;
}
}
+5 -1
View File
@@ -675,11 +675,15 @@ returnit:
else
{
char *msg;
#ifdef GRUB_UTIL
msg = device_map[current_drive];
#else
if (geom.flags & BIOSDISK_FLAG_LBA_EXTENSION)
msg = "LBA";
else
msg = "CHS";
#endif
grub_printf ("drive 0x%x: C/H/S = %d/%d/%d, "
"The number of sectors = %d, %s\n",
+2
View File
@@ -312,6 +312,8 @@ extern int use_curses;
extern int verbose;
/* The flag for read-only. */
extern int read_only;
/* The map between BIOS drives and UNIX device file names. */
extern char **device_map;
#endif
#ifndef STAGE1_5