56 lines
2.5 KiB
HTML
56 lines
2.5 KiB
HTML
|
|
|
|
The programmable interrupt controllers are mapped by the DPMI host to
|
|
the system's default interrupt assignments. On an IBM AT-compatible
|
|
system, for example, the master interrupt controller (IRQ0 through
|
|
IRQ7) is programmed to use a base interrupt level of 8 and the slave
|
|
controller (IRQ8 through IRQ15) uses a base interrupt level of 70H.<p>
|
|
|
|
All of the code and data that may be touched by hardware interrupt
|
|
handlers must reside in locked memory to avoid page faults at
|
|
interrupt time. The handler will always be called on a locked stack.
|
|
As in real mode, hardware interrupt handlers are called with virtual
|
|
interrupts disabled and the trace flag reset. In systems where the
|
|
CPU's interrupt flag is virtualized, <tt>IRET</tt> may not restore the
|
|
interrupt flag. Therefore, clients should execute a <tt>STI</tt>
|
|
before executing <tt>IRET</tt> or else interrupts will remain
|
|
disabled. <p>
|
|
|
|
Protected mode hardware interrupt handlers that call a real mode
|
|
routine must either ensure that the real mode code will not modify
|
|
segment registers or user the DPMI state save/restore services (see
|
|
page 94). However, any interrupt handler that executes completely in
|
|
protected mode, or uses the translation services (<a
|
|
href="api/310300.html">Int 31H Functions 0300H</a>, <a
|
|
href="api/310301.html">0301H</a>, or <a
|
|
href="api/310302.html">0302H</a>), does not need to save the real mode
|
|
register state. <p>
|
|
|
|
Personal computers with two programmable interrupt controllers usually
|
|
have a BIOS that redirects one of the interrupts from the slave
|
|
controller into the range of the master controller for compatibility
|
|
with older, 8086/88-based systems. For example, devices jumpered for
|
|
IRQ2 on PC/AT-compatible computers actually interrupt on IRQ 9 (Int
|
|
71H), but the BIOS on these systems converts Int 71H to Int 0AH yet
|
|
sends the EOI command (appropriately) to the slave controller. A
|
|
protected mode client that needs access to the redirected interrupt
|
|
might use a variation on one of the following techniques:
|
|
|
|
<ul>
|
|
|
|
<li> Install only a real mode handler for the target interrupt, taking
|
|
advantage of the built-in redirection. This method is robust on
|
|
systems where other software has reprogrammed the interrupt
|
|
controllers, or where the slave interrupt controller may be
|
|
absent. <p>
|
|
|
|
<li> Install both real mode and protected mode handlers for the target
|
|
interrupt. In such cases, the program must send the EOI command to
|
|
both the slave and master interrupt controllers since the BIOS is
|
|
never called. This method is more efficient in that there are not any
|
|
unnecessary switches to real mode. <p>
|
|
|
|
</ul>
|
|
|
|
|