1 #------------------------------------------------------------------------------
3 #* Copyright 2006, Intel Corporation
4 #* All rights reserved. This program and the accompanying materials
5 #* are licensed and made available under the terms and conditions of the BSD License
6 #* which accompanies this distribution. The full text of the license may be found at
7 #* http://opensource.org/licenses/bsd-license.php
9 #* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 #* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #------------------------------------------------------------------------------
18 #PUBLIC SystemTimerHandler
19 #PUBLIC SystemExceptionHandler
20 #EXTERNDEF mExceptionCodeSize:DWORD
22 #EXTERN TimerHandler: NEAR
23 #EXTERN ExceptionHandler: NEAR
24 #EXTERN mTimerVector: DWORD
27 ASM_GLOBAL ASM_PFX(mExceptionCodeSize)
28 ASM_PFX(mExceptionCodeSize): .long 9
31 ASM_GLOBAL ASM_PFX(InitDescriptor)
33 ASM_PFX(InitDescriptor):
34 movl $GDT_BASE,%eax # EAX=PHYSICAL address of gdt
35 movl %eax, gdtr + 2 # Put address of gdt into the gdtr
37 movl $IDT_BASE,%eax # EAX=PHYSICAL address of idt
38 movl %eax, idtr + 2 # Put address of idt into the idtr
43 # InstallInterruptHandler (
45 # VOID (*Handler)(VOID)
47 ASM_GLOBAL ASM_PFX(InstallInterruptHandler)
48 ASM_PFX(InstallInterruptHandler):
49 # Vector:DWORD @ 4(%esp)
50 # Handler:DWORD @ 8(%esp)
54 cli # turn off interrupts
55 subl $6,%esp # open some space on the stack
57 sidt (%edi) # get fword address of IDT
58 movl 2(%edi), %edi # move offset of IDT into EDI
59 addl $6,%esp # correct stack
60 movl 12(%esp),%eax # Get vector number
61 shl $3,%eax # multiply by 8 to get offset
62 addl %eax,%edi # add to IDT base to get entry
63 movl 16(%esp),%eax # load new address into IDT entry
64 movw %ax,(%edi) # write bits 15..0 of offset
65 shrl $16,%eax # use ax to copy 31..16 to descriptors
66 movw %ax,6(%edi) # write bits 31..16 of offset
67 popf # restore flags (possible enabling interrupts)
71 .macro JmpCommonIdtEntry
72 # jmp commonIdtEntry - this must be hand coded to keep the assembler from
73 # using a 8 bit reletive jump when the entries are
74 # within 255 bytes of the common entry. This must
75 # be done to maintain the consistency of the size
77 .byte 0xe9 # jmp 16 bit reletive
78 .long commonIdtEntry - . - 4 # offset to jump to
82 ASM_GLOBAL ASM_PFX(SystemExceptionHandler)
83 ASM_PFX(SystemExceptionHandler):
85 pushl $0x0 # push error code place holder on the stack
88 # db 0e9h # jmp 16 bit reletive
89 # dd commonIdtEntry - $ - 4 # offset to jump to
92 pushl $0x0 # push error code place holder on the stack
97 pushl $0x0 # push error code place holder on the stack
102 pushl $0x0 # push error code place holder on the stack
107 pushl $0x0 # push error code place holder on the stack
112 pushl $0x0 # push error code place holder on the stack
117 pushl $0x0 # push error code place holder on the stack
122 pushl $0x0 # push error code place holder on the stack
127 # Double fault causes an error code to be pushed so no phony push necessary
134 pushl $0x0 # push error code place holder on the stack
139 # Invalid TSS causes an error code to be pushed so no phony push necessary
146 # Segment Not Present causes an error code to be pushed so no phony push necessary
153 # Stack fault causes an error code to be pushed so no phony push necessary
160 # GP fault causes an error code to be pushed so no phony push necessary
167 # Page fault causes an error code to be pushed so no phony push necessary
174 pushl $0x0 # push error code place holder on the stack
179 pushl $0x0 # push error code place holder on the stack
184 # Alignment check causes an error code to be pushed so no phony push necessary
191 pushl $0x0 # push error code place holder on the stack
196 pushl $0x0 # push error code place holder on the stack
201 # The following segment repeats (32 - 20) times:
203 pushl $0x0 # push error code place holder on the stack
204 # push xxh # push vector number
206 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
209 pushl $0x0 # push error code place holder on the stack
210 # push xxh # push vector number
212 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
215 pushl $0x0 # push error code place holder on the stack
216 # push xxh # push vector number
218 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
221 pushl $0x0 # push error code place holder on the stack
222 # push xxh # push vector number
224 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
227 pushl $0x0 # push error code place holder on the stack
228 # push xxh # push vector number
230 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
233 pushl $0x0 # push error code place holder on the stack
234 # push xxh # push vector number
236 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
239 pushl $0x0 # push error code place holder on the stack
240 # push xxh # push vector number
242 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
245 pushl $0x0 # push error code place holder on the stack
246 # push xxh # push vector number
248 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
251 pushl $0x0 # push error code place holder on the stack
252 # push xxh # push vector number
254 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
257 pushl $0x0 # push error code place holder on the stack
258 # push xxh # push vector number
260 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
263 pushl $0x0 # push error code place holder on the stack
264 # push xxh # push vector number
266 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
269 pushl $0x0 # push error code place holder on the stack
270 # push xxh # push vector number
272 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
276 ASM_GLOBAL ASM_PFX(SystemTimerHandler)
277 ASM_PFX(SystemTimerHandler):
279 pushl $ASM_PFX(mTimerVector)
283 # +---------------------+
285 # +---------------------+
287 # +---------------------+
289 # +---------------------+
291 # +---------------------+
293 # +---------------------+
295 # +---------------------+ <-- EBP
302 # Align stack to make sure that EFI_FX_SAVE_STATE_IA32 of EFI_SYSTEM_CONTEXT_IA32
305 andl $0xfffffff0,%esp
308 ## UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax#
319 ## UINT32 Gs, Fs, Es, Ds, Cs, Ss#
336 ## UINT32 Gdtr[2], Idtr[2]#
352 ## UINT32 Cr0, Cr1, Cr2, Cr3, Cr4#
366 ## UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7#
369 ## clear Dr7 while executing debugger itself
375 ## insure all status bits in dr6 are clear...
388 ## FX_SAVE_STATE_IA32 FxSaveState;
393 ## UINT32 ExceptionData;
396 ## Prepare parameter and call
403 call ASM_PFX(TimerHandler)
406 call ASM_PFX(ExceptionHandler)
411 ## UINT32 ExceptionData;
414 ## FX_SAVE_STATE_IA32 FxSaveState;
419 #; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
428 ## skip restore of dr6. We cleared dr6 during the context save.
433 ## UINT32 Cr0, Cr1, Cr2, Cr3, Cr4;
436 addl $4,%esp # not for Cr1
448 ## UINT32 Gdtr[2], Idtr[2];
449 ## Best not let anyone mess with these particular registers...
455 ## UINT32 Gs, Fs, Es, Ds, Cs, Ss;
456 ## NOTE - modified segment registers could hang the debugger... We
457 ## could attempt to insulate ourselves against this possibility,
458 ## but that poses risks as well.
467 ## UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax;
470 addl $4,%esp # not for ebp
471 addl $4,%esp # not for esp
483 #;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
485 #;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
490 gdtr: .short GDT_END - GDT_BASE - 1 # GDT limit
491 .long 0 # (GDT base gets set above)
492 #;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
493 # global descriptor table (GDT)
494 #;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
500 NULL_SEL = .-GDT_BASE
501 .short 0 # limit 15:0
505 .byte 0 # limit 19:16, flags
508 # linear data segment descriptor
509 LINEAR_SEL = .-GDT_BASE
510 .short 0x0FFFF # limit 0xFFFFF
513 .byte 0x092 # present, ring 0, data, expand-up, writable
514 .byte 0x0CF # page-granular, 32-bit
517 # linear code segment descriptor
518 LINEAR_CODE_SEL = .-GDT_BASE
519 .short 0x0FFFF # limit 0xFFFFF
522 .byte 0x09A # present, ring 0, data, expand-up, writable
523 .byte 0x0CF # page-granular, 32-bit
526 # system data segment descriptor
527 SYS_DATA_SEL = .-GDT_BASE
528 .short 0x0FFFF # limit 0xFFFFF
531 .byte 0x092 # present, ring 0, data, expand-up, writable
532 .byte 0x0CF # page-granular, 32-bit
535 # system code segment descriptor
536 SYS_CODE_SEL = .-GDT_BASE
537 .short 0x0FFFF # limit 0xFFFFF
540 .byte 0x09A # present, ring 0, data, expand-up, writable
541 .byte 0x0CF # page-granular, 32-bit
544 # spare segment descriptor
545 SPARE3_SEL = .-GDT_BASE
546 .short 0 # limit 0xFFFFF
549 .byte 0 # present, ring 0, data, expand-up, writable
550 .byte 0 # page-granular, 32-bit
553 # spare segment descriptor
554 SPARE4_SEL = .-GDT_BASE
555 .short 0 # limit 0xFFFFF
558 .byte 0 # present, ring 0, data, expand-up, writable
559 .byte 0 # page-granular, 32-bit
562 # spare segment descriptor
563 SPARE5_SEL = .-GDT_BASE
564 .short 0 # limit 0xFFFFF
567 .byte 0 # present, ring 0, data, expand-up, writable
568 .byte 0 # page-granular, 32-bit
577 idtr: .short IDT_END - IDT_BASE - 1 # IDT limit
578 .long 0 # (IDT base gets set above)
579 #;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
580 # interrupt descriptor table (IDT)
582 # Note: The hardware IRQ's specified in this table are the normal PC/AT IRQ
583 # mappings. This implementation only uses the system timer and all other
584 # IRQs will remain masked. The descriptors for vectors 33+ are provided
586 #;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
588 #idt_tag .byte "IDT",0
592 # divide by zero (INT 0)
593 DIV_ZERO_SEL = .-IDT_BASE
594 .short 0 # offset 15:0
595 .short SYS_CODE_SEL # selector 15:0
596 .byte 0 # 0 for interrupt gate
597 .byte 0x0e | 0x80 # type = 386 interrupt gate, present
598 .short 0 # offset 31:16
600 # debug exception (INT 1)
601 DEBUG_EXCEPT_SEL = .-IDT_BASE
602 .short 0 # offset 15:0
603 .short SYS_CODE_SEL # selector 15:0
604 .byte 0 # 0 for interrupt gate
605 .byte 0x0e | 0x80 # type = 386 interrupt gate, present
606 .short 0 # offset 31:16
610 .short 0 # offset 15:0
611 .short SYS_CODE_SEL # selector 15:0
612 .byte 0 # 0 for interrupt gate
613 .byte 0x0e | 0x80 # type = 386 interrupt gate, present
614 .short 0 # offset 31:16
616 # soft breakpoint (INT 3)
617 BREAKPOINT_SEL = .-IDT_BASE
618 .short 0 # offset 15:0
619 .short SYS_CODE_SEL # selector 15:0
620 .byte 0 # 0 for interrupt gate
621 .byte 0x0e | 0x80 # type = 386 interrupt gate, present
622 .short 0 # offset 31:16
625 OVERFLOW_SEL = .-IDT_BASE
626 .short 0 # offset 15:0
627 .short SYS_CODE_SEL # selector 15:0
628 .byte 0 # 0 for interrupt gate
629 .byte 0x0e | 0x80 # type = 386 interrupt gate, present
630 .short 0 # offset 31:16
632 # bounds check (INT 5)
633 BOUNDS_CHECK_SEL = .-IDT_BASE
634 .short 0 # offset 15:0
635 .short SYS_CODE_SEL # selector 15:0
636 .byte 0 # 0 for interrupt gate
637 .byte 0x0e | 0x80 # type = 386 interrupt gate, present
638 .short 0 # offset 31:16
640 # invalid opcode (INT 6)
641 INVALID_OPCODE_SEL = .-IDT_BASE
642 .short 0 # offset 15:0
643 .short SYS_CODE_SEL # selector 15:0
644 .byte 0 # 0 for interrupt gate
645 .byte 0x0e | 0x80 # type = 386 interrupt gate, present
646 .short 0 # offset 31:16
648 # device not available (INT 7)
649 DEV_NOT_AVAIL_SEL = .-IDT_BASE
650 .short 0 # offset 15:0
651 .short SYS_CODE_SEL # selector 15:0
652 .byte 0 # 0 for interrupt gate
653 .byte 0x0e | 0x80 # type = 386 interrupt gate, present
654 .short 0 # offset 31:16
656 # double fault (INT 8)
657 DOUBLE_FAULT_SEL = .-IDT_BASE
658 .short 0 # offset 15:0
659 .short SYS_CODE_SEL # selector 15:0
660 .byte 0 # 0 for interrupt gate
661 .byte 0x0e | 0x80 # type = 386 interrupt gate, present
662 .short 0 # offset 31:16
664 # Coprocessor segment overrun - reserved (INT 9)
665 RSVD_INTR_SEL1 = .-IDT_BASE
666 .short 0 # offset 15:0
667 .short SYS_CODE_SEL # selector 15:0
668 .byte 0 # 0 for interrupt gate
669 .byte 0x0e | 0x80 # type = 386 interrupt gate, present
670 .short 0 # offset 31:16
672 # invalid TSS (INT 0ah)
673 INVALID_TSS_SEL = .-IDT_BASE
674 .short 0 # offset 15:0
675 .short SYS_CODE_SEL # selector 15:0
676 .byte 0 # 0 for interrupt gate
677 .byte 0x0e | 0x80 # type = 386 interrupt gate, present
678 .short 0 # offset 31:16
680 # segment not present (INT 0bh)
681 SEG_NOT_PRESENT_SEL = .-IDT_BASE
682 .short 0 # offset 15:0
683 .short SYS_CODE_SEL # selector 15:0
684 .byte 0 # 0 for interrupt gate
685 .byte 0x0e | 0x80 # type = 386 interrupt gate, present
686 .short 0 # offset 31:16
688 # stack fault (INT 0ch)
689 STACK_FAULT_SEL = .-IDT_BASE
690 .short 0 # offset 15:0
691 .short SYS_CODE_SEL # selector 15:0
692 .byte 0 # 0 for interrupt gate
693 .byte 0x0e | 0x80 # type = 386 interrupt gate, present
694 .short 0 # offset 31:16
696 # general protection (INT 0dh)
697 GP_FAULT_SEL = .-IDT_BASE
698 .short 0 # offset 15:0
699 .short SYS_CODE_SEL # selector 15:0
700 .byte 0 # 0 for interrupt gate
701 .byte 0x0e | 0x80 # type = 386 interrupt gate, present
702 .short 0 # offset 31:16
704 # page fault (INT 0eh)
705 PAGE_FAULT_SEL = .-IDT_BASE
706 .short 0 # offset 15:0
707 .short SYS_CODE_SEL # selector 15:0
708 .byte 0 # 0 for interrupt gate
709 .byte 0x0e | 0x80 # type = 386 interrupt gate, present
710 .short 0 # offset 31:16
712 # Intel reserved - do not use (INT 0fh)
713 RSVD_INTR_SEL2 = .-IDT_BASE
714 .short 0 # offset 15:0
715 .short SYS_CODE_SEL # selector 15:0
716 .byte 0 # 0 for interrupt gate
717 .byte 0x0e | 0x80 # type = 386 interrupt gate, present
718 .short 0 # offset 31:16
720 # floating point error (INT 0x10)
721 FLT_POINT_ERR_SEL = .-IDT_BASE
722 .short 0 # offset 15:0
723 .short SYS_CODE_SEL # selector 15:0
724 .byte 0 # 0 for interrupt gate
725 .byte 0x0e | 0x80 # type = 386 interrupt gate, present
726 .short 0 # offset 31:16
728 # alignment check (INT 0x11)
729 ALIGNMENT_CHECK_SEL = .-IDT_BASE
730 .short 0 # offset 15:0
731 .short SYS_CODE_SEL # selector 15:0
732 .byte 0 # 0 for interrupt gate
733 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
734 .short 0 # offset 31:16
736 # machine check (INT 0x12)
737 MACHINE_CHECK_SEL = .-IDT_BASE
738 .short 0 # offset 15:0
739 .short SYS_CODE_SEL # selector 15:0
740 .byte 0 # 0 for interrupt gate
741 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
742 .short 0 # offset 31:16
744 # SIMD floating-point exception (INT 0x13)
745 SIMD_EXCEPTION_SEL = .-IDT_BASE
746 .short 0 # offset 15:0
747 .short SYS_CODE_SEL # selector 15:0
748 .byte 0 # 0 for interrupt gate
749 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
750 .short 0 # offset 31:16
752 # The following segment repeats (32 - 20) times:
754 .short 0 # offset 15:0
755 .short SYS_CODE_SEL # selector 15:0
756 .byte 0 # 0 for interrupt gate
757 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
758 .short 0 # offset 31:16
760 .short 0 # offset 15:0
761 .short SYS_CODE_SEL # selector 15:0
762 .byte 0 # 0 for interrupt gate
763 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
764 .short 0 # offset 31:16
766 .short 0 # offset 15:0
767 .short SYS_CODE_SEL # selector 15:0
768 .byte 0 # 0 for interrupt gate
769 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
770 .short 0 # offset 31:16
772 .short 0 # offset 15:0
773 .short SYS_CODE_SEL # selector 15:0
774 .byte 0 # 0 for interrupt gate
775 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
776 .short 0 # offset 31:16
778 .short 0 # offset 15:0
779 .short SYS_CODE_SEL # selector 15:0
780 .byte 0 # 0 for interrupt gate
781 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
782 .short 0 # offset 31:16
784 .short 0 # offset 15:0
785 .short SYS_CODE_SEL # selector 15:0
786 .byte 0 # 0 for interrupt gate
787 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
788 .short 0 # offset 31:16
790 .short 0 # offset 15:0
791 .short SYS_CODE_SEL # selector 15:0
792 .byte 0 # 0 for interrupt gate
793 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
794 .short 0 # offset 31:16
796 .short 0 # offset 15:0
797 .short SYS_CODE_SEL # selector 15:0
798 .byte 0 # 0 for interrupt gate
799 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
800 .short 0 # offset 31:16
802 .short 0 # offset 15:0
803 .short SYS_CODE_SEL # selector 15:0
804 .byte 0 # 0 for interrupt gate
805 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
806 .short 0 # offset 31:16
808 .short 0 # offset 15:0
809 .short SYS_CODE_SEL # selector 15:0
810 .byte 0 # 0 for interrupt gate
811 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
812 .short 0 # offset 31:16
814 .short 0 # offset 15:0
815 .short SYS_CODE_SEL # selector 15:0
816 .byte 0 # 0 for interrupt gate
817 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
818 .short 0 # offset 31:16
820 .short 0 # offset 15:0
821 .short SYS_CODE_SEL # selector 15:0
822 .byte 0 # 0 for interrupt gate
823 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
824 .short 0 # offset 31:16
827 # 72 unspecified descriptors
830 # IRQ 0 (System timer) - (INT 0x68)
831 IRQ0_SEL = .-IDT_BASE
832 .short 0 # offset 15:0
833 .short SYS_CODE_SEL # selector 15:0
834 .byte 0 # 0 for interrupt gate
835 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
836 .short 0 # offset 31:16
838 # IRQ 1 (8042 Keyboard controller) - (INT 0x69)
839 IRQ1_SEL = .-IDT_BASE
840 .short 0 # offset 15:0
841 .short SYS_CODE_SEL # selector 15:0
842 .byte 0 # 0 for interrupt gate
843 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
844 .short 0 # offset 31:16
846 # Reserved - IRQ 2 redirect (IRQ 2) - DO NOT USE!!! - (INT 6ah)
847 IRQ2_SEL = .-IDT_BASE
848 .short 0 # offset 15:0
849 .short SYS_CODE_SEL # selector 15:0
850 .byte 0 # 0 for interrupt gate
851 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
852 .short 0 # offset 31:16
854 # IRQ 3 (COM 2) - (INT 6bh)
855 IRQ3_SEL = .-IDT_BASE
856 .short 0 # offset 15:0
857 .short SYS_CODE_SEL # selector 15:0
858 .byte 0 # 0 for interrupt gate
859 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
860 .short 0 # offset 31:16
862 # IRQ 4 (COM 1) - (INT 6ch)
863 IRQ4_SEL = .-IDT_BASE
864 .short 0 # offset 15:0
865 .short SYS_CODE_SEL # selector 15:0
866 .byte 0 # 0 for interrupt gate
867 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
868 .short 0 # offset 31:16
870 # IRQ 5 (LPT 2) - (INT 6dh)
871 IRQ5_SEL = .-IDT_BASE
872 .short 0 # offset 15:0
873 .short SYS_CODE_SEL # selector 15:0
874 .byte 0 # 0 for interrupt gate
875 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
876 .short 0 # offset 31:16
878 # IRQ 6 (Floppy controller) - (INT 6eh)
879 IRQ6_SEL = .-IDT_BASE
880 .short 0 # offset 15:0
881 .short SYS_CODE_SEL # selector 15:0
882 .byte 0 # 0 for interrupt gate
883 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
884 .short 0 # offset 31:16
886 # IRQ 7 (LPT 1) - (INT 6fh)
887 IRQ7_SEL = .-IDT_BASE
888 .short 0 # offset 15:0
889 .short SYS_CODE_SEL # selector 15:0
890 .byte 0 # 0 for interrupt gate
891 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
892 .short 0 # offset 31:16
894 # IRQ 8 (RTC Alarm) - (INT 0x70)
895 IRQ8_SEL = .-IDT_BASE
896 .short 0 # offset 15:0
897 .short SYS_CODE_SEL # selector 15:0
898 .byte 0 # 0 for interrupt gate
899 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
900 .short 0 # offset 31:16
903 IRQ9_SEL = .-IDT_BASE
904 .short 0 # offset 15:0
905 .short SYS_CODE_SEL # selector 15:0
906 .byte 0 # 0 for interrupt gate
907 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
908 .short 0 # offset 31:16
910 # IRQ 10 - (INT 0x72)
911 IRQ10_SEL = .-IDT_BASE
912 .short 0 # offset 15:0
913 .short SYS_CODE_SEL # selector 15:0
914 .byte 0 # 0 for interrupt gate
915 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
916 .short 0 # offset 31:16
918 # IRQ 11 - (INT 0x73)
919 IRQ11_SEL = .-IDT_BASE
920 .short 0 # offset 15:0
921 .short SYS_CODE_SEL # selector 15:0
922 .byte 0 # 0 for interrupt gate
923 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
924 .short 0 # offset 31:16
926 # IRQ 12 (PS/2 mouse) - (INT 0x74)
927 IRQ12_SEL = .-IDT_BASE
928 .short 0 # offset 15:0
929 .short SYS_CODE_SEL # selector 15:0
930 .byte 0 # 0 for interrupt gate
931 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
932 .short 0 # offset 31:16
934 # IRQ 13 (Floating point error) - (INT 0x75)
935 IRQ13_SEL = .-IDT_BASE
936 .short 0 # offset 15:0
937 .short SYS_CODE_SEL # selector 15:0
938 .byte 0 # 0 for interrupt gate
939 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
940 .short 0 # offset 31:16
942 # IRQ 14 (Secondary IDE) - (INT 0x76)
943 IRQ14_SEL = .-IDT_BASE
944 .short 0 # offset 15:0
945 .short SYS_CODE_SEL # selector 15:0
946 .byte 0 # 0 for interrupt gate
947 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
948 .short 0 # offset 31:16
950 # IRQ 15 (Primary IDE) - (INT 0x77)
951 IRQ15_SEL = .-IDT_BASE
952 .short 0 # offset 15:0
953 .short SYS_CODE_SEL # selector 15:0
954 .byte 0 # 0 for interrupt gate
955 .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present
956 .short 0 # offset 31:16