3 ms·
To be honest, I remember something different. Dos was originally a single process OS. So memory was allocated like a stack, at least for a .COM. Some detail:
by hyperman1 6y ago
To be honest, I remember something different. Dos was originally a single process OS. So memory was allocated like a stack, at least for a .COM.
Some detail:All memory above your starting address is yours. You call int 12 to find out how much base memory is installed, which in later computers was either 640K or 639K if the bios wanted a bit or storage.
If you want to start another program, you first resize your part of the memory with INT 21 (ah=4D? Its too long ago, don't quote me on this)
Later, there came TSRs, EMS/UMBs/high memory/... to muck this scheme up.
A TSR was not allowed to allocate memory after it terminated, exactly because it runs code in another process while it should have been terminated. It had to always stay under all other programs, memory address wise.
It was not allowed to do much, in fact, because DOS was not reentrant, and running int21h while running int21h had a good chance of making DOS overwrite its own variables.
- hyperman1 6y agoUPDATE: It was quite hard to find reference information about all this. I vaguely remember reading it in one of the Peter Norton books at the time, but I can't really find them. The most relevant thing I can still find on todays internet is this: https://www.pcjs.org/documents/books/mspl13/msdos/advdos/ https://www.pcjs.org/documents/books/mspl13/msdos/advdos/ chapter 3: ... the operating system simply makes the worst-case assumption and gives .COM programs everything that is available. If a .COM program wants to use the EXEC function to invoke another process, it must first shrink down its memory allocation ...