aboutsummaryrefslogtreecommitdiffstats
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
parent942aadea9468884dfbc2a7c8428f52bbb5ecf360 (diff)
downloadsyslinux.git-bb519a95c0da9871fd99b068d00e96fd78cc8cc1.tar.gz
syslinux.git-bb519a95c0da9871fd99b068d00e96fd78cc8cc1.tar.xz
syslinux.git-bb519a95c0da9871fd99b068d00e96fd78cc8cc1.zip
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>
-rw-r--r--core/isolinux.asm29
-rw-r--r--mbr/isohdpfx.S35
-rw-r--r--utils/isohybrid.in2
3 files changed, 32 insertions, 34 deletions
diff --git a/core/isolinux.asm b/core/isolinux.asm
index b85ecd36..104de14a 100644
--- a/core/isolinux.asm
+++ b/core/isolinux.asm
@@ -224,35 +224,32 @@ bi_end:
; Custom entry point for the hybrid-mode disk.
; The following values will have been pushed onto the
; entry stack:
+ ; - partition offset (qword)
; - ES
; - DI
; - DX (including drive number)
- ; - partition offset (qword)
- ; - EBIOS flag
- ; - CBIOS Sectors
; - CBIOS Heads
+ ; - CBIOS Sectors
+ ; - EBIOS flag
; (top of stack)
;
%ifndef DEBUG_MESSAGES
_hybrid_signature:
- dd 0x0defe3f7
+ dd 0x7078c0fb ; An arbitrary number...
+
_start_hybrid:
- pop word [cs:bsHeads]
+ pop cx ; EBIOS flag
pop word [cs:bsSecPerTrack]
-
- pop ax
- mov si,bios_cbios
- and ax,ax
- jz .cbios
- mov si,bios_ebios
-.cbios:
-
- pop dword [cs:bsHidden]
- pop dword [cs:bsHidden+4]
-
+ pop word [cs:bsHeads]
pop dx
pop di
pop es
+ pop dword [cs:bsHidden]
+ pop dword [cs:bsHidden+4]
+
+ mov si,bios_cbios
+ jcxz _start_common
+ mov si,bios_ebios
jmp _start_common
%endif
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
diff --git a/utils/isohybrid.in b/utils/isohybrid.in
index b3a502bc..cfb92ed6 100644
--- a/utils/isohybrid.in
+++ b/utils/isohybrid.in
@@ -165,7 +165,7 @@ if ($de_boot != 0x88 || $de_media != 0 ||
# Now $de_lba should contain the CD sector number for isolinux.bin
seek(FILE, $de_lba*2048+0x40, SEEK_SET) or die "$0: $file: $!\n";
read(FILE, $ibsig, 4);
-if ($ibsig ne "\xf7\xe3\xef\x0d") {
+if ($ibsig ne "\xfb\xc0\x78\x70") {
die "$0: $file: bootloader is missing current (3.81+) isolinux.bin\n".
" hybrid signature; Note that isolinux-debug.bin does not\n".
" support hybrid booting.\n";