fix a bug about a LBA check in stage2.

This commit is contained in:
okuji 2000-06-03 06:08:05 +00:00
parent 06663a489d
commit 72bae78465
3 changed files with 23 additions and 15 deletions

View file

@ -1,3 +1,11 @@
2000-06-03 OKUJI Yoshinori <okuji@gnu.org>
* stage2/asm.S (check_int13_extensions): Check the bitmap only
if FORCE_LBA is zero.
* stage2/bios.c (get_diskinfo): Get rid of the wrong check for
the bit 0 of DRP.FLAGS. Now the bitmap check is correctly
performed in the function check_int13_extensions.
2000-06-02 OKUJI Yoshinori <okuji@gnu.org>
* docs/user-ref.texi (Invoking the grub shell): Added a caution.

View file

@ -1023,6 +1023,11 @@ ENTRY(check_int13_extensions)
jc 1f
cmpw $0xaa55, %bx
jne 1f
/* check if AH=0x42 is supported if FORCE_LBA is zero */
movb EXT_C(force_lba), %al
testb %al, %al
jnz 1f
andw $1, %cx
jz 1f

View file

@ -158,24 +158,19 @@ get_diskinfo (int drive, struct geometry *geometry)
err = get_diskinfo_int13_extensions (drive, &drp);
if (! err)
{
/* How many buggy BIOSes are there in the world...
Some BIOSes don't set the flag correctly, even if LBA
read/write is supported, so we cannot help assuming
that the functions are supported by default and
clearing the flag when either of them fails. *sigh* */
/* Make sure that LBA read/write functions are supported. */
if (force_lba || (drp.flags & 1))
{
/* Set the LBA flag. */
geometry->flags = BIOSDISK_FLAG_LBA_EXTENSION;
/* I'm not sure if GRUB should check the bit 1 of DRP.FLAGS,
so I omit the check for now. - okuji */
/* if (drp.flags & (1 << 1)) */
/* 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;
}
}
}
/* Don't pass GEOMETRY directly, but pass each element instead,
so that we can change the structure easily. */