From 39204fdedc276545c9d9b36350c8014337f3fca4 Mon Sep 17 00:00:00 2001 From: Brian Palmer Date: Wed, 30 Oct 2002 23:05:17 +0000 Subject: [PATCH] Fix for MS's idiocy on a Win98 boot disk I have. Apparently they use ESP without initializing anything more than SP. svn path=/trunk/; revision=3677 --- freeldr/freeldr/arch/i386/arch.S | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/freeldr/freeldr/arch/i386/arch.S b/freeldr/freeldr/arch/i386/arch.S index a591ffc6c1e..78e2013bad5 100644 --- a/freeldr/freeldr/arch/i386/arch.S +++ b/freeldr/freeldr/arch/i386/arch.S @@ -155,6 +155,15 @@ inrmode: movw %ax,%fs movw %ax,%gs movw %ax,%ss + + /* Clear out the high 16-bits of ESP */ + /* This is needed because I have a stupid */ + /* MS-Win98 boot disk that hangs if there is */ + /* anything other than 0x0000 in the high */ + /* 16-bits of ESP. Even though real-mode */ + /* code should only use SP and not ESP. */ + xorl %esp,%esp + movw stack16,%sp /* Put the return address back onto the stack */