Interrupt Descriptor Table: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
WIP
No edit summary
Line 23:
 
<tt>type_attr</tt> is specified here:
Bit: 7 . 5 . 4 4 . . . 0
+----------+ +-------------+
|Pr Priv| S| | GateType |
+----------+ +-------------+
 
The bit fields of Flags are:
 
* '''Pr:''': Present bit. This must be set to '''1''' for all valid gate descriptors.
* '''Priv:''': Privilege, 2 bits. Contains the ring level, 0 = highest (kernel), 3 = lowest (user applications).
* '''S''': System segment bit.
 
 
'''GateType''' determines the type of gate.
Line 65:
 
 
Trap and Interrupt gates are similar, and their descriptors are structurally the same, they differ only in the "type" field. The difference is that *for interrupt gates, interrupts are automatically disabled upon entry* and reenabled upon IRET which restores the saved EFLAGS.
 
Choosing type_attr values: (See [[Descriptors#type_attr]])
* P=1 (descriptor present, if you'll be using it)
* S=0 (system segment)
* DPL (if you're not using protection, set to 0, otherwise FIXME)
* type
** 1110b=0xE (32-bit interrupt gate)
Line 76 ⟶ 73:
** 0110b=0x6 (16-bit interrupt gate)
** 0111b=0x7 (16-bit trap gate)
 
 
Here are some pre-cooked type_attr values people are likely to use (assuming DPL=0):
Line 99 ⟶ 95:
 
Choosing type_attr values: (See [[Descriptors#type_attr]])
* P=1 (descriptor present, if you'll be using it)
* S=0 (system segment)
* DPL (if you're not using protection, set to 0, otherwise FIXME)
* type=0b0101=0x5 (task gate)