Abnormal Termination

Virtual device drivers may experience a number of different error conditions, and must be able to act in order to recover from such errors where possible.

Errors Returned from VDH Services

Requests for VDH services may be refused by the operating system or may fail due to lack of resources. For example, a call to VDHAllocMem() may return 0, indicating that the memory allocation request cannot be satisfied.

During initialization of the virtual device driver or creation of a VDM such an error would cause the initialization or creation to be terminated. During execution of a DOS application, the virtual device driver should return control to the application, indicating the failure of the requested application service. If this cannot be done, the VDM must be terminated.

Bad Parameter Passed to VDH Service

A virtual device driver may make a service request with bad data, typically due to a bug in the device driver code; such events are likely during development and testing. For example, the virtual device driver may attempt to issue a VDHFreeMem() function call specifying an address which was not previously allocated using VDHAllocMem().

Such errors are costly; since virtual device drivers operate at privilege level 0 and hence have access to all code and data in the system, it is impossible to localize the effect to a single VDM, or to be certain that the event has not corrupted data or control structures in the operating system kernel. In such cases, the Virtual DOS Machine Manager will halt the system.

Virtual Device Driver Consistency Failures

A virtual device driver may detect inconsistencies within its own state information. Such inconsistencies may be experienced in either global or instance state data. The virtual device driver must inform the user of the error. If the error can be isolated to the instance data of a single VDM, that VDM must be terminated. If the error is in global state data, it will be necessary to halt the system.

Note that halting the entire system is highly unfriendly behavior on the part of a virtual device driver. Very rarely, if ever, should such action become necessary. A virtual device driver should take all possible steps to isolate any state inconsistencies to a single VDM only.

Illegal Operation by a DOS Application

DOS applications running in VDMs may issue illegal instructions. For example, a DOS application may issue an OUT instruction to a port controlled by the virtual disk device driver, which does not support direct hardware control of the disk controller.

In such cases, the virtual device driver must inform the user of the error condition and either ignore the error or terminate the VDM and the application within it.


[Back: Normal Termination]
[Next: Summary]