[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bochs-cvs
Subject:    [Bochs-cvs] CVS: bochs/cpu cpu.h, 1.378, 1.379 exception.cc, 1.96,
From:       Stanislav Shwartsman <sshwarts () users ! sourceforge ! net>
Date:       2007-11-30 8:49:14
Message-ID: E1Iy1Yg-0004ro-SW () sc8-pr-cvs3 ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/bochs/bochs/cpu
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18314/cpu

Modified Files:
	cpu.h exception.cc segment_ctrl_pro.cc stack32.cc stack_pro.cc 
Log Message:
Fixed bug prevented to boot Win98



Index: cpu.h
===================================================================
RCS file: /cvsroot/bochs/bochs/cpu/cpu.h,v
retrieving revision 1.378
retrieving revision 1.379
diff -u -d -r1.378 -r1.379
--- cpu.h	29 Nov 2007 21:45:10 -0000	1.378
+++ cpu.h	30 Nov 2007 08:49:12 -0000	1.379
@@ -3243,7 +3243,6 @@
   BX_SMF void    pop_64(Bit64u *value64_ptr);
   BX_SMF bx_bool can_push(bx_descriptor_t *descriptor, Bit32u esp, Bit32u bytes) BX_CPP_AttrRegparmN(3);
   BX_SMF bx_bool can_pop(Bit32u bytes);
-  BX_SMF void    decrementESPForPush(unsigned nBytes, Bit32u *eSP);
   BX_SMF void    sanity_checks(void);
   BX_SMF void    assert_checks(void);
   BX_SMF void    enter_system_management_mode(void);

Index: exception.cc
===================================================================
RCS file: /cvsroot/bochs/bochs/cpu/exception.cc,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- exception.cc	24 Nov 2007 14:22:33 -0000	1.96
+++ exception.cc	30 Nov 2007 08:49:12 -0000	1.97
@@ -428,7 +428,7 @@
         IS_DATA_SEGMENT(cs_descriptor.type) ||
         cs_descriptor.dpl>CPL)
     {
-      BX_ERROR(("interrupt(): not accessable or not code segment"));
+      BX_ERROR(("interrupt(): not accessable or not code segment cs=0x%04x", cs_selector.value));
       exception(BX_GP_EXCEPTION, cs_selector.value & 0xfffc, 0);
     }
 

Index: segment_ctrl_pro.cc
===================================================================
RCS file: /cvsroot/bochs/bochs/cpu/segment_ctrl_pro.cc,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- segment_ctrl_pro.cc	24 Nov 2007 14:22:34 -0000	1.76
+++ segment_ctrl_pro.cc	30 Nov 2007 08:49:12 -0000	1.77
@@ -139,7 +139,7 @@
       parse_descriptor(dword1, dword2, &descriptor);
 
       if (descriptor.valid==0) {
-        BX_ERROR(("load_seg_reg(%s): valid bit cleared", strseg(seg)));
+        BX_ERROR(("load_seg_reg(%s, 0x%04x): invalid segment", strseg(seg), new_value));
         exception(BX_GP_EXCEPTION, new_value & 0xfffc, 0);
       }
 
@@ -147,7 +147,7 @@
       if (descriptor.segment==0 || (IS_CODE_SEGMENT(descriptor.type) && 
           IS_CODE_SEGMENT_READABLE(descriptor.type) == 0))
       {
-        BX_ERROR(("load_seg_reg(%s): not data or readable code", strseg(seg)));
+        BX_ERROR(("load_seg_reg(%s, 0x%04x): not data or readable code", strseg(seg), new_value));
         exception(BX_GP_EXCEPTION, new_value & 0xfffc, 0);
       }
 
@@ -157,14 +157,14 @@
           IS_CODE_SEGMENT_NON_CONFORMING(descriptor.type))
       {
         if ((selector.rpl > descriptor.dpl) || (CPL > descriptor.dpl)) {
-          BX_ERROR(("load_seg_reg(%s): RPL & CPL must be <= DPL", strseg(seg)));
+          BX_ERROR(("load_seg_reg(%s, 0x%04x): RPL & CPL must be <= DPL", strseg(seg), new_value));
           exception(BX_GP_EXCEPTION, new_value & 0xfffc, 0);
         }
       }
 
       /* segment must be marked PRESENT else #NP(selector) */
       if (! IS_PRESENT(descriptor)) {
-        BX_ERROR(("load_seg_reg(%s): segment not present", strseg(seg)));
+        BX_ERROR(("load_seg_reg(%s, 0x%04x): segment not present", strseg(seg), new_value));
         exception(BX_NP_EXCEPTION, new_value & 0xfffc, 0);
       }
 

