Interrupt Vector Table: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
No edit summary
No edit summary
Line 1: Line 1:
On the [[x86]] architecture, the '''Interupt Vector Table (IVT)''' is a table that specifies the addresses of all the 256 interrupt handlers used in [[real mode]]. Although it is also called IDT, it usually goes by the name of IVT to avoid confusions realted with the protected mode [[interrupt descriptor table]].
On the [[x86]] architecture, the '''Interupt Vector Table (IVT)''' is a table that specifies the addresses of all the 256 interrupt handlers used in [[real mode]]. Although it is also called the IDT, it usually goes by the name of IVT to avoid confusions realted with the protected mode [[interrupt descriptor table]].


Typically, the IVT is located at 0000:0000H and is 400H bytes in size, 4 bytes for each interrupt. Although the default address can be changed using the LIDT on newer CPUs, this is usually not done because it is both inconvenient and incompatible with other implementations and/or older software (e.g. MS-DOS programs). However, note that the code must remain in the first MiB of RAM.
Typically, the IVT is located at 0000:0000H and is 400H bytes in size, 4 bytes for each interrupt. Although the default address can be changed using the LIDT on newer CPUs, this is usually not done because it is both inconvenient and incompatible with other implementations and/or older software (e.g. MS-DOS programs). However, note that the code must remain in the first MiB of RAM.

== Structure ==

The entries are consecutive, meaning the first entry pointed by the IDTR is interrupt handler 0, and the others follow in succession. The format of an entry is:

+-----------+-----------+
| Segment | Offset |
+-----------+-----------+
4 2 0

We can therefore see that it's really easy to get the address of the interrupt handler we're looking for: <math>IDTR * 4</math>. In order to change an interrupt handler, all that needs to be done is to change its address in the table.


== See also ==
== See also ==

Revision as of 06:41, 28 January 2009

On the x86 architecture, the Interupt Vector Table (IVT) is a table that specifies the addresses of all the 256 interrupt handlers used in real mode. Although it is also called the IDT, it usually goes by the name of IVT to avoid confusions realted with the protected mode interrupt descriptor table.

Typically, the IVT is located at 0000:0000H and is 400H bytes in size, 4 bytes for each interrupt. Although the default address can be changed using the LIDT on newer CPUs, this is usually not done because it is both inconvenient and incompatible with other implementations and/or older software (e.g. MS-DOS programs). However, note that the code must remain in the first MiB of RAM.

Structure

The entries are consecutive, meaning the first entry pointed by the IDTR is interrupt handler 0, and the others follow in succession. The format of an entry is:

 +-----------+-----------+
 |  Segment  |  Offset   |
 +-----------+-----------+
 4           2           0

We can therefore see that it's really easy to get the address of the interrupt handler we're looking for: . In order to change an interrupt handler, all that needs to be done is to change its address in the table.

See also