summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShao Miller <shao.miller@yrdsb.edu.on.ca>2011-01-26 20:10:24 -0500
committerGene Cumm <gene.cumm@gmail.com>2011-01-26 20:40:41 -0500
commit61df6e617c2d755ef8cac91c8c4b9bc2710b2bee (patch)
treef9e9d15c56d597fe44981a3910830959a335b427
parent558087bfd62e8f74f58157e885cecc00feba836a (diff)
downloadsyslinux-61df6e617c2d755ef8cac91c8c4b9bc2710b2bee.tar.gz
memdisk/dskprobe.c: Additional checks in INT13h AH08h and AH41h
Some BIOSs lie and don't set CF when they should. Additional comments from Shao: Fix INT 0x13, AH==0x08 disk drive probe. This function might return CF==0 ("success"), but could return a standard response no matter which drive number is passed in DL, but based only on DL's bit 7. Fortunately, AH should be 0 for an existent drive and 01h for a non-existent drive. Now we check AH. Fix INT 0x13, AH==0x41 disk drive probe This function might return CF==0 ("success"), but could also include BX left unchanged. If extensions are present, BX should be returned with 0xAA55. So we now check for this special value in our determination of a drive's presence. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
-rw-r--r--memdisk/dskprobe.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/memdisk/dskprobe.c b/memdisk/dskprobe.c
index 84400a83..ee7be12d 100644
--- a/memdisk/dskprobe.c
+++ b/memdisk/dskprobe.c
@@ -57,7 +57,7 @@ static int probe_int13h_08h(uint8_t drive, com32sys_t * regs)
memset(regs, 0, sizeof *regs);
probe_any(0x08, drive, regs);
- present = !(regs->eflags.l & 1);
+ present = !(regs->eflags.l & 1) && !regs->eax.b[1];
dskprobe_printf(" AH08: CF%d BL%02x DL%02x\n", regs->eflags.l & 1,
regs->ebx.b[0], regs->edx.b[0]);
return present;
@@ -88,7 +88,7 @@ static int probe_int13h_41h(uint8_t drive, com32sys_t * regs)
memset(regs, 0, sizeof *regs);
regs->ebx.w[0] = 0x55AA; /* BX == 0x55AA */
probe_any(0x41, drive, regs);
- present = !(regs->eflags.l & 1);
+ present = !(regs->eflags.l & 1) && (regs->ebx.w[0] == 0xAA55);
dskprobe_printf(" AH41: CF%d BX%04x AH%02x DH%02x\n", regs->eflags.l & 1,
regs->ebx.w[0], regs->eax.b[1], regs->edx.b[1]);
return present;