⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s07_04.htm

📁 Programmer s Reference Manual is an improtant book on Intel processor architecture and programming.
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><HTML><HEAD><TITLE>80386 Programmer's Reference Manual -- Section 7.4</TITLE></HEAD><BODY><B>up:</B> <A HREF="c07.htm">Chapter 7 -- Multitasking</A><BR><B>prev:</B> <A HREF="s07_03.htm">7.3  Task Register</A><BR><B>next:</B> <A HREF="s07_05.htm">7.5  Task Switching</A><P><HR><P><H1>7.4  Task Gate Descriptor</H1>A task gate descriptor provides an indirect, protected reference to a TSS.<A HREF="#fig7-4">Figure 7-4</A>  illustrates the format of a task gate.<P>The SELECTOR field of a task gate must refer to a TSS descriptor. The valueof the RPL in this selector is not used by the processor.<P>The DPL field of a task gate controls the right to use the descriptor tocause a task switch. A procedure may not select a task gate descriptorunless the maximum of the selector's RPL and the CPL of the procedure isnumerically less than or equal to the DPL of the descriptor. This constraintprevents untrusted procedures from causing a task switch. (Note that when atask gate is used, the DPL of the target TSS descriptor is not used forprivilege checking.)<P>A procedure that has access to a task gate has the power to cause a taskswitch, just as a procedure that has access to a TSS descriptor. The 80386has task gates in addition to TSS descriptors to satisfy three needs:<OL><LI> The need for a task to have a single busy bit. Because the busy-bitis stored in the TSS descriptor, each task should have only one suchdescriptor. There may, however, be several task gates that select thesingle TSS descriptor.<LI> The need to provide selective access to tasks. Task gates fulfillthis need, because they can reside in LDTs and can have a DPL that isdifferent from the TSS descriptor's DPL. A procedure that does nothave sufficient privilege to use the TSS descriptor in the GDT (whichusually has a DPL of 0) can still switch to another task if it hasaccess to a task gate for that task in its LDT. With task gates,systems software can limit the right to cause task switches tospecific tasks.<LI> The need for an interrupt or exception to cause a task switch. Taskgates may also reside in the IDT, making it possible for interruptsand exceptions to cause task switching. When interrupt or exceptionvectors to an IDT entry that contains a task gate, the 80386 switchesto the indicated task. Thus, all tasks in the system can benefit fromthe protection afforded by isolation from interrupt tasks.</OL><A HREF="#fig7-5">Figure 7-5</A>  illustrates how both a task gate in an LDT and a task gate inthe IDT can identify the same task.<P><A NAME="fig7-4"><IMG align=center SRC="fig7-4.gif" border=0><HR><A NAME="fig7-5"><IMG align=center SRC="fig7-5.gif" border=0><P><HR><P><B>up:</B> <A HREF="c07.htm">Chapter 7 -- Multitasking</A><BR><B>prev:</B> <A HREF="s07_03.htm">7.3  Task Register</A><BR><B>next:</B> <A HREF="s07_05.htm">7.5  Task Switching</A></BODY>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -