From dd0fe7a86278813fbf3c637aaf4ccf8d4ce678df Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 10 Jul 2012 22:07:34 +0100 Subject: [setup] Preserve real-mode stack during mode transition Signed-off-by: Michael Brown --- setup.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.S b/setup.S index 9ae578f..2fe3d2d 100644 --- a/setup.S +++ b/setup.S @@ -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 -- cgit v1.2.3-55-g7522