From 72bae78465e448f840d6b58209dee6ca9a10e71f Mon Sep 17 00:00:00 2001 From: okuji Date: Sat, 3 Jun 2000 06:08:05 +0000 Subject: [PATCH] fix a bug about a LBA check in stage2. --- ChangeLog | 8 ++++++++ stage2/asm.S | 5 +++++ stage2/bios.c | 25 ++++++++++--------------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index a2a54f694..a0a084ff2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-06-03 OKUJI Yoshinori + + * 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 * docs/user-ref.texi (Invoking the grub shell): Added a caution. diff --git a/stage2/asm.S b/stage2/asm.S index fde156740..e7f139e6d 100644 --- a/stage2/asm.S +++ b/stage2/asm.S @@ -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 diff --git a/stage2/bios.c b/stage2/bios.c index dca467a82..425de916d 100644 --- a/stage2/bios.c +++ b/stage2/bios.c @@ -158,22 +158,17 @@ 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* */ + /* Set the LBA flag. */ + geometry->flags = BIOSDISK_FLAG_LBA_EXTENSION; - /* Make sure that LBA read/write functions are supported. */ - if (force_lba || (drp.flags & 1)) - { - geometry->flags = BIOSDISK_FLAG_LBA_EXTENSION; - - /* 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; - } + /* 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; } }