Index: stack32.cc
===================================================================
RCS file: /cvsroot/bochs/bochs/cpu/stack32.cc,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- stack32.cc	24 Nov 2007 14:22:34 -0000	1.41
+++ stack32.cc	30 Nov 2007 08:49:12 -0000	1.42
@@ -77,85 +77,32 @@
 
 void BX_CPU_C::PUSH32_CS(bxInstruction_c *i)
 {
-  Bit32u eSP;
-  decrementESPForPush(4, &eSP);
-  write_virtual_word(BX_SEG_REG_SS, eSP,
-            &BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.value);
+  push_32(BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.value);
 }
 
 void BX_CPU_C::PUSH32_DS(bxInstruction_c *i)
 {
-  Bit32u eSP;
-  decrementESPForPush(4, &eSP);
-  write_virtual_word(BX_SEG_REG_SS, eSP,
-           &BX_CPU_THIS_PTR sregs[BX_SEG_REG_DS].selector.value);
-
-  if (BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].cache.u.segment.d_b) {
-    ESP = eSP;
-  }
-  else {
-    SP = (Bit16u) eSP;
-  }
+  push_32(BX_CPU_THIS_PTR sregs[BX_SEG_REG_DS].selector.value);
 }
 
 void BX_CPU_C::PUSH32_ES(bxInstruction_c *i)
 {
-  Bit32u eSP;
-  decrementESPForPush(4, &eSP);
-  write_virtual_word(BX_SEG_REG_SS, eSP,
-            &BX_CPU_THIS_PTR sregs[BX_SEG_REG_ES].selector.value);
-
-  if (BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].cache.u.segment.d_b) {
-    ESP = eSP;
-  }
-  else {
-    SP = (Bit16u) eSP;
-  }
+  push_32(BX_CPU_THIS_PTR sregs[BX_SEG_REG_ES].selector.value);
 }
 
 void BX_CPU_C::PUSH32_FS(bxInstruction_c *i)
 {
-  Bit32u eSP;
-  decrementESPForPush(4, &eSP);
-  write_virtual_word(BX_SEG_REG_SS, eSP,
-            &BX_CPU_THIS_PTR sregs[BX_SEG_REG_FS].selector.value);
-
-  if (BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].cache.u.segment.d_b) {
-    ESP = eSP;
-  }
-  else {
-    SP = (Bit16u) eSP;
-  }
+  push_32(BX_CPU_THIS_PTR sregs[BX_SEG_REG_FS].selector.value);
 }
 
 void BX_CPU_C::PUSH32_GS(bxInstruction_c *i)
 {
-  Bit32u eSP;
-  decrementESPForPush(4, &eSP);
-  write_virtual_word(BX_SEG_REG_SS, eSP,
-            &BX_CPU_THIS_PTR sregs[BX_SEG_REG_GS].selector.value);
-
-  if (BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].cache.u.segment.d_b) {
-    ESP = eSP;
-  }
-  else {
-    SP = (Bit16u) eSP;
-  }
+  push_32(BX_CPU_THIS_PTR sregs[BX_SEG_REG_GS].selector.value);
 }
 
 void BX_CPU_C::PUSH32_SS(bxInstruction_c *i)
 {
-  Bit32u eSP;
-  decrementESPForPush(4, &eSP);
-  write_virtual_word(BX_SEG_REG_SS, eSP,
-            &BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].selector.value);
-
-  if (BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].cache.u.segment.d_b) {
-    ESP = eSP;
-  }
-  else {
-    SP = (Bit16u) eSP;
-  }
+  push_32(BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].selector.value);
 }
 
 void BX_CPU_C::POP32_DS(bxInstruction_c *i)

Index: stack_pro.cc
===================================================================
RCS file: /cvsroot/bochs/bochs/cpu/stack_pro.cc,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- stack_pro.cc	24 Nov 2007 14:22:34 -0000	1.32
+++ stack_pro.cc	30 Nov 2007 08:49:12 -0000	1.33
@@ -328,34 +328,3 @@
     return(0);
   }
 }
-
-void BX_CPU_C::decrementESPForPush(unsigned nBytes, Bit32u *eSP_ptr)
-{
-  Bit32u eSP;
-
-  if (BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].cache.u.segment.d_b)
-    eSP = ESP;
-  else
-    eSP = SP;
-
-  if (protected_mode()) {
-    if (!can_push(&BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].cache, eSP, nBytes)) {
-      BX_INFO(("decrementESPForPush: push outside stack limits"));
-      exception(BX_SS_EXCEPTION, 0, 0);
-    }
-  }
-  else { // Real Mode.
-    if ( (eSP>=1) && (eSP<nBytes) ) {
-      BX_PANIC(("decrementESPForPush: eSP=%08x", (unsigned) eSP));
-    }
-  }
-
-  // And finally, decrement eSP and return the new eSP value.
-  eSP -= nBytes;
-  if (BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].cache.u.segment.d_b) {
-    *eSP_ptr = eSP;
-  }
-  else {
-    *eSP_ptr = SP;
-  }
-}


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Bochs-cvs mailing list
Bochs-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bochs-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic