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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SIGNALS AND INTERRUPTSSend interrupt ma5kto PICRETReturn to appllcatlon procedureEHDPThe operating system executes the IRET instruction within W AIT_FOR_INTERRUPT.WAIT_FOlLINTERRUPT would need to run as a privileged procedure within the calling task. Withthis approach, the operating system has control just before the task begins to wait for an interrupt aswell as when the task begins to execute after the interrupt occurs. The operating system then has theopportunity to send interrupt masks, end-of-interrupt commands, and specific priority rotationcommands, as appropriate for the application.Provide Task-Level Interrupt ProceduresGDT interrupt procedures (i.e., those invoked via interrupt gates and trap gates in the IDT that pointto executable-segment descriptors in the GDT) provide a .global mechanism for a task to' react toevents. The mechanism is global in the sense that one set of interrupt procedures applies to all of thetasks in the system. For example, suppose a GDT interrupt procedure handles the "divide error" exception.Then, a divide error in task A is handled by the same procedure as a divide error in task B becausethere is just one gate for divide errors. There is often a need, however, for one task to take differentaction than that taken by other tasks. For example, task A may need to terminate in case of a divideerror, while task B may need to continue.INTERRUPT DISTRIBUTIONThe software system designer has a choice of mechanisms that make it possible for different tasks tohave different interrupt procedures for a given interrupt type1. LDT-based interrupt procedures2.. An interrupt distributorYou must deploy alternative 1 carefully. If a trap or interrupt gate in the IDT contains a selector foran LDT slot, then there must be a system-wide convention that every LDT will have an appropriatedescriptor in that slot. When the interrupt occurs, the processor uses the LDT of the current task tolocate the interrupt procedure.Alternative 2 demands less from convention, but more from the operating system and the processor.With this approach, each task has (in the task database) a table that is its own private analog of theIDT. The operating system supplies aGDT interrupt procedure that merely indexes the current task'shandler table to find a pointer to the appropriate handler procedure. If the task does not supply aninterrupt procedure for a specific interrupt, the operating system can invoke a default procedure.CONFORMING INTERRUPT PROCEDURESFor certain interrupt procedures (for example, a divide-error exception handler that substitutes a fixedvalue for the quotient), the appropriate privilege level at which to run the interrupt procedure is thesame as that of the interrupted procedure. In these cases, the interrupt procedure can be placed in aconforming segment. For interrupt procedures in conforming segments, the processor automaticallysets CPL to the DPL of till: segment containing the interrupted procedure. Note, however, that this6-7 121960-001

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

Saved successfully!

Ooh no, something went wrong!