diff options
author | Michael Brown <mcb30@ipxe.org> | 2010-04-25 01:37:25 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2010-04-25 01:50:46 +0100 |
commit | 5a5d8dd10a72d0a6e9c09e55e909e500eff55426 (patch) | |
tree | 6a16746498282541082580e9820dcf57c5fac32e /src/arch/i386/prefix/romprefix.S | |
parent | c97079710f47e35cf4573f04ccc01c319f74530c (diff) | |
download | ipxe-5a5d8dd10a72d0a6e9c09e55e909e500eff55426.tar.gz |
[romprefix] Inhibit the use of relocation during POST
It is common for system memory maps to be grotesquely unreliable
during POST. Many sanity checks have been added to the memory map
reading code, but these do not catch all problems.
Skip relocation entirely if called during POST. This should avoid the
problems typically encountered, at the cost of slightly disrupting the
memory map of an operating system booted via iPXE when iPXE was
entered during POST. Since this is a very rare special case (used,
for example, when reflashing an experimental ROM that would otherwise
prevent the system from completing POST), this is an acceptable cost.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/i386/prefix/romprefix.S')
-rw-r--r-- | src/arch/i386/prefix/romprefix.S | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/arch/i386/prefix/romprefix.S b/src/arch/i386/prefix/romprefix.S index 2858cb3f..27eda346 100644 --- a/src/arch/i386/prefix/romprefix.S +++ b/src/arch/i386/prefix/romprefix.S @@ -407,6 +407,7 @@ no_pmm: * picked up by the initial shell prompt, and we will drop * into a shell. */ + stc /* Inhibit relocation */ pushw %cs call exec 2: @@ -597,6 +598,7 @@ bbs_version: * Called by the PnP BIOS when it wants to boot us. */ bev_entry: + clc /* Allow relocation */ pushw %cs call exec lret @@ -631,6 +633,7 @@ int19_entry: /* Leave keypress in buffer and start iPXE. The keypress will * cause the usual initial Ctrl-B prompt to be skipped. */ + clc /* Allow relocation */ pushw %cs call exec 1: /* Try to call original INT 19 vector */ @@ -662,6 +665,9 @@ exec: /* Set %ds = %cs */ pushw %cs popw %ds + /* Preserve state of CF */ + lahf + /* Print message as soon as possible */ movw $prodstr, %si xorw %di, %di @@ -675,14 +681,17 @@ exec: /* Set %ds = %cs */ movw %sp, %bp /* Obtain a reasonably-sized temporary stack */ - xorw %ax, %ax - movw %ax, %ss + xorw %bx, %bx + movw %bx, %ss movw $0x7c00, %sp /* Install iPXE */ + sahf + pushfw + call alloc_basemem + popfw movl image_source, %esi movl decompress_to, %edi - call alloc_basemem call install_prealloc /* Print message indicating successful installation */ |