4 ms·
Not quite true. DOS programs were not automatically given all memory. DOS programs needed to allocate various memories (Conventional, EMS, XMS memory) via API
by oso2k 5y ago
Not quite true. DOS programs were not automatically given all memory. DOS programs needed to allocate various memories (Conventional, EMS, XMS memory) via API specific to each type. DOS programs running under Windows 95 and later were presented with a DPMI compatible API if they so choose to use. DPMI DOS Extenders were intended to provide DOS compatibility for 16-bit and 32-bit Protected Mode applications. Memory allocation was just one service type they provided. Some also provided virtual memory or Win32 API emulation.
https://fd.lod.bz/rbil/interrup/dos_kernel/2148.html#sect-2974 https://fd.lod.bz/rbil/interrup/dos_kernel/2148.html#sect-29...
https://fd.lod.bz/rbil/interrup/memory/2f4310.html#sect-4815 https://fd.lod.bz/rbil/interrup/memory/2f4310.html#sect-4815
https://fd.lod.bz/rbil/interrup/memory/673f_cx5145.html#sect-7463 https://fd.lod.bz/rbil/interrup/memory/673f_cx5145.html#sect...
https://en.wikipedia.org/wiki/DOS_extender#DOS_extenders https://en.wikipedia.org/wiki/DOS_extender#DOS_extenders
https://en.m.wikipedia.org/wiki/CWSDPMI https://en.m.wikipedia.org/wiki/CWSDPMI
https://www.japheth.de/HX.html https://www.japheth.de/HX.html
- dfox 5y agoIn real-mode DOS the situation is that the program is loaded to continuous block of memory that is followed by it's BSS and heap. The MZ header only specifies how big the BSS+heap part should be. Typical MZ format EXE has the size specified as BSS size by minimum and no maximum, which causes the MZ loader to allocate everything from PSP to the end of present conventional memory to the process. One consequence of that is that if you want to run other programs you have to either change the usual default of "unlimited" heap size or free some memory manually (or use COM format executable which by default only gets one DS=CS=SS segment).