gate_descriptor = IDTR.base + vector * 8; /* get gate descriptor */ if ((gate_descriptor + sizeof(DESCRIPTOR) - 1) > (IDTR.base + IDTR.limit)) { /* failure: #GP exception */ } |
DPLg = gate_descriptor.DPL; /* DPL of gate */ DPLs = code_descriptor.DPL; /* DPL of code segment */ if ((CPL <= DPLg) && (CPL >= CPLs)) { /* pass */ } else { /* failure: #GP exception */ } |
<bochs:2> info idt Interrupt Descriptor Table (base=0xfffff80004fea080, limit=4095): IDT[0x00]=64-Bit Interrupt Gate target=0x0010:fffff80003abac40, DPL=0 IDT[0x01]=64-Bit Interrupt Gate target=0x0010:fffff80003abad40, DPL=0 IDT[0x02]=64-Bit Interrupt Gate target=0x0010:fffff80003abaf00, DPL=0 IDT[0x03]=64-Bit Interrupt Gate target=0x0010:fffff80003abb280, DPL=3 IDT[0x04]=64-Bit Interrupt Gate target=0x0010:fffff80003abb380, DPL=3 IDT[0x05]=64-Bit Interrupt Gate target=0x0010:fffff80003abb480, DPL=0 ... ... IDT[0x29]=64-Bit Interrupt Gate target=0x0010:fffff80003bf2290, DPL=0 IDT[0x2a]=64-Bit Interrupt Gate target=0x0010:fffff80003bf22a0, DPL=0 IDT[0x2b]=64-Bit Interrupt Gate target=0x0010:fffff80003bf22b0, DPL=0 IDT[0x2c]=64-Bit Interrupt Gate target=0x0010:fffff80003abca00, DPL=3 IDT[0x2d]=64-Bit Interrupt Gate target=0x0010:fffff80003abcb00, DPL=3 IDT[0x2e]=64-Bit Interrupt Gate target=0x0010:fffff80003bf22e0, DPL=0 IDT[0x2f]=64-Bit Interrupt Gate target=0x0010:fffff80003b09590, DPL=0 IDT[0x30]=64-Bit Interrupt Gate target=0x0010:fffff80003bf2300, DPL=0 |
*(--esp) = eflags; /* push eflags */ if (gate_descriptor.type == INTERRUPT_GATE) eflags.IF = 0; /* clear eflags.IF */ |
if (gate_descriptor.selector.TI == 0) code_descriptor = GDTR.base + gate_descriptor.selector * 8; /* GDT */ else code_descriptor = LDTR.base + gate_descriptor.selector * 8; /* LDT */ interrupt_handler = code_descriptor.base + gate_descriptor.offset; /* interrupt handler entry */ |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |