Author: dim Date: Wed Apr 24 17:20:45 2013 New Revision: 249846 URL: http://svnweb.freebsd.org/changeset/base/249846
Log: 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. Noticed by: Jeremy Chadwick <j...@koitsu.org> (and many others) MFC after: 1 week Modified: head/sys/boot/i386/btx/btx/btx.S head/sys/boot/pc98/btx/btx/btx.S Modified: head/sys/boot/i386/btx/btx/btx.S ============================================================================== --- head/sys/boot/i386/btx/btx/btx.S Wed Apr 24 16:52:03 2013 (r249845) +++ head/sys/boot/i386/btx/btx/btx.S Wed Apr 24 17:20:45 2013 (r249846) @@ -248,7 +248,7 @@ exit: cli # Disable interrupts /* * Restore the GDT in case we caught a kernel trap. */ - lgdt gdtdesc # Set GDT + lgdt %cs:gdtdesc # Set GDT /* * To 16 bits. */ Modified: head/sys/boot/pc98/btx/btx/btx.S ============================================================================== --- head/sys/boot/pc98/btx/btx/btx.S Wed Apr 24 16:52:03 2013 (r249845) +++ head/sys/boot/pc98/btx/btx/btx.S Wed Apr 24 17:20:45 2013 (r249846) @@ -248,7 +248,7 @@ exit: cli # Disable interrupts /* * Restore the GDT in case we caught a kernel trap. */ - lgdt gdtdesc # Set GDT + lgdt %cs:gdtdesc # Set GDT /* * To 16 bits. */ _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"