Towards making KEEP_IT_REAL work again.

Fix bug that caused over-allocation of .text16 and .data16 memory areas
by a factor of 16.
This commit is contained in:
Michael Brown
2006-08-24 13:18:05 +00:00
parent cddf8df8d4
commit 6abfaa153b
7 changed files with 262 additions and 34 deletions
+16 -4
View File
@@ -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