Interrupts / Some DOS extender fixes

Jukka Heinonen jhei at iki.fi
Fri Nov 1 17:14:01 CST 2002


This patch makes some 32-bit DOS extenders almost work.


Changelog:
   Ignore VCPI installation checks. Handle XMS
   query any extended memory function. Add stubs for
   get/set exception handler vector.


Index: dlls/winedos/int67.c
===================================================================
RCS file: /home/wine/wine/dlls/winedos/int67.c,v
retrieving revision 1.7
diff -u -r1.7 int67.c
--- dlls/winedos/int67.c        31 Aug 2002 18:47:00 -0000      1.7
+++ dlls/winedos/int67.c        1 Nov 2002 23:08:26 -0000
@@ -436,6 +436,21 @@
   case 0x5b: /* EMS 4.0 - ALTERNATE MAP REGISTER SET */
   case 0x5c: /* EMS 4.0 - PREPARE EXPANDED MEMORY HARDWARE FOR WARM BOOT */
   case 0x5d: /* EMS 4.0 - ENABLE/DISABLE OS FUNCTION SET FUNCTIONS */
+    INT_BARF(context,0x67);
+    break;
+
+  case 0xde: /* Virtual Control Program Interface (VCPI) */
+    if(AL_reg(context) == 0x00) {
+      /*
+       * VCPI INSTALLATION CHECK
+       * (AH_reg() != 0) means VCPI is not present
+       */
+      TRACE("- VCPI installation check\n");
+      return;
+    } else
+      INT_BARF(context,0x67);
+    break;
+
   default:
     INT_BARF(context,0x67);
   }




Index: dlls/winedos/xms.c
===================================================================
RCS file: /home/wine/wine/dlls/winedos/xms.c,v
retrieving revision 1.6
diff -u -r1.6 xms.c
--- dlls/winedos/xms.c  31 Aug 2002 18:47:00 -0000      1.6
+++ dlls/winedos/xms.c  1 Nov 2002 23:07:22 -0000
@@ -104,6 +104,24 @@
        if (move->Dest.Handle) GlobalUnlock16(move->Dest.Handle);
        break;
     }
+    case 0x88:   /* Query Any Free Extended Memory */
+    {
+        MEMORYSTATUS status;
+        SYSTEM_INFO  info;
+
+        TRACE("query any free extended memory\n");
+
+        GlobalMemoryStatus( &status );
+        GetSystemInfo( &info );
+        context->Eax = status.dwAvailVirtual >> 10;
+        context->Edx = status.dwAvailVirtual >> 10;
+        context->Ecx = (DWORD)info.lpMaximumApplicationAddress;
+        SET_BL( context, 0 ); /* No errors. */
+
+        TRACE("returning largest %ldK, total %ldK, highest 0x%lx\n", 
+              context->Eax, context->Edx, context->Ecx);
+    }
+    break;
     default:
         INT_BARF( context, 0x31 );
         SET_AX( context, 0x0000 ); /* failure */




Index: dlls/winedos/int31.c
===================================================================
RCS file: /home/wine/wine/dlls/winedos/int31.c,v
retrieving revision 1.11
diff -u -r1.11 int31.c
--- dlls/winedos/int31.c        29 Oct 2002 23:09:30 -0000      1.11
+++ dlls/winedos/int31.c        1 Nov 2002 23:05:35 -0000
@@ -438,7 +438,8 @@
     pm_ctx.SegFs = 0;
     pm_ctx.SegGs = 0;
 
-    TRACE("DOS program is now entering protected mode\n");
+    TRACE("DOS program is now entering %d-bit protected mode\n", 
+          DOSVM_IsDos32() ? 32 : 16);
     wine_call_to_16_regs_short(&pm_ctx, 0);
 
     /* in the current state of affairs, we won't ever actually return here... */
@@ -677,6 +678,32 @@
     RESET_CFLAG(context);
     switch(AX_reg(context))
     {
+    case 0x0008:  /* Set selector limit */
+        {
+           DWORD limit = MAKELONG( DX_reg(context), CX_reg(context) );
+           TRACE( "set selector limit (0x%04x,0x%08lx)\n",
+                  BX_reg(context), limit );
+           SetSelectorLimit16( BX_reg(context), limit );
+       }
+        break;
+
+    case 0x0202:  /* Get Processor Exception Handler Vector */
+        FIXME( "Get Processor Exception Handler Vector (0x%02x)\n",
+               BL_reg(context) );
+        if (DOSVM_IsDos32()) {
+            SET_CX( context, 0 );
+            context->Edx = 0;
+        } else {
+            SET_CX( context, 0 );
+            SET_DX( context, 0 );
+        }
+        break;
+
+    case 0x0203:  /* Set Processor Exception Handler Vector */
+         FIXME( "Set Processor Exception Handler Vector (0x%02x)\n",
+               BL_reg(context) );
+         break;
+
     case 0x0204:  /* Get protected mode interrupt vector */
         TRACE("get protected mode interrupt handler (0x%02x)\n",
              BL_reg(context));




-- 
Jukka Heinonen <http://www.iki.fi/jhei/>



More information about the wine-patches mailing list