[NTVDM]: Move EMS support as a BIOS module (and initialize it after the BIOS has finished its initialization, including resetting the INT handlers).

svn path=/trunk/; revision=66675
This commit is contained in:
Hermès Bélusca-Maïto 2015-03-14 03:37:54 +00:00
parent 6928fadeff
commit 9606bcd3f2
5 changed files with 16 additions and 6 deletions

View 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

View 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();

View 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:
{

View 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

View 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();