%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-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):
.byte 36, 18, 15, 9, 0
LOCAL(floppy_probe):
+ pushw %dx
/*
* Perform floppy probe.
*/
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.
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
- jz 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)