DOS Software Interrupt Handling

Upon creation of a VDM, the IOPL field in the EFLAGS register within the VDM process's task state segment is set to 3. This has two major effects:

  • It allows the VDM to access the interrupt enable flag (IF), thus permitting compatibility with DOS applications which temporarily disable interrupts while performing critical operations.

  • It means that an interrupt issued from a VDM does not necessarily cause a general protection exception; certain interrupt handlers may execute at privilege level 3 within the VDM.

    If the VDM process is running with IOPL < 3, every interrupt causes a general protection exception; in such cases the operating system would need to virtualize the interrupt at all times, and to emulate all IOPL-sensitive instructions (CLI, STI, LOCK, PUSHF, POPF, INT n, and IRET). This would result in increased mode switching (between V86 and protected mode) and higher interrupt latency, and would therefore reduce performance.

    Thus, under OS/2 Version 2.0, a VDM runs with IOPL=3 for maximum performance. Interrupts are virtualized and, where possible, handled within the V86 mode task.


    [Back: Virtual 8086 Mode]
    [Next: Virtualizing Interrupts]