DOS memory Question..... or How to increase base memory for DOS apps

Christian Costa titan.costa at
Wed May 29 17:22:39 CDT 2002


Many DOS apps needs a lot of base memory even if EMS or XMS memory are used.

The first 64K of memory being lock to catch null pointer, the DOS memory 
must start
at 0x10000 as you can see in the code below (msdos/dosmem.c) :

 *           DOSMEM_InfoBlock
 * Gets the DOS memory info block.
static dosmem_info *DOSMEM_InfoBlock(void)
    return (dosmem_info*)(DOSMEM_dosmem+0x10000); /* 64K */

 *           DOSMEM_InitMemory
 * Initialises the DOS memory structures.
static void DOSMEM_InitMemory(void)
   /* Low 64Kb are reserved for DOS/BIOS so the useable area starts at
    * 1000:0000 and ends at 9FFF:FFEF. */

Changing this value to the end of the BIOS DATA area (0x500) does the 
job and things work
as expected (at least for DOS apps).
But I was told that this causes problems for others apps.
Probably for Win16 ones that use DOS3CALL and not int21h via DPMI.

If it's true, a solution could be to initialize DOS memory differently 
for pure DOS apps
by modifying the DOSMEM_Init function.

DOSMEM_Init is called at 3 different places :
- process_attach in dlls/kernel/kernel_main.c
- DOSVM_Init in dlls/winedos/dosvm.c
- MZ_InitMemory in dlls/winedos.dosvm.c

and acts differently the first and second calls.

Since I don't know wine internals enough and the "flow of execution", I 
have no idea how
to do it in a clean way that do not break everything.

If someone can help me or give me hints?


More information about the wine-devel mailing list