summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2014-05-15 14:04:47 +0200
committerMichael Brown2014-05-15 14:04:47 +0200
commitf747a00c54ccc7b839399c755f1d138a233d368f (patch)
treed976619f0b08a3493c15c3625886c0a16ebf58f7
parent[build] Merge util/geniso and util/genliso (diff)
downloadipxe-f747a00c54ccc7b839399c755f1d138a233d368f.tar.gz
ipxe-f747a00c54ccc7b839399c755f1d138a233d368f.tar.xz
ipxe-f747a00c54ccc7b839399c755f1d138a233d368f.zip
[lkrnprefix] Make real-mode setup code relocatable
The bzImage boot protocol allows the real-mode code to be loaded at any segment within base memory. (The fact that both iPXE and recent versions of Syslinux will load the real-mode code at 1000:0000 is a coincidence; it is not guaranteed by the specification.) Fix by making the code relocatable. Reported-by: Andrew Stuart <andrew@shopcusa.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/arch/i386/prefix/lkrnprefix.S7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/arch/i386/prefix/lkrnprefix.S b/src/arch/i386/prefix/lkrnprefix.S
index de6c6f6bd..259bc6ba5 100644
--- a/src/arch/i386/prefix/lkrnprefix.S
+++ b/src/arch/i386/prefix/lkrnprefix.S
@@ -1,6 +1,5 @@
FILE_LICENCE ( GPL_ANY )
-#define BZI_RM_SEGMENT 0x1000
#define BZI_LOAD_HIGH_ADDR 0x100000
.text
@@ -61,7 +60,7 @@ version:
realmode_swtch:
.long 0
start_sys:
- .word BZI_RM_SEGMENT
+ .word 0
kernel_version:
.word version_string - 0x200
type_of_loader:
@@ -114,7 +113,9 @@ version_string:
setup:
/* Fix up code segment */
- ljmp $BZI_RM_SEGMENT, $1f
+ pushw %ds
+ pushw $1f
+ lret
1:
/* Set up stack just below 0x7c00 and clear direction flag */
xorw %ax, %ax