From 0a735942e21ef2ee375bb8949ec18bb724275d44 Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Fri, 20 Nov 2009 14:18:43 +0000 Subject: [PATCH] restore real mode with CPL != 0 --- bochs/cpu/init.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bochs/cpu/init.cc b/bochs/cpu/init.cc index 2f0c75b9f..f9d97c5a6 100644 --- a/bochs/cpu/init.cc +++ b/bochs/cpu/init.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: init.cc,v 1.221 2009-11-13 16:01:37 sshwarts Exp $ +// $Id: init.cc,v 1.222 2009-11-20 14:18:43 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -677,7 +677,10 @@ void BX_CPU_C::param_restore(bx_param_c *param, Bit64s val) void BX_CPU_C::after_restore_state(void) { - if (BX_CPU_THIS_PTR cpu_mode == BX_MODE_IA32_V8086) CPL = 3; + if (BX_CPU_THIS_PTR cpu_mode == BX_MODE_IA32_REAL) CPL = 0; + else { + if (BX_CPU_THIS_PTR cpu_mode == BX_MODE_IA32_V8086) CPL = 3; + } if (!SetCR0(cr0.val32)) BX_PANIC(("Incorrect CR0 state !"));