[NTVDM]: Move EMS support as a BIOS module (and initialize it after the BIOS has...
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 14 Mar 2015 03:37:54 +0000 (03:37 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 14 Mar 2015 03:37:54 +0000 (03:37 +0000)
svn path=/trunk/; revision=66675

reactos/subsystems/mvdm/ntvdm/CMakeLists.txt
reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c
reactos/subsystems/mvdm/ntvdm/bios/bios32/ems.c [moved from reactos/subsystems/mvdm/ntvdm/ems.c with 98% similarity]
reactos/subsystems/mvdm/ntvdm/bios/bios32/ems.h [moved from reactos/subsystems/mvdm/ntvdm/ems.h with 98% similarity]
reactos/subsystems/mvdm/ntvdm/emulator.c

index 9f80333..69045e8 100644 (file)
@@ -10,6 +10,7 @@ list(APPEND SOURCE
     bios/bios32/kbdbios32.c
     bios/bios32/vidbios32.c
     bios/bios32/moubios32.c
+    bios/bios32/ems.c
     bios/bios.c
     bios/kbdbios.c
     bios/rom.c
@@ -33,7 +34,6 @@ list(APPEND SOURCE
     dos/mouse32.c
     dos/dem.c
     clock.c
-    ems.c
     emulator.c
     int32.c
     io.c
index 548e7dd..bfc26b0 100644 (file)
@@ -26,6 +26,8 @@
 #include "vidbios32.h"
 #include "moubios32.h"
 
+#include "ems.h"
+
 #include "io.h"
 #include "hardware/cmos.h"
 #include "hardware/pic.h"
@@ -665,6 +667,9 @@ Bios32Post(VOID)
 
     SearchAndInitRoms(&BiosContext);
 
+    /* Initialize EMS */
+    EmsInitialize();
+
     /*
      * End of the 32-bit POST portion. We then fall back into 16-bit where
      * the rest of the POST code is executed, typically calling INT 19h
@@ -726,6 +731,7 @@ BOOLEAN Bios32Initialize(VOID)
 
 VOID Bios32Cleanup(VOID)
 {
+    EmsCleanup();
     MouseBios32Cleanup();
     VidBios32Cleanup();
     KbdBios32Cleanup();
similarity index 98%
rename from reactos/subsystems/mvdm/ntvdm/ems.c
rename to reactos/subsystems/mvdm/ntvdm/bios/bios32/ems.c
index 09919a2..5dfd8f0 100644 (file)
@@ -195,6 +195,14 @@ static VOID WINAPI EmsIntHandler(LPWORD Stack)
             break;
         }
 
+        /* Get EMM Version */
+        case 0x46:
+        {
+            setAH(EMS_STATUS_OK);
+            setAL(EMS_VERSION_NUM);
+            break;
+        }
+
         /* Move/Exchange Memory */
         case 0x57:
         {
similarity index 98%
rename from reactos/subsystems/mvdm/ntvdm/ems.h
rename to reactos/subsystems/mvdm/ntvdm/bios/bios32/ems.h
index ccfdbe9..bb13db1 100644 (file)
@@ -11,6 +11,7 @@
 
 /* DEFINITIONS ****************************************************************/
 
+#define EMS_VERSION_NUM     0x04
 #define EMS_INTERRUPT_NUM   0x67
 #define EMS_SEGMENT         0xD000
 #define EMS_MAX_HANDLES     16
index 246f827..74bd599 100644 (file)
@@ -31,7 +31,6 @@
 #include "hardware/sound/speaker.h"
 #include "hardware/pit.h"
 #include "hardware/video/vga.h"
-#include "ems.h"
 
 #include "vddsup.h"
 #include "io.h"
@@ -469,9 +468,6 @@ BOOLEAN EmulatorInitialize(HANDLE ConsoleInput, HANDLE ConsoleOutput)
     /* Initialize I/O ports */
     /* Initialize RAM */
 
-    /* Initialize EMS */
-    EmsInitialize();
-
     /* Initialize the CPU */
 
     /* Initialize the internal clock */
@@ -557,7 +553,6 @@ VOID EmulatorCleanup(VOID)
 
     PS2Cleanup();
 
-    EmsCleanup();
     SpeakerCleanup();
     CmosCleanup();
     // PitCleanup();