[NTVDM]
[reactos.git] / reactos / subsystems / ntvdm / bios / bios32 / bios32.c
index 045e58c..6a4aaba 100644 (file)
@@ -112,6 +112,20 @@ static VOID WINAPI BiosMiscService(LPWORD Stack)
             break;
         }
 
+        /* Get Configuration */
+        case 0xC0:
+        {
+            /* Return the BIOS ROM Configuration Table address in ES:BX */
+            setES(HIWORD(Bct));
+            setBX(LOWORD(Bct));
+
+            /* Call successful; clear CF */
+            setAH(0x00);
+            Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF;
+
+            break;
+        }
+
         default:
         {
             DPRINT1("BIOS Function INT 15h, AH = 0x%02X NOT IMPLEMENTED\n",
@@ -336,6 +350,37 @@ static VOID InitializeBiosInt32(VOID)
     ((PULONG)BaseAddress)[0x49] = (ULONG)NULL;
 }
 
+static VOID InitializeBiosInfo(VOID)
+{
+    Bct->Length         = sizeof(*Bct);
+    Bct->Model          = 0xFC; // PC-AT; see http://www.ctyme.com/intr/rb-1594.htm#Table515
+    Bct->SubModel       = 0x00;
+    Bct->BiosRevision   = 0x01;
+    Bct->BiosFeature[0] = 0x64; // At the moment we don't support "INT 15/AH=4Fh called upon INT 09h" nor "wait for external event (INT 15/AH=41h) supported"; see http://www.ctyme.com/intr/rb-1594.htm#Table510
+    Bct->BiosFeature[1] = 0x00; // We don't support anything from here; see http://www.ctyme.com/intr/rb-1594.htm#Table511
+    Bct->BiosFeature[2] = 0x00;
+    Bct->BiosFeature[3] = 0x00;
+    Bct->BiosFeature[4] = 0x00;
+}
+
+static VOID InitializeBiosData(VOID)
+{
+    UCHAR Low, High;
+
+    /* Initialize the BDA contents */
+    Bda->EquipmentList = BIOS_EQUIPMENT_LIST;
+
+    /*
+     * Retrieve the conventional memory size
+     * in kB from CMOS, typically 640 kB.
+     */
+    IOWriteB(CMOS_ADDRESS_PORT, CMOS_REG_BASE_MEMORY_LOW);
+    Low  = IOReadB(CMOS_DATA_PORT);
+    IOWriteB(CMOS_ADDRESS_PORT, CMOS_REG_BASE_MEMORY_HIGH);
+    High = IOReadB(CMOS_DATA_PORT);
+    Bda->MemorySize = MAKEWORD(Low, High);
+}
+
 /* PUBLIC FUNCTIONS ***********************************************************/
 
 /*
@@ -344,7 +389,6 @@ static VOID InitializeBiosInt32(VOID)
 BOOLEAN Bios32Initialize(VOID)
 {
     BOOLEAN Success;
-    UCHAR Low, High;
 
     /* Initialize the stack */
     // That's what says IBM... (stack at 30:00FF going downwards)
@@ -356,18 +400,9 @@ BOOLEAN Bios32Initialize(VOID)
     /* Set data segment */
     setDS(BDA_SEGMENT);
 
-    /* Initialize the BDA contents */
-    Bda->EquipmentList = BIOS_EQUIPMENT_LIST;
-
-    /*
-     * Retrieve the conventional memory size
-     * in kB from CMOS, typically 640 kB.
-     */
-    IOWriteB(CMOS_ADDRESS_PORT, CMOS_REG_BASE_MEMORY_LOW);
-    Low  = IOReadB(CMOS_DATA_PORT);
-    IOWriteB(CMOS_ADDRESS_PORT, CMOS_REG_BASE_MEMORY_HIGH);
-    High = IOReadB(CMOS_DATA_PORT);
-    Bda->MemorySize = MAKEWORD(Low, High);
+    /* Initialize the BDA and the BIOS ROM Information */
+    InitializeBiosData();
+    InitializeBiosInfo();
 
     /* Register the BIOS 32-bit Interrupts */
     InitializeBiosInt32();