]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Handle USB pendrives exposed as floppies.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 27 Aug 2010 01:44:55 +0000 (03:44 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 27 Aug 2010 01:44:55 +0000 (03:44 +0200)
* grub-core/boot/i386/pc/boot.S: Check LBA even on what appears to be
floppy.
* grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_open): Likewise.
Check for partitions on all devices.

ChangeLog
grub-core/boot/i386/pc/boot.S
grub-core/disk/i386/pc/biosdisk.c

index e46c027b08bb0971e95b9207b10bc5a6fc19bab7..7043faf977984e427c362991c2d0a347383b90c6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-08-27  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Handle USB pendrives exposed as floppies.
+
+       * grub-core/boot/i386/pc/boot.S: Check LBA even on what appears to be
+       floppy.
+       * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_open): Likewise.
+       Check for partitions on all devices.
+
 2010-08-25  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/term/ieee1275/ofconsole.c (put): Correct prototype.
index 4afc57349b405dde7ac7ce2f19ead4de76363c06..6b16a913ad760328a8e4dd15ee0c028f4c2950b2 100644 (file)
@@ -153,10 +153,6 @@ real_start:
        /* set %si to the disk address packet */
        movw    $disk_address_packet, %si
 
-       /* do not probe LBA if the drive is a floppy */
-       testb   $GRUB_BOOT_MACHINE_BIOS_HD_FLAG, %dl
-       jz      LOCAL(chs_mode)
-
        /* check if LBA is supported */
        movb    $0x41, %ah
        movw    $0x55aa, %bx
index f82f91ff0dc879952235c49c6febfe118075f2ee..a00236e505e37bc3f0ce730a8cfbeef2a949b302 100644 (file)
@@ -107,7 +107,7 @@ grub_biosdisk_open (const char *name, grub_disk_t disk)
   if (drive < 0)
     return grub_errno;
 
-  disk->has_partitions = ((drive & 0x80) && (drive != cd_drive));
+  disk->has_partitions = 1;
   disk->id = drive;
 
   data = (struct grub_biosdisk_data *) grub_zalloc (sizeof (*data));
@@ -123,7 +123,7 @@ grub_biosdisk_open (const char *name, grub_disk_t disk)
       /* TODO: get the correct size.  */
       total_sectors = GRUB_DISK_SIZE_UNKNOWN;
     }
-  else if (drive & 0x80)
+  else
     {
       /* HDD */
       int version;