## Physical Device Driver Reference

[prev][next][parent][TOC]

### OS/2 Device Driver Execution Contexts

There are three contexts (modes) in which OS/2 device drivers operate:

Kernel Mode

The OS/2 kernel calls the physical device driver strategy routine for task- time operations; that is, it will execute as a thread within a process. The strategy routine will not be preempted by a task switch but can be interrupted by incoming hardware interrupts or page faults. Kernel mode is also referred to as task context.

Interrupt Mode

The OS/2 kernel calls the physical device driver interrupt-time components, the hardware interrupt handler, and the timer handler. Interrupt time is a generic term that refers to the execution of code as a result of an interrupt; the thread of execution does not belong to a process. The hardware interrupt handler and the timer handler do not execute code as a thread belonging to a thread-specific process. The thread of execution results from a hardware interrupt.

INIT Mode

The physical device driver INIT strategy routine is called only once at system startup time, with a request packet containing the INIT command. The initialization code runs at Ring 3 with I/O privilege. A limited set of system API calls are available for use, as well as a portion of the device helper (DevHlp) function calls. For more information, refer to Physical Device Driver Initialization.