]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/boot/i386/pc/boot.S: Fix floppy probe. Due to missing
authorVladimir Serbinenko <phcoder@gmail.com>
Sun, 24 Nov 2013 04:01:13 +0000 (05:01 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sun, 24 Nov 2013 04:05:33 +0000 (05:05 +0100)
%dx restore the probe worked on non-existant drive. Reorganize the
code a little bit to free 2 bytes necessary for push/pop.

ChangeLog
grub-core/boot/i386/pc/boot.S

index 092bd5e878b4d1a0c36749ecba1d7a88db1c293b..f0f4de245bc1bdc931b8391d7d63fdd29b79e69e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-11-24  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/boot/i386/pc/boot.S: Fix floppy probe. Due to missing
+       %dx restore the probe worked on non-existant drive. Reorganize the
+       code a little bit to free 2 bytes necessary for push/pop.
+
 2013-11-23  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/kern/mips/arc/init.c (grub_machine_get_bootlocation):
index c0880c6b854c350c43ce6e3cf39e8e4f85936fe1..5b959b627184bc046420060586fc927196d2113f 100644 (file)
@@ -35,6 +35,7 @@ probe_values:
        .byte   36, 18, 15, 9, 0
 
 LOCAL(floppy_probe):
+       pushw   %dx
 /*
  *  Perform floppy probe.
  */
@@ -50,8 +51,8 @@ LOCAL(probe_loop):
        movb    (%si), %cl
 
        /* if number of sectors is 0, display error and die */
-       cmpb    $0, %cl
-       jne     1f
+       testb   %cl, %cl
+       jnz     1f
 
 /*
  * Floppy disk probe failure.
@@ -318,11 +319,12 @@ LOCAL(chs_mode):
        int     $0x13
        jnc     LOCAL(final_init)
 
+       popw    %dx
        /*
         *  The call failed, so maybe use the floppy probe instead.
         */
-       testb   $GRUB_BOOT_MACHINE_BIOS_HD_FLAG, %dl
-       j     LOCAL(floppy_probe)
+       testb   %dl, %dl
+       jnb     LOCAL(floppy_probe)
 
        /* Nope, we definitely have a hard disk, and we're screwed. */
        ERR(hd_probe_error_string)