VDM Creation

A number of tasks are performed when a VDM is initialized. The four main tasks managed by the Virtual DOS Machine Manager are:

  • Task state segment (TSS) initialization

  • Virtual DOS machine process initialization

  • 8086 Emulation initialization

  • DOS Emulation initialization.

    Task State Segment Initialization

    The task state segment describes the current machine state, including CPU register contents, and the current software state of a task, such as file descriptors and priority information. The following steps are necessary to initialize the TSS:

    Figure "VDM Initialization"

  • The VM bit in EFLAGS is set to 1, indicating that the process is a virtual DOS machine.

  • The IOPL indicator in EFLAGS is set to 3

  • The instruction pointer is set to the task's entry point

  • The code segment (CS) register is set to the linear base address of the task's initial code segment

  • An LDT is not used in V86 mode, but one must be initialized since interrupt or exception routines might use an LDT

  • I/O access rights are defined in the I/O permission map.

    VDM Process Initialization

    The VDM process initialization is very similar to the creation of a protected mode session:

  • The Per-Task Data Area (PTDA) is created

  • A process slot and a process ID are allocated

  • The operating system's memory manager provides a 4MB linear address space

  • A 4MB global Page Directory Entry, which references the 4MB linear space, is created

  • The VDM process is started.

    8086 Emulation (V86) Initialization

    The 8086 Emulation initialization then proceeds as follows:

  • The 8086 Emulation code is loaded

  • VDM kernel data is allocated in per-VDM memory below 4MB

  • Virtual device driver instance data is allocated in per-VDM memory below 4MB

  • All known VDM creation hooks (registered by VDHInstallUserHook) are invoked to initialize virtual device drivers on a per-VDM basis

  • The VEMM (expanded memory) virtual device driver (if used) allocates a block of memory in a mappable window either between 640KB and 1MB or in the area between 256KB and RMSIZE (as specified in CONFIG.SYS), and maps it into the VDM address space.

    DOS Emulation Initialization

    The DOS Emulation initialization then proceeds as follows:

  • VDM-related kernel structures are initialized

  • DOS Emulation kernel (DOSKRNL) is loaded

  • Virtual processor mode is started

  • Standard file handles are opened

  • Virtual device driver and DOS device driver "stubs" are initialized

  • DOS device drivers are initialized

  • DOS shell is loaded and executed.

    DOS Emulation initialization and VDM creation are discussed in greater detail in MVDM DOS Emulation.

    Once DOS Emulation is complete, the Virtual DOS Machine Manager then issues the VDM_CREATE_DONE event handler to install default I/O hooks, page fault hooks, or INT hooks. Control is then passed to the DOS Emulation kernel to initialize and start the user application program.

    Once the VDM creation process is complete, the name of the DOS program and other customization parameters are passed to the new VDM. Customization parameters for a specific DOS application can be specified in the Workplace Shell folder in which the name of the DOS program is contained. To change these parameters select the DOS Settings pushbutton.

    DOS Settings allow the user to tune the VDM environment in which a DOS application runs in order to achieve optimal execution of the program.


    [Back: VDM Address Space Management]
    [Next: VDM Termination]