Knowledge (XXG)

Interrupt descriptor table

Source đź“ť

267:) and an offset within that segment. The only difference between trap and interrupt gates is that interrupt gates will disable further processor handling of maskable hardware interrupts, making them suitable to handle hardware-generated interrupts (conversely, trap gates are useful for handling software interrupts and exceptions). A task gate will cause the currently active task-state segment to be switched, using the hardware task switch mechanism to effectively hand over use of the processor to another program, thread or process. 33: 250:
The IDTR register is used to store both the linear base address and the limit (length in bytes minus 1) of the IDT. When an interrupt occurs, the processor multiplies the interrupt vector by the entry size (8 for protected mode, 16 for long mode) and adds the result to the IDT base address. If the
134:
generated by the CPU have fixed mapping to the first up to 32 interrupt vectors. While 32 vectors (0x00-0x1f) are officially reserved (and many of them are used in newer processors), the original 8086 used only the first five (0-4) interrupt vectors and the IBM PC IDT layout did not respect the
242:
The IDT is an array of descriptors stored consecutively in memory and indexed by the vector number. It is not necessary to use all of the possible entries: it is sufficient to populate the table up to the highest interrupt vector used, and set the IDT length portion of the
258:
The descriptors may be either interrupt gates, trap gates or, for 32-bit protected mode only, task gates. Interrupt and trap gates point to a memory location containing code to execute by specifying both a segment (present in either the
614:
runtime) does not follow the official Intel layout beyond the first five exception vectors implemented in the original 8086. Interrupt 5 is already used for handling the
149:. While Intel documents IRQs 0-7 to be mapped to vectors 0x20-0x27, IBM PC and compatibles map them to 0x08-0x0F. IRQs 8-15 are usually mapped to vectors 0x70-0x77. 123:
and the use of the IDT is triggered by three types of events: processor exceptions, hardware interrupts, and software interrupts, which together are referred to as
155:
vector numbers are defined by the specific runtime environment, such as the IBM PC BIOS, DOS, or other operating systems. They are triggered by software using the
222:
The BIOS provides simple real-mode access to a subset of hardware facilities by registering interrupt handlers. They are invoked as software interrupts with the
116:
The details in the description below apply specifically to the x86 architecture. Other architectures have similar data structures, but may behave differently.
280:
All INT_NUM between 0x0 and 0x1F, inclusive, are reserved for exceptions by Intel. INT_NUM bigger than 0x1F are to be used for interrupt routines.
188:, the interrupt table is called IVT (interrupt vector table). Up to the 80286, the IVT always resided at the same location in memory, ranging from 812:
If the operating system detects one of these modifications or any other unauthorized patch, it will generate a bug check and shut down the system.
839: 54: 557: 226:
assembly instruction and the parameters are passed via registers. These interrupts are used for various tasks like detecting the system
204:
and later, the size and locations of the IVT can be changed in the same way as it is done with the IDT (Interrupt descriptor table) in
141:
vector numbers correspond to the hardware IRQ numbers. The exact mapping depends on how the Programmable Interrupt Controller such as
76: 618:
key, IRQ 0-7 is mapped to INT_NUM 0x08-0x0F, and BIOS is using most of the vectors in the 0x10-0x1F range as part of its API.
208:(i.e., via the LIDT (Load Interrupt Descriptor Table Register) instruction) though it does not change the format of it. 47: 41: 871: 252: 861: 741:
Intel® 64 and IA-32 Architectures Software Developer’s Manual, 6.12.1 Exception- or Interrupt-Handler Procedures
200:. Hardware interrupts may be mapped to any of the vectors by way of a programmable interrupt controller. On the 58: 459: 842:(see CHAPTER 5, INTERRUPT AND EXCEPTION HANDLING and CHAPTER 10, ADVANCED PROGRAMMABLE INTERRUPT CONTROLLER)] 638:
that intercepts calls to the IDT and adds in its own processing. This has never been officially supported by
663: 260: 159:
instruction (either by applications, device drivers or even other interrupt handlers). For example, IBM PC
331: 264: 102: 840:
Intel 64 and IA-32 Architectures Software Developer’s Manual, Volume 3A:System Programming Guide, Part 1
223: 156: 105:. The IDT is used by the processor to determine the memory addresses of the handlers to be executed on 732:
Intel® 64 and IA-32 Architectures Software Developer’s Manual, 20.1.4 Interrupt and Exception Handling
866: 217: 801: 110: 828:
Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 3: System Programming Guide
827: 303: 120: 17: 205: 855: 635: 845: 615: 399: 708: 647: 197: 776: 472: 227: 146: 142: 106: 806: 651: 639: 317: 185: 642:, but was not programmatically prevented on its operating systems until 631: 627: 168: 643: 611: 164: 751: 683: 344:
Breakpoint (which benefits from the shorter 0xCC encoding of INT 3)
234:
output and modes, and accessing the disk early in the boot process.
201: 172: 607: 531: 255:
is checked and the interrupt is handled based on the gate type.
160: 231: 98: 26: 646:
versions of Windows, where a driver that attempts to use a
634:
calls to the IDT. This involves writing a kernel mode
777:"Interrupt Table as Implemented by System BIOS/DOS" 244: 556:Control Protection Exception (only available with 175:provides the syscall interface at the vector 0x80. 8: 163:provides video services at the vector 0x10, 77:Learn how and when to remove this message 282: 40:This article includes a list of general 802:"Patching Policy for x64-Based Systems" 675: 7: 713:Bran's Kernel Development Tutorial 97:) is a data structure used by the 46:it lacks sufficient corresponding 25: 251:address is inside the table, the 31: 650:hook will cause the machine to 1: 498:x87 Floating Point Exception 101:architecture to implement an 412:Coprocessor Segment Overrun 426:Invalid Task State Segment 316:Single-step interrupt (see 888: 846:Interrupt Descriptor Table 388:Coprocessor not available 215: 91:interrupt descriptor table 18:Interrupt Descriptor Table 752:"Exceptions - OSDev Wiki" 684:"Exceptions - OSDev Wiki" 545:Virtualization Exception 534:Floating-Point Exception 781:HelpPC Reference Library 460:General Protection Fault 171:at the vector 0x21, and 119:The IDT consists of 256 664:Global Descriptor Table 238:Protected and long mode 196:, and consisted of 256 61:more precise citations. 103:interrupt vector table 414:(386 or earlier only) 366:Bound Range Exceeded 276:Official Intel layout 568:Processor Exception 553:Processor Exception 542:Processor Exception 528:Processor Exception 517:Processor Exception 506:Processor Exception 495:Processor Exception 482:Processor Exception 469:Processor Exception 456:Processor Exception 448:Stack Segment Fault 445:Processor Exception 437:Segment not present 434:Processor Exception 423:Processor Exception 409:Processor Exception 396:Processor Exception 385:Processor Exception 374:Processor Exception 363:Processor Exception 352:Processor Exception 341:Processor Exception 328:Processor Exception 313:Processor Exception 300:Processor Exception 132:Processor exceptions 592:Hardware Interrupt 581:Hardware Interrupt 218:BIOS interrupt call 707:Friesen, Brandon. 292:Short Description 271:Common IDT layouts 153:Software interrupt 139:Hardware interrupt 872:Memory management 599: 598: 121:interrupt vectors 87: 86: 79: 16:(Redirected from 879: 862:X86 architecture 815: 814: 798: 792: 791: 789: 787: 775:Jurgens, David. 772: 766: 765: 763: 762: 748: 742: 739: 733: 730: 724: 723: 721: 719: 704: 698: 697: 695: 694: 680: 509:Alignment Check 304:Division by zero 283: 246: 195: 191: 82: 75: 71: 68: 62: 57:this article by 48:inline citations 35: 34: 27: 21: 887: 886: 882: 881: 880: 878: 877: 876: 852: 851: 836: 819: 818: 800: 799: 795: 785: 783: 774: 773: 769: 760: 758: 750: 749: 745: 740: 736: 731: 727: 717: 715: 709:"IRQs and PICs" 706: 705: 701: 692: 690: 682: 681: 677: 672: 660: 624: 604: 377:Invalid Opcode 278: 273: 240: 220: 214: 212:BIOS interrupts 193: 189: 182: 135:reserved range. 83: 72: 66: 63: 53:Please help to 52: 36: 32: 23: 22: 15: 12: 11: 5: 885: 883: 875: 874: 869: 864: 854: 853: 850: 849: 843: 835: 834:External links 832: 831: 830: 824: 823: 817: 816: 793: 767: 756:wiki.osdev.org 743: 734: 725: 699: 688:wiki.osdev.org 674: 673: 671: 668: 667: 666: 659: 656: 623: 620: 603: 600: 597: 596: 593: 590: 586: 585: 582: 579: 575: 574: 569: 566: 562: 561: 554: 551: 547: 546: 543: 540: 536: 535: 529: 526: 522: 521: 520:Machine Check 518: 515: 511: 510: 507: 504: 500: 499: 496: 493: 489: 488: 483: 480: 476: 475: 470: 467: 463: 462: 457: 454: 450: 449: 446: 443: 439: 438: 435: 432: 428: 427: 424: 421: 417: 416: 410: 407: 403: 402: 397: 394: 390: 389: 386: 383: 379: 378: 375: 372: 368: 367: 364: 361: 357: 356: 353: 350: 346: 345: 342: 339: 335: 334: 329: 326: 322: 321: 314: 311: 307: 306: 301: 298: 294: 293: 290: 287: 277: 274: 272: 269: 247:accordingly. 239: 236: 230:, configuring 216:Main article: 213: 210: 206:protected mode 181: 178: 177: 176: 150: 136: 85: 84: 67:September 2013 39: 37: 30: 24: 14: 13: 10: 9: 6: 4: 3: 2: 884: 873: 870: 868: 865: 863: 860: 859: 857: 847: 844: 841: 838: 837: 833: 829: 826: 825: 821: 820: 813: 809: 808: 803: 797: 794: 782: 778: 771: 768: 757: 753: 747: 744: 738: 735: 729: 726: 714: 710: 703: 700: 689: 685: 679: 676: 669: 665: 662: 661: 657: 655: 653: 649: 645: 641: 637: 633: 629: 621: 619: 617: 613: 609: 602:IBM PC layout 601: 594: 591: 588: 587: 583: 580: 577: 576: 573: 570: 567: 564: 563: 559: 555: 552: 549: 548: 544: 541: 538: 537: 533: 530: 527: 524: 523: 519: 516: 513: 512: 508: 505: 502: 501: 497: 494: 491: 490: 487: 484: 481: 478: 477: 474: 471: 468: 465: 464: 461: 458: 455: 452: 451: 447: 444: 441: 440: 436: 433: 430: 429: 425: 422: 419: 418: 415: 411: 408: 405: 404: 401: 398: 395: 392: 391: 387: 384: 381: 380: 376: 373: 370: 369: 365: 362: 359: 358: 354: 351: 348: 347: 343: 340: 337: 336: 333: 330: 327: 324: 323: 319: 315: 312: 309: 308: 305: 302: 299: 296: 295: 291: 288: 285: 284: 281: 275: 270: 268: 266: 262: 256: 254: 248: 237: 235: 233: 229: 228:memory layout 225: 219: 211: 209: 207: 203: 199: 187: 179: 174: 170: 167:provides the 166: 162: 158: 154: 151: 148: 144: 140: 137: 133: 130: 129: 128: 126: 122: 117: 114: 112: 108: 104: 100: 96: 92: 81: 78: 70: 60: 56: 50: 49: 43: 38: 29: 28: 19: 848:at OSDev.org 811: 805: 796: 784:. Retrieved 780: 770: 759:. Retrieved 755: 746: 737: 728: 716:. Retrieved 712: 702: 691:. Retrieved 687: 678: 625: 616:Print Screen 606:The IBM PC ( 605: 571: 485: 413: 400:Double Fault 279: 257: 249: 241: 221: 198:far pointers 183: 152: 138: 131: 124: 118: 115: 94: 90: 88: 73: 64: 45: 648:kernel mode 289:Event Type 59:introducing 867:Interrupts 856:Categories 761:2021-04-17 693:2021-04-17 670:References 589:0x70-0x77 578:0x20-0x27 565:0x16-0x1F 473:Page Fault 147:programmed 143:Intel 8259 125:interrupts 111:exceptions 107:interrupts 42:references 807:Microsoft 652:bug check 640:Microsoft 630:programs 595:IRQ 8-15 355:Overflow 318:trap flag 186:real mode 180:Real mode 658:See also 584:IRQ 0-7 572:reserved 486:reserved 286:INT_NUM 822:General 628:Windows 622:Hooking 169:DOS API 55:improve 786:6 June 718:6 June 644:64-bit 636:driver 612:MS-DOS 194:0x03ff 190:0x0000 165:MS-DOS 44:, but 626:Some 550:0x15 539:0x14 525:0x13 514:0x12 503:0x11 492:0x10 479:0x0F 466:0x0E 453:0x0D 442:0x0C 431:0x0B 420:0x0A 406:0x09 393:0x08 382:0x07 371:0x06 360:0x05 349:0x04 338:0x03 325:0x02 310:0x01 297:0x00 202:80286 173:Linux 788:2024 720:2024 632:hook 610:and 608:BIOS 532:SIMD 245:IDTR 161:BIOS 109:and 89:The 558:CET 332:NMI 265:LDT 263:or 261:GDT 253:DPL 232:VGA 224:INT 192:to 184:In 157:INT 145:is 99:x86 95:IDT 858:: 810:. 804:. 779:. 754:. 711:. 686:. 654:. 560:) 320:) 127:: 113:. 790:. 764:. 722:. 696:. 93:( 80:) 74:( 69:) 65:( 51:. 20:)

Index

Interrupt Descriptor Table
references
inline citations
improve
introducing
Learn how and when to remove this message
x86
interrupt vector table
interrupts
exceptions
interrupt vectors
Intel 8259
programmed
INT
BIOS
MS-DOS
DOS API
Linux
real mode
far pointers
80286
protected mode
BIOS interrupt call
INT
memory layout
VGA
DPL
GDT
LDT
Division by zero

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.

↑