From 045fb24557f4c0a11273b28150b9a870f248197d Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 28 Jun 2007 21:56:14 +0100 Subject: [PATCH] Use internal real-mode stack from non-returnable prefixes --- src/arch/i386/core/stack16.S | 13 +++++++++++++ src/arch/i386/prefix/dskprefix.S | 4 ++++ src/arch/i386/prefix/romprefix.S | 4 ++++ 3 files changed, 21 insertions(+) create mode 100644 src/arch/i386/core/stack16.S diff --git a/src/arch/i386/core/stack16.S b/src/arch/i386/core/stack16.S new file mode 100644 index 00000000..3380a083 --- /dev/null +++ b/src/arch/i386/core/stack16.S @@ -0,0 +1,13 @@ + .arch i386 + +/**************************************************************************** + * Internal stack + **************************************************************************** + */ + .section ".stack16" + .align 8 + .globl _stack16 +_stack16: + .space 4096 + .globl _estack16 +_estack16: diff --git a/src/arch/i386/prefix/dskprefix.S b/src/arch/i386/prefix/dskprefix.S index 9b1ebaaf..1a48716a 100644 --- a/src/arch/i386/prefix/dskprefix.S +++ b/src/arch/i386/prefix/dskprefix.S @@ -350,6 +350,10 @@ msg1end: start_runtime: call install + /* Set up real-mode stack */ + movw %bx, %ss + movw $_estack16, %sp + /* Jump to .text16 segment */ pushw %ax pushw $1f diff --git a/src/arch/i386/prefix/romprefix.S b/src/arch/i386/prefix/romprefix.S index ced0f49c..52001699 100644 --- a/src/arch/i386/prefix/romprefix.S +++ b/src/arch/i386/prefix/romprefix.S @@ -139,6 +139,10 @@ exec_vector: call install + /* Set up real-mode stack */ + movw %bx, %ss + movw $_estack16, %sp + /* Jump to .text16 segment */ pushw %ax pushw $1f