[NTVDM][FAST486]
[reactos.git] / reactos / subsystems / mvdm / ntvdm / bios / bios.c
index 7b6d038..78f78c1 100644 (file)
@@ -11,6 +11,7 @@
 #define NDEBUG
 
 #include "emulator.h"
+#include "memory.h"
 #include "cpu/callback.h"
 #include "cpu/bop.h"
 
@@ -40,6 +41,12 @@ PBIOS_CONFIG_TABLE Bct;
 
 /* PRIVATE FUNCTIONS **********************************************************/
 
+static BOOLEAN NTAPI BiosRomWrite(ULONG Address, PVOID Buffer, ULONG Size)
+{
+    /* Prevent writing to ROM */
+    return FALSE;
+}
+
 /* PUBLIC FUNCTIONS ***********************************************************/
 
 VOID WINAPI BiosEquipmentService(LPWORD Stack)
@@ -74,6 +81,11 @@ BiosInitialize(IN LPCSTR BiosFileName)
     // RegisterBop(BOP_EQUIPLIST , BiosEquipmentService);
     // RegisterBop(BOP_GETMEMSIZE, BiosGetMemorySize);
 
+    MemInstallFastMemoryHook((PVOID)ROM_AREA_START,
+                             ROM_AREA_END - ROM_AREA_START + 1,
+                             NULL,
+                             BiosRomWrite);
+
     if (BiosFileName && BiosFileName[0] != '\0')
     {
         PVOID BiosLocation = NULL;