Windows 98 Memory Allocation for TSR Programs
Microsoft Windows 98 managed memory allocation for Terminate and Stay Resident (TSR) programs through a hybrid architecture combining real-mode MS-DOS compatibility with 32-bit protected-mode virtualization. Depending on whether a TSR was initialized prior to the graphical environment loading or executed within a virtualized command prompt, the operating system allocated space within the base 640 KB conventional memory, Upper Memory Blocks (UMBs), or isolated Virtual 8086 mode environments managed by the Virtual Machine Manager (VMM).
Real-Mode Execution and Global TSRs
When a TSR program was executed prior to the Windows 98 graphical
shell—typically through legacy CONFIG.SYS or
AUTOEXEC.BAT configuration files—it operated in 16-bit real
mode. During this phase, memory allocation was handled directly by
MS-DOS 7.1:
- Conventional Memory: By default, TSRs loaded into the first 640 kilobytes (KB) of RAM, reducing the remaining memory available for subsequent DOS executables.
- Upper Memory Blocks (UMBs): Utilizing the
HIMEM.SYSextended memory driver and theEMM386.EXEexpanded memory manager, users could load TSRs into the Upper Memory Area (between 640 KB and 1024 KB) using theDEVICEHIGHorLOADHIGHcommands.
When Windows 98 completed its initialization and entered protected mode, any TSR already resident in memory became a "global TSR." The operating system's Virtual Machine Manager mapped these global TSR memory footprints into the address space of every subsequent DOS session created within the system.
Virtual 8086 Mode and Local TSRs
For TSR programs executed after Windows 98 had fully loaded, the operating system handled allocation through Virtual 8086 (V86) mode, a hardware capability of the x86 processor:
- Virtual Machine Isolation: Launching an MS-DOS prompt created a discrete Virtual DOS Machine (VDM). A TSR launched inside this session was allocated conventional or upper memory strictly within that specific VDM's local memory map.
- Local Memory Persistence: The local TSR hooked interrupts and persisted within the boundaries of its assigned VDM. Once the user closed the DOS window, Windows 98 reclaimed the entire virtual memory block assigned to that VM, effectively unloading the TSR and eliminating memory leaks.
Virtualization via 32-Bit Protected-Mode Drivers
To reduce the memory constraints caused by real-mode TSRs, Windows 98 actively replaced common TSR functions with 32-bit protected-mode Virtual Device Drivers (VxDs).
When Windows 98 detected standard legacy TSRs—such as CD-ROM
extensions (MSCDEX.EXE), disk caches
(SMARTDRV.EXE), or mouse drivers—it often bypassed or
unloaded their real-mode hooks in favor of native 32-bit protected-mode
equivalents. These native drivers operated above the 1 MB address
boundary, freeing valuable conventional memory within the lower 640 KB
range for legacy applications that strictly required it.