DOS/32 Advanced DOS Extender - Technical Reference



4.0 - DOS/32 Advanced - Exit to DOS

When your protected program issues an INT 21h / AH=4Ch (DOS API "Terminate Program" function) or when DOS/32 Advanced detects a run-time error in your program, the program will be terminated and the DOS Extender will return to the operating system from which it was started performing a cleanup which involves extended memory deallocation, restoring of real mode interrupts and so on.

The DOS Extender will check if any of the real mode interrupts were modified and not restored (if configured to do so), restore the whole real mode interrupt table and the both PICs (if configured to do so) and free Mouse callback (if allocated) also resetting a possibly installed mouse ISR by issuing INT 33h / AX=000Ch and ES:EDX=0. At this point the DOS Extender will jump to the default protected mode INT 21h handler, ie to the built-in DPMI when running under Clean, XMS or VCPI, and to an external DPMI host when running under DPMI (only GOD knows what will happen then).

The built-in DPMI will then deallocate all allocated extended memory and unconditionally restore certain system interrupts and the CR0 register. The CR2 register will be set to zero and the CR3 register will be reloaded to flush the TLB.

The following real mode interrupts will be unconditionally restored:

INT 1Bh (CTRL-BREAK)
INT 1Ch (Timer ticks)
INT 21h (DOS API)
INT 23h (CTRL-C)
INT 24h (Critical handler)
INT 2Fh (Multiplex)

The state of A20 gate will be restored when running under XMS, and left enabled when running under Clean system.

The built-in DPMI will then switch to the real mode and reissue INT 21h / AH=4Ch terminating the program completely. Note, the PIT (timer) will not be reset.

 


Copyright Supernar Systems, Ltd. 1996-2005
All Rights Reserved.