aboutsummaryrefslogtreecommitdiffstats
path: root/memdisk
diff options
context:
space:
mode:
authorGene Cumm <gene.cumm@gmail.com>2011-01-26 21:47:48 -0500
committerGene Cumm <gene.cumm@gmail.com>2011-01-26 21:47:48 -0500
commit61702e11e5d3bc4de3b9df1c290f47c252af4605 (patch)
tree2afbb05634d8c9931b3b91f83ede3366f3cf6f3e /memdisk
parent78904a7cfd0eaac65429245c5ac63d5e514eb7b1 (diff)
downloadsyslinux-61702e11e5d3bc4de3b9df1c290f47c252af4605.tar.gz
syslinux-61702e11e5d3bc4de3b9df1c290f47c252af4605.tar.xz
syslinux-61702e11e5d3bc4de3b9df1c290f47c252af4605.zip
memdisk/dskprobe: Reorder operations to compact the debug output
By listing current regs, evaluate present, then display present last, it allows it to conveniently use only 1 output line.
Diffstat (limited to 'memdisk')
-rw-r--r--memdisk/dskprobe.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/memdisk/dskprobe.c b/memdisk/dskprobe.c
index 52ea5efd..afceb191 100644
--- a/memdisk/dskprobe.c
+++ b/memdisk/dskprobe.c
@@ -76,7 +76,7 @@ static int probe_int13h_01h(uint8_t drive)
memset(&regs, 0, sizeof regs);
probe_any(0x01, drive, &regs);
status = (regs.eflags.l & 1) * 256 + regs.eax.b[1];
- dskprobe_printf(" AH01: CF%d AH%02x\n", regs.eflags.l & 1, regs.eax.b[1]);
+ dskprobe_printf(" AH01: CF%d AH%02x", regs.eflags.l & 1, regs.eax.b[1]);
return status;
}
@@ -89,10 +89,11 @@ 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) && !regs->eax.b[1];
- dskprobe_printf(" AH08: P%d CF%d AH%02x AL%02x BL%02x DL%02x\n", present,
+ dskprobe_printf(" AH08: CF%d AH%02x AL%02x BL%02x DL%02x",
regs->eflags.l & 1, regs->eax.b[1], regs->eax.b[0],
regs->ebx.b[0], regs->edx.b[0]);
+ present = !(regs->eflags.l & 1) && !regs->eax.b[1];
+ dskprobe_printf(" P%d\n", present);
return present;
}
@@ -102,14 +103,17 @@ static int probe_int13h_08h(uint8_t drive, com32sys_t * regs)
static int probe_int13h_15h(uint8_t drive, com32sys_t * regs)
{
int present;
+ int status;
memset(regs, 0, sizeof *regs);
probe_any(0x15, drive, regs);
- present = !(regs->eflags.l & 1) && regs->eax.b[1]
- && !(probe_int13h_01h_fail(probe_int13h_01h(drive)));
- dskprobe_printf(" AH15: P%d CF%d AH%02x AL%02x CX%04x DX%04x\n", present,
+ dskprobe_printf(" AH15: CF%d AH%02x AL%02x CX%04x DX%04x",
regs->eflags.l & 1, regs->eax.b[1], regs->eax.b[0],
regs->ecx.w[0], regs->edx.w[0]);
+ present = !(regs->eflags.l & 1) && regs->eax.b[1];
+ status = probe_int13h_01h(drive);
+ present = present && !(probe_int13h_01h_fail(status));
+ dskprobe_printf(" P%d\n", present);
return present;
}
@@ -123,10 +127,11 @@ 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) && (regs->ebx.w[0] == 0xAA55);
- dskprobe_printf(" AH41: P%d CF%d BX%04x AH%02x DH%02x\n", present,
+ dskprobe_printf(" AH41: CF%d BX%04x AH%02x DH%02x",
regs->eflags.l & 1, regs->ebx.w[0], regs->eax.b[1],
regs->edx.b[1]);
+ present = !(regs->eflags.l & 1) && (regs->ebx.w[0] == 0xAA55);
+ dskprobe_printf(" P%d\n", present);
return present;
}