Linkage Modification

Refer to Figure 11-6 on page 203. Assume that task A called task B, and task B called task C. If an IRET instruction is executed at the end of task C, a task switch back to task B will result (using the TSS selector stored in task C's Link field). Now assume that the programmer wants the IRET instruction at the end of task C to cause a task switch to task A, rather than to task B. This should be accomplished in the following manner:

  1. Disable interrupts by executing a CLI instruction.

  2. Replace the task C Link field (which currently contains the GDT selector for the task B TSS descriptor) with the selector for task A's TSS descriptor.

  3. Clear the Busy bit in task B's TSS descriptor.

  4. Reenable interrupt recognition with an STI instruction. ...

Get The Unabridged Pentium 4 IA32 Processor Genealogy now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.