diff options
-rw-r--r-- | core/isolinux.asm | 29 | ||||
-rw-r--r-- | mbr/isohdpfx.S | 35 | ||||
-rw-r--r-- | utils/isohybrid.in | 2 |
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"; |