summaryrefslogtreecommitdiff
path: root/mbr
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-25 17:48:58 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-05-25 17:48:58 -0700
commitbb519a95c0da9871fd99b068d00e96fd78cc8cc1 (patch)
treeea26286be0797667cf46dde652330e628629553e /mbr
parent942aadea9468884dfbc2a7c8428f52bbb5ecf360 (diff)
downloadsyslinux-bb519a95c0da9871fd99b068d00e96fd78cc8cc1.tar.gz
isohybrid: revert to a stack format compatible with previous versionsyslinux-3.81-pre14
Revert the isohybrid handover protocol so that it has a stack format compatible with the previous versions; that way we can also revert the magic number to a compatible one. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'mbr')
-rw-r--r--mbr/isohdpfx.S35
1 files changed, 18 insertions, 17 deletions
diff --git a/mbr/isohdpfx.S b/mbr/isohdpfx.S
index 53e1ed6b..31a792e8 100644
--- a/mbr/isohdpfx.S
+++ b/mbr/isohdpfx.S
@@ -39,15 +39,15 @@
.code16
.text
-HYBRID_MAGIC = 0x0defe3f7
+HYBRID_MAGIC = 0x7078c0fb
isolinux_hybrid_signature = 0x7c00+64
isolinux_start_hybrid = 0x7c00+64+4
.globl bootsec
/* Important: the top 6 words on the stack are passed to isolinux.bin */
stack = 0x7c00
-driveno = (stack-6)
-partoffset = (stack-14)
+partoffset = (stack-8)
+driveno = (stack-14)
ebios_flag = (stack-16)
sectors = (stack-18)
heads = (stack-20)
@@ -70,17 +70,19 @@ _start:
xorw %bx, %bx
movw %bx, %ds
movw %bx, %ss
- movw $stack, %sp
- pushw %es /* -4: es:di -> $PnP header */
+ movw $partoffset, %sp
+ pushw %es /* -12: es:di -> $PnP header */
pushw %di
movw %bx, %es
sti
cld
ADJUST_DRIVE
- pushw %dx /* -6: dl -> drive number */
+ pushw %dx /* -14: dl -> drive number */
/* Check to see if we have a partition table entry */
+ xorl %ebx, %ebx
+ xorl %ecx, %ecx
#ifdef PARTITION_SUPPORT
andw %si, %si /* %si == 0 -> no partition data */
jz 1f
@@ -90,22 +92,21 @@ _start:
jne 2f
cmpb $0xee, 4(%si) /* EFI partition type? */
jne 2f
+
/* We have GPT partition information */
- pushl (36+16)(%si) /* -10: partoffset_hi */
- pushl (32+16)(%si) /* -14: partoffset_lo */
- jmp 3f
-2:
+ movl (36+16)(%si), %ecx
+ movl (32+16)(%si), %ebx
+ jmp 1f
+
/* We have non-GPT partition information */
- pushl $0 /* -10: partoffset_hi */
- pushl 8(%si) /* -14: partoffset_lo */
- jmp 3f
+2:
+ movl 8(%si), %ecx
#endif
1:
/* We have no partition information */
- pushl $0 /* -10: partoffset_hi */
- pushl $0 /* -14: partoffset_lo */
-3:
-
+ movl %ecx, (partoffset) /* -4: partoffset_hi */
+ movl %ebx, (partoffset+4) /* -0: partoffset_lo */
+
/* Copy down to 0:0x600 */
movw $0x7c00, %si
movw $_start, %di