diff options
author | Michael Brown | 2012-07-10 23:07:34 +0200 |
---|---|---|
committer | Michael Brown | 2015-04-20 22:30:12 +0200 |
commit | dd0fe7a86278813fbf3c637aaf4ccf8d4ce678df (patch) | |
tree | 1de823e5bc2c04fadefb317aa830209de4ff6514 | |
parent | [setup] Make setup.S position-independent code (diff) | |
download | memtest86-dd0fe7a86278813fbf3c637aaf4ccf8d4ce678df.tar.gz memtest86-dd0fe7a86278813fbf3c637aaf4ccf8d4ce678df.tar.xz memtest86-dd0fe7a86278813fbf3c637aaf4ccf8d4ce678df.zip |
[setup] Preserve real-mode stack during mode transition
Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r-- | setup.S | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -73,6 +73,9 @@ alt_a20_done: * Note that the short jump isn't strictly needed, althought there are * reasons why it might be a good idea. It won't hurt in any case. */ + xorl %ebx, %ebx + movw %ss, %bx + shll $4, %ebx movw $0x0001, %ax # protected mode (PE) bit lmsw %ax # This is it# jmp flush_instr @@ -81,6 +84,7 @@ flush_instr: movw %ax, %ds movw %ax, %es movw %ax, %ss + addl %ebx, %esp movw %ax, %fs movw %ax, %gs |