Author: hbelusca Date: Wed Sep 23 01:45:18 2015 New Revision: 69323
URL: http://svn.reactos.org/svn/reactos?rev=69323&view=rev Log: [NTVDM] - Do not hardcode the number of XMS memory blocks that can map the HMA. It should be function of the MAX_ADDRESS value of our emulator. - Require that MAX_ADDRESS should be greater or equal than 1 MB.
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/himem.h trunk/reactos/subsystems/mvdm/ntvdm/emulator.h
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/himem.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/d... ============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/himem.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/himem.h [iso-8859-1] Wed Sep 23 01:45:18 2015 @@ -13,8 +13,8 @@ /* DEFINITIONS ****************************************************************/
#define XMS_ADDRESS 0x110000 // Just above HMA -#define XMS_BLOCKS 0x3BC0 // XMS_ADDRESS + (XMS_BLOCKS * XMS_BLOCK_SIZE) == 16 MB #define XMS_BLOCK_SIZE 1024 +#define XMS_BLOCKS ((MAX_ADDRESS - XMS_ADDRESS) / XMS_BLOCK_SIZE) #define XMS_MAX_HANDLES 16 // Specification: min 1, max 128, default 32
#define XMS_STATUS_SUCCESS 0x00
Modified: trunk/reactos/subsystems/mvdm/ntvdm/emulator.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/emula... ============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/emulator.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/emulator.h [iso-8859-1] Wed Sep 23 01:45:18 2015 @@ -23,6 +23,7 @@ #define MAX_SEGMENT 0xFFFF #define MAX_OFFSET 0xFFFF #define MAX_ADDRESS 0x1000000 // 16 MB of RAM; see also: kernel32/client/vdm.c!BaseGetVdmConfigInfo +C_ASSERT(0x100000 <= MAX_ADDRESS); // A minimum of 1 MB is required for PC emulation.
#define SEG_OFF_TO_PTR(seg, off) \ (PVOID)((ULONG_PTR)BaseAddress + TO_LINEAR((seg), (off)))