aboutsummaryrefslogtreecommitdiffstats
path: root/src/arch/i386/prefix
diff options
context:
space:
mode:
authorMichael Brown <mcb30@etherboot.org>2006-08-24 13:18:05 +0000
committerMichael Brown <mcb30@etherboot.org>2006-08-24 13:18:05 +0000
commit6abfaa153b7b9bcdbdfc8b842ebb3ec99428d69b (patch)
tree72f551c4156a9dd85d48099f905daccdb12a5933 /src/arch/i386/prefix
parentcddf8df8d4522f2fbc42520e9bfde9325caf0f56 (diff)
downloadipxe-6abfaa153b7b9bcdbdfc8b842ebb3ec99428d69b.tar.gz
Towards making KEEP_IT_REAL work again.
Fix bug that caused over-allocation of .text16 and .data16 memory areas by a factor of 16.
Diffstat (limited to 'src/arch/i386/prefix')
-rw-r--r--src/arch/i386/prefix/libprefix.S20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/arch/i386/prefix/libprefix.S b/src/arch/i386/prefix/libprefix.S
index f0f7682b..1c471aa0 100644
--- a/src/arch/i386/prefix/libprefix.S
+++ b/src/arch/i386/prefix/libprefix.S
@@ -99,11 +99,11 @@ alloc_basemem:
shlw $6, %ax
/* .data16 segment address */
- subw $_data16_size, %ax
+ subw $_data16_size_pgh, %ax
pushw %ax
/* .text16 segment address */
- subw $_text16_size, %ax
+ subw $_text16_size_pgh, %ax
pushw %ax
/* Update FBMS */
@@ -322,7 +322,14 @@ install_prealloc:
/* Install .text16 and .data16 */
call install_basemem
-#ifndef KEEP_IT_REAL
+#ifdef KEEP_IT_REAL
+ /* Preserve %ds, call init_libkir, restore registers */
+ pushw %ds
+ movw %bx, %ds
+ movw %ax, (init_libkir_vector+2)
+ lcall *init_libkir_vector
+ popw %ds
+#else
/* Preserve registers and interrupt status, and disable interrupts */
pushfw
pushw %ds
@@ -379,9 +386,14 @@ install_prealloc:
ret
.size install_prealloc, . - install_prealloc
-#ifndef KEEP_IT_REAL
/* Vectors for far calls to .text16 functions */
.section ".data16"
+#ifdef KEEP_IT_REAL
+init_libkir_vector:
+ .word init_libkir
+ .word 0
+ .size init_libkir_vector, . - init_libkir_vector
+#else
init_librm_vector:
.word init_librm
.word 0