13.07.2015 Views

iAPX 286 Operating System Writers Guide 1983

iAPX 286 Operating System Writers Guide 1983

iAPX 286 Operating System Writers Guide 1983

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SIGNALS AND INTERRUPTSSTACK.. .---....... --: ,.HIGH!DIRECTIONOF GROWTHSP_CALLER'S SSCALLER'S SPPARAMETERRETURN CS I RPLRETURN IP-FIELDCALLER'S CPL IS STORED IN RPLOF RETURN ADDRESSCS SELECTOR..-:......""-LO:.v121960-36Figure 6-3. Interrupt Procedure's StackWhat is the difference between an interrupt via an interrupt gate and an interrupt via a trap gate? Inthe case of an interrupt gate, the processor automatically disables interrupts before transferring controlto the interrupt procedure; therefore, an interrupt gate is normally used with external interrupts. Inthe case of a trap gate, the processor does not disable interrupts; therefore, trap gates are normallyused with processor-detected exception conditions, which are also known as "traps."The IRET instruction returns control from an interrupt regardless of whether a task gate, interruptgate, or trap gate is used to enter the interrupt handler. In all cases, executing IRET restores IF to itsvalue before the interrupt. In the case of an interrupt procedure, the processor restores flags from thestack; in the case of an interrupt task, from the interrupted task's TSS.The difference in speed between handling an event by a task gate versus by an interrupt or trap gateis not great, as table 6-1 illustrates.OPERATING SYSTEM RESPONSIBILITIESGiven the number of hardware features thataut{)mate event handling, you might wonder what is leftfor the operating system to do. In fact, for static systems in which interrupt tasks do not call on operatingsystem. functions and in which there is no need to change the IDT, the operating system need notconcern itself with interrupts. Few applications are so simple, however. The following sections discusssome extensions to the processor's event-handling features that you may find useful in your operating6-4 121960-001

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!