summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/prefix
diff options
context:
space:
mode:
authorMichael Brown2007-07-19 16:54:33 +0200
committerMichael Brown2007-07-19 17:07:31 +0200
commit2cfe0dee1f8960937a9049e10e91d8c70def546e (patch)
treecf48f503cf4ef88298887faa7233834a4b45cd8b /src/arch/i386/prefix
parentRemove INT 13,4b handler; it represents an incomplete feature (CD-ROM (diff)
downloadipxe-2cfe0dee1f8960937a9049e10e91d8c70def546e.tar.gz
ipxe-2cfe0dee1f8960937a9049e10e91d8c70def546e.tar.xz
ipxe-2cfe0dee1f8960937a9049e10e91d8c70def546e.zip
Don't trash the %ecx value returned by relocate(). This was causing
us to round down the size for the relocation copy to the nearest 64kB (+0x10 bytes); this just happened to work on most machines because the last 64kB of the image is all-zeroes anyway (it's the .bss).
Diffstat (limited to 'src/arch/i386/prefix')
-rw-r--r--src/arch/i386/prefix/libprefix.S14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/arch/i386/prefix/libprefix.S b/src/arch/i386/prefix/libprefix.S
index f146d3de..26ec752d 100644
--- a/src/arch/i386/prefix/libprefix.S
+++ b/src/arch/i386/prefix/libprefix.S
@@ -277,7 +277,7 @@ gdt_end:
* Sets limits on the data segments %ds and %es.
*
* Parameters:
- * %cx : segment type (FLAT_DS for 4GB or REAL_DS for 64kB)
+ * %dx : segment type (FLAT_DS for 4GB or REAL_DS for 64kB)
****************************************************************************
*/
@@ -309,8 +309,8 @@ set_real_mode_limits:
movl %eax, %cr0
/* Set flat segment limits */
- movw %cx, %ds
- movw %cx, %es
+ movw %dx, %ds
+ movw %dx, %es
/* Switch back to real mode */
movl %cr0, %eax
@@ -355,6 +355,7 @@ install:
install_prealloc:
/* Save registers */
pushl %esi
+ pushw %dx
/* Install .text16 and .data16 */
movl $_payload_offset, %esi
call install_basemem
@@ -385,7 +386,7 @@ install_prealloc:
* prior to reading the E820 memory map and relocating
* properly.
*/
- movw $FLAT_DS, %cx
+ movw $FLAT_DS, %dx
call set_real_mode_limits
movl $HIGHMEM_LOADPOINT, %edi
call install_highmem
@@ -400,7 +401,7 @@ install_prealloc:
addw $4, %sp
/* Move code to new location, set up new protected-mode GDT */
- movw $FLAT_DS, %cx
+ movw $FLAT_DS, %dx
call set_real_mode_limits
pushl %edi
es rep addr32 movsb
@@ -408,7 +409,7 @@ install_prealloc:
lcall *init_librm_vector
/* Restore real-mode segment limits */
- movw $REAL_DS, %cx
+ movw $REAL_DS, %dx
call set_real_mode_limits
/* Restore registers and interrupt status */
@@ -417,6 +418,7 @@ install_prealloc:
popw %ds
popfw
#endif
+ popw %dx
popl %esi
ret
.size install_prealloc, . - install_prealloc