Interrupt Descriptor Table: Difference between revisions

m
Changed tables as with GDT
[unchecked revision][unchecked revision]
m (Changed tables as with GDT)
Line 9:
The location of the '''IDT''' is kept in the '''IDTR''' ('''IDT''' register). This is loaded using the '''LIDT''' assembly instruction, whose argument is an '''IDTR''':
 
{| class="wikitable" style="border-width: 3px; width: 720px"
|+style="text-align: left;"|'''IDT DESCRIPTORDescriptor (IDTR):'''
!style="width: 66%; text-align: left;" |79 (64-bit Mode)<br>48 (32-bit Mode)&nbsp;&nbsp;&nbsp;<span style="float: right;">16</span>
!style="width: 34%; text-align: left; vertical-align: bottom;" |15&nbsp;&nbsp;&nbsp;<span style="float: right;">0</span>
|-
|'''Offset'''<br>63 (64-bit Mode)<br>31 (32-bit Mode)&nbsp;&nbsp;&nbsp;<span style="float: right;">0</span>
|style="padding: 2px; width: 461px; text-align: left ; border-left: 1px ; border-right: none;" |79 (64-bit Mode) / 48 (32-bit Mode)
|'''Size'''<br><br>15&nbsp;&nbsp;&nbsp;<span style="float: right;">0</span>
|style="padding: 2px; width: 10px; text-align: right; border-left: none; border-right: 1px ;" |16
|style="padding: 2px; width: 221px; text-align: left ; border-left: 1px ; border-right: none;" |15
|style="padding: 2px; width: 11px; text-align: right; border-left: none; border-right: 1px ;" |0
|-
|style="padding: 2px; width: 461px; text-align: left ; border-left: 1px ; border-right: none;" |'''Offset'''<br>63 (64-bit Mode) / 31 (32-bit Mode)
|style="padding: 2px; width: 10px; text-align: right; border-left: none; border-right: 1px ;" |<br>0
|style="padding: 2px; width: 221px; text-align: left ; border-left: 1px ; border-right: none;" |'''Size'''<br>15
|style="padding: 2px; width: 11px; text-align: right; border-left: none; border-right: 1px ;" |<br>0
|}
 
Line 42 ⟶ 37:
On 32-bit processors, the entries in the '''IDT''' are 8 bytes long and form a table like this:
 
{|class="wikitable"
<pre>
|+Interrupt Descriptor Table (32-bit)
Table: Address:
! Address !! Content
┏━━━━━━━━━━━┓
|-
┃ Entry 0 ┃ IDTR Offset + 0
| IDTR Offset + 0 || Entry 0
┠───────────┨
|-
┃ Entry 1 ┃ IDTR Offset + 8
| IDTR Offset + 8 || Entry 1
┠───────────┨
|-
┃ Entry 2 ┃ IDTR Offset + 16
| IDTR Offset + 16 || Entry 2
┠───────────┨
|- style="text-align: center;"
┃ ... ┃ ...
| '''...''' || '''...'''
┠───────────┨
|-
┃ Entry 255 ┃ IDTR Offset + 2040
| IDTR Offset + 2040 || Entry 255
┗━━━━━━━━━━━┛
|}
</pre>
 
The corresponding entry for a given '''Interrupt Vector''' is pointed to in memory by scaling the vector by 8 and adding it to the value in the '''Offset''' field of the '''IDTR'''.
Line 139 ⟶ 134:
On 64-bit processors, the entries in the '''IDT''' are 16 bytes long and form a table like this:
 
{|class="wikitable"
<pre>
|+Interrupt Descriptor Table (64-bit)
Table: Address:
! Address !! Content
┏━━━━━━━━━━━┓
|-
┃ Entry 0 ┃ IDTR Offset + 0
| IDTR Offset + 0 || Entry 0
┠───────────┨
|-
┃ Entry 1 ┃ IDTR Offset + 16
| IDTR Offset + 16 || Entry 1
┠───────────┨
|-
┃ Entry 2 ┃ IDTR Offset + 32
| IDTR Offset + 32 || Entry 2
┠───────────┨
|- style="text-align: center;"
┃ ... ┃ ...
| '''...''' || '''...'''
┠───────────┨
|-
┃ Entry 255 ┃ IDTR Offset + 4080
| IDTR Offset + 4080 || Entry 255
┗━━━━━━━━━━━┛
|}
</pre>
 
The corresponding entry for a given '''Interrupt Vector''' is pointed to in memory by scaling the vector by 16 and adding it to the value in the '''Offset''' field of the '''IDTR'''.