24.2 I/O Trapping Services and Macros

The VMM provides the Install_IO_Handler service to install a callback procedure to handle protection faults for a given port. When a virtual device calls Install_IO_Handler, the VMM sets the appropriate bit in the I/O permission map (IOPM) and registers the procedure. When a virtual machine executes an instruction that reads or writes data from an I/O port, the 80386 looks up the port number in the I/O permission map. If the corresponding bit in the IOPM is set, then the instruction will cause a protection fault that results in calling the registered procedure.

There are the following I/O services:

Service Description

Disable_Global_Trapping Disables global I/O trapping.
Disable_Local_Trapping Disables local I/O trapping.
Enable_Global_Trapping Enables global I/O trapping.
Enable_Local_Trapping Enables local I/O trapping.
Install_IO_Handler Install an I/O callback procedure.
Install_Mult_IO_Handlers Install I/O handlers for multiple ports.
Simulate_IO Simulates input and output.