Implement EMS function AH = 59h (Get Expanded Memory Hardware Information).


svn path=/trunk/; revision=67585
This commit is contained in:
Aleksandar Andrejevic 2015-05-06 23:06:28 +00:00
parent f619a2d270
commit 93e6fa1b01
2 changed files with 39 additions and 0 deletions

View file

@ -361,6 +361,36 @@ static VOID WINAPI EmsIntHandler(LPWORD Stack)
break;
}
/* Get Expanded Memory Hardware Information */
case 0x59:
{
if (getAL() == 0x00)
{
PEMS_HARDWARE_INFO HardwareInfo = (PEMS_HARDWARE_INFO)SEG_OFF_TO_PTR(getES(), getDI());
/* Return the hardware information */
HardwareInfo->RawPageSize = EMS_PAGE_SIZE >> 4;
HardwareInfo->AlternateRegSets = 0;
HardwareInfo->ContextAreaSize = sizeof(Mapping);
HardwareInfo->DmaRegisterSets = 0;
HardwareInfo->DmaChannelOperation = 0;
}
else if (getAL() == 0x01)
{
/* Same as function AH = 42h */
setAH(EMS_STATUS_OK);
setBX(RtlNumberOfClearBits(&AllocBitmap));
setDX(EmsTotalPages);
}
else
{
DPRINT1("Invalid subfunction %02X for EMS function AH = 59h\n", getAL());
setAH(EMS_STATUS_UNKNOWN_FUNCTION);
}
break;
}
default:
{
DPRINT1("EMS function AH = %02X NOT IMPLEMENTED\n", getAH());

View file

@ -58,6 +58,15 @@ typedef struct _EMS_COPY_DATA
USHORT DestSegment;
} EMS_COPY_DATA, *PEMS_COPY_DATA;
typedef struct _EMS_HARDWARE_INFO
{
WORD RawPageSize;
WORD AlternateRegSets;
WORD ContextAreaSize;
WORD DmaRegisterSets;
WORD DmaChannelOperation;
} EMS_HARDWARE_INFO, *PEMS_HARDWARE_INFO;
#pragma pack(pop)
#endif