[Midnightbsd-cvs] src [9319] trunk/sys/boot/i386/btx/btx/btx.S: When rebooting (exiting) from the BTX loader, make sure to restore the

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Mar 2 19:18:01 EST 2017


Revision: 9319
          http://svnweb.midnightbsd.org/src/?rev=9319
Author:   laffer1
Date:     2017-03-02 19:18:01 -0500 (Thu, 02 Mar 2017)
Log Message:
-----------
When rebooting (exiting) from the BTX loader, make sure to restore the
GDT from the correct segment, otherwise a triple fault would be caused.
In some virtual environments (VMware, VirtualBox, etc) this could lead
to a unhandled error or hang in the guest emulation software.

Thanks to avg and jhb for a few hints in the right direction.

Modified Paths:
--------------
    trunk/sys/boot/i386/btx/btx/btx.S

Modified: trunk/sys/boot/i386/btx/btx/btx.S
===================================================================
--- trunk/sys/boot/i386/btx/btx/btx.S	2017-03-03 00:17:11 UTC (rev 9318)
+++ trunk/sys/boot/i386/btx/btx/btx.S	2017-03-03 00:18:01 UTC (rev 9319)
@@ -248,7 +248,7 @@
 /*
  * Restore the GDT in case we caught a kernel trap.
  */
-		lgdt gdtdesc	 		# Set GDT
+		lgdt %cs:gdtdesc		# Set GDT
 /*
  * To 16 bits.
  */



More information about the Midnightbsd-cvs mailing list