## Virtual Device Driver Reference for OS/2

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

### Virtual Programmable Interrupt Controller Device Driver

The virtual PIC device driver (VPIC) is responsible for the virtualization of the 8259 Programmable Interrupt Controller (PIC) for multiple DOS sessions and for the simulation of interrupts to DOS sessions. Performance is a major requirement for hardware interrupt simulation. In this book, hardware interrupt and interrupt have the same meaning. Simulated interrupt , interrupt simulation, and hardware interrupt simulation all refer to the virtual PIC device driver sending an interrupt to a DOS session.

The virtual PIC device driver supports the hardware interrupt-related services needed by virtual device drivers and DOS sessions. The services include setting handlers to trap EOI and IRET events, simulating interrupts to DOS sessions, and handling PIC I/O accesses by DOS sessions. See Virtual Interrupt Services for a list of these virtual DevHlp services. The virtual PIC device driver maintains a per-DOS session virtual PIC state so that each DOS session appears to have its own independent 8259 Programmable Interrupt Controller. Provisions are included to demand page DOS sessions interrupt handling code. The virtual PIC device driver provides a DOS session with the following services:

Virtualization of the 8259 PIC ports:

-Separate master and slave PICs
-Mask and unmask IRQ commands
-Specific and nonspecific EOI commands
-Read IR and IS register commands

Hardware interrupts that can be be postponed until task time so that a DOS session can be paged

Interrupts from an optional hardware adapter, which does not have a virtual device driver and a physical device driver, that can be simulated to a DOS application

The virtual PIC device driver provides virtual device drivers with:

A high-performance mechanism to send hardware interrupts to DOS sessions:

-Support for more than one virtual device driver to share an interrupt level
-Support for a virtual device driver to regain control when a DOS session issues EOI commands, or when a DOS session executes the IRET at the end of the interrupt routine

A mechanism for virtual device drivers to send a virtual EOI to the virtual PIC device driver

A way to block until an interrupt is simulated

A mechanism to query a DOS session's virtual IRQ state or status:

-Masked or unmasked state (IMR)
-Waiting to be sent to a DOS session state (IRR)
-Executing DOS session's interrupt handler code state (ISR)
-Pending interrupt routine IRET state

Hardware interrupt simulation is closely tied to the PIC virtualization. Virtual device drivers need a fast mechanism to call a DOS session's real- mode interrupt handler for a hardware interrupt. Because paging of DOS sessions (and therefore DOS session interrupt handlers) is required, simulated interrupts are delayed until the task-time context of the target DOS session.