diff options
author | H. Peter Anvin <hpa@zytor.com> | 2009-05-26 09:14:41 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-05-26 09:19:49 -0700 |
commit | b8c15b400ad50af55678defe7c488262f21ac5fc (patch) | |
tree | 581a8128a002d32d1e0beb62fadc760e2d69f8c6 /mbr/isohdpfx.S | |
parent | 177b65b5924cdf47ad414c8f77a922ed75c23591 (diff) | |
download | syslinux-b8c15b400ad50af55678defe7c488262f21ac5fc.tar.gz |
isohdpfx: don't clear %ds before parsing partiting infosyslinux-3.81-pre15
The partition information is pointed to by ds:si; although ds
will *usually* be 0 it isn't guaranteed (in particular, it may
very well be 0x40 or 0x60); therefore, move the partition parsing
up before the reset of %ds and %es. As a side benefit, we get
to use push again...
Also, fix the ordering of the two halves of the GPT LBA!
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'mbr/isohdpfx.S')
-rw-r--r-- | mbr/isohdpfx.S | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/mbr/isohdpfx.S b/mbr/isohdpfx.S index 31a792e8..375c846d 100644 --- a/mbr/isohdpfx.S +++ b/mbr/isohdpfx.S @@ -67,19 +67,12 @@ bootsec: _start: cli - xorw %bx, %bx - movw %bx, %ds - movw %bx, %ss - movw $partoffset, %sp - pushw %es /* -12: es:di -> $PnP header */ - pushw %di - movw %bx, %es + xorw %bp, %bp + movw %bp, %ss + movw $stack, %sp sti cld - ADJUST_DRIVE - pushw %dx /* -14: dl -> drive number */ - /* Check to see if we have a partition table entry */ xorl %ebx, %ebx xorl %ecx, %ecx @@ -94,8 +87,8 @@ _start: jne 2f /* We have GPT partition information */ - movl (36+16)(%si), %ecx - movl (32+16)(%si), %ebx + movl (32+16)(%si), %ecx + movl (36+16)(%si), %ebx jmp 1f /* We have non-GPT partition information */ @@ -104,8 +97,16 @@ _start: #endif 1: /* We have no partition information */ - movl %ecx, (partoffset) /* -4: partoffset_hi */ - movl %ebx, (partoffset+4) /* -0: partoffset_lo */ + pushl %ebx /* -4: partoffset_hi */ + pushl %ecx /* -8: partoffset_lo */ + pushw %es /* -10: es:di -> $PnP header */ + pushw %di /* -12: es:di -> $PnP header */ + + movw %bp, %ds + movw %bp, %es + + ADJUST_DRIVE + pushw %dx /* -14: dl -> drive number */ /* Copy down to 0:0x600 */ movw $0x7c00, %si |