A page fault exception may occur in a VDM where a particular page in real memory has been swapped to disk. When a page fault occurs for a linear region which has been initialized as an alias by a virtual device driver, the exception is routed to an exception handler, which has been registered previously by the virtual device driver for the linear address region in which the page fault occurred. The exception handler may cause the page to be loaded or may allow the memory reference to default into a temporary data page, several of which are provided by the MVDM kernel at initialization time.
Exception handlers are registered by virtual device drivers at initialization time using the VDHInstallFaultHook() helper function. If no exception handler is registered for the linear region in which the page fault occurred, the page is mapped to temporary data pages in memory.
The start address and size of each aliased region, and the exception handler address for each aliased region, is kept in a table, which is set up via the VDHInstallFaultHook() helper service. When a page fault occurs in the VDM address space, this table is searched for a matching region, and the exception handler for that address is called. The page address and the type of fault which occurred are passed to the exception handler.