From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JLiRd-0003Xp-3E for mharc-grub-devel@gnu.org; Sun, 03 Feb 2008 12:15:53 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JLiRb-0003VR-GA for grub-devel@gnu.org; Sun, 03 Feb 2008 12:15:51 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JLiRa-0003Tp-24 for grub-devel@gnu.org; Sun, 03 Feb 2008 12:15:51 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JLiRZ-0003TU-QN for grub-devel@gnu.org; Sun, 03 Feb 2008 12:15:49 -0500 Received: from c60.cesmail.net ([216.154.195.49]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1JLiRZ-0003b1-IP for grub-devel@gnu.org; Sun, 03 Feb 2008 12:15:49 -0500 Received: from unknown (HELO relay.cesmail.net) ([192.168.1.81]) by c60.cesmail.net with ESMTP; 03 Feb 2008 12:15:48 -0500 Received: from [192.168.1.28] (pool-96-227-20-21.phlapa.east.verizon.net [96.227.20.21]) by relay.cesmail.net (Postfix) with ESMTP id 2B2D3619055 for ; Sun, 3 Feb 2008 12:15:48 -0500 (EST) From: Pavel Roskin To: grub-devel@gnu.org Content-Type: text/plain Date: Sun, 03 Feb 2008 12:15:46 -0500 Message-Id: <1202058946.12671.7.camel@rd> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-1.fc8) Content-Transfer-Encoding: 7bit X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [PATCH] Fix boot device in chainloader X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2008 17:15:51 -0000 Hello! That's a very serious bug, which prevents Windows Vista from loading (and perhaps many other OSes depend on it too). Applying the patch fixes it. The patch needs to be applied before 1.96 is released, if possible. The boot drive setting is held in the %edx register, which is clobbered by grub_gate_a20() when called from grub_chainloader_real_boot(). %edx and %esi are preserved around grub_dl_unload_all(), but not around grub_gate_a20(). I'm not sure, but the bug may be relevant to the thread "root seems to be incorrectly set after install". ChangeLog | 6 ++++++ kern/i386/pc/startup.S | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c92168b..eb5d8ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-03 Pavel Roskin + + * a/kern/i386/pc/startup.S (grub_chainloader_real_boot): Pop + %edx and %esi from stack only after grub_gate_a20() is called. + grub_gate_a20() clobbers %edx. + 2008-02-03 Yoshinori K. Okuji * configure.ac (AC_INIT): Bumped to 1.96. diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index e4101a6..0bfe2b3 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -594,16 +594,16 @@ FUNCTION(grub_chainloader_real_boot) call EXT_C(grub_dl_unload_all) + /* Turn off Gate A20 */ + xorl %eax, %eax + call EXT_C(grub_gate_a20) + /* set up to pass boot drive */ popl %edx /* ESI must point to a partition table entry */ popl %esi - /* Turn off Gate A20 */ - xorl %eax, %eax - call EXT_C(grub_gate_a20) - call prot_to_real .code16 ljmp $0, $GRUB_MEMORY_MACHINE_BOOT_LOADER_ADDR -- Regards, Pavel Roskin