summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mbr/isohdpfx.S15
1 files changed, 9 insertions, 6 deletions
diff --git a/mbr/isohdpfx.S b/mbr/isohdpfx.S
index 375c846d..801115c3 100644
--- a/mbr/isohdpfx.S
+++ b/mbr/isohdpfx.S
@@ -48,9 +48,9 @@ isolinux_start_hybrid = 0x7c00+64+4
stack = 0x7c00
partoffset = (stack-8)
driveno = (stack-14)
-ebios_flag = (stack-16)
+heads = (stack-16)
sectors = (stack-18)
-heads = (stack-20)
+ebios_flag = (stack-20)
secpercyl = (stack-24)
BIOS_kbdflags = 0x417
@@ -138,18 +138,21 @@ next:
jmp 1f
1:
popw %dx
- pushw %cx /* -16: Save EBIOS flag */
+ pushw %cx /* EBIOS flag */
/* Get (C)HS geometry */
movb $0x08, %ah
int $0x13
andw $0x3f, %cx /* Sector count */
- pushw %cx /* -18: Save sectors on the stack */
+ popw %bx /* EBIOS flag */
+ pushw %cx /* -16: Save sectors on the stack */
movzbw %dh, %ax /* dh = max head */
incw %ax /* From 0-based max to count */
- pushw %ax /* -20: Save heads on the stack */
+ pushw %ax /* -18: Save heads on the stack */
mulw %cx /* Heads*sectors -> sectors per cylinder */
+ pushw %bx /* -20: EBIOS flag */
+
/* Save sectors/cylinder on the stack */
pushw %dx /* -22: High word */
pushw %ax /* -24: Low word */
@@ -177,7 +180,7 @@ next:
jne bad_signature
cli
- movw $heads, %sp
+ movw $ebios_flag, %sp
/*
* Use a ljmpw here to work around a bug in some unknown version