]> git.proxmox.com Git - mirror_edk2.git/blob - DuetPkg/CpuDxe/Ia32/CpuInterrupt.S
The asm file for Ia32 has been translated from MASM to GAS.
[mirror_edk2.git] / DuetPkg / CpuDxe / Ia32 / CpuInterrupt.S
1 /** @file
2 *
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
8 *
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.
11 *
12 * CpuInterrupt.S
13 *
14 * Abstract:
15 *
16 **/
17
18 .globl ASM_PFX(SystemTimerHandler)
19 .globl ASM_PFX(SystemExceptionHandler)
20 .globl ASM_PFX(mExceptionCodeSize)
21 .globl ASM_PFX(InitDescriptor)
22 .globl ASM_PFX(InstallInterruptHandler)
23
24 ASM_PFX(mExceptionCodeSize): .long 9
25
26 /**
27 * VOID
28 * InitDescriptor (
29 * VOID
30 * )
31 **/
32 ASM_PFX(InitDescriptor):
33 lgdt gdtr
34 lidt idtr
35 ret
36
37 /**
38 * VOID
39 * InstallInterruptHandler (
40 * UINTN Vector,
41 * VOID (*Handler)(VOID)
42 * )
43 **/
44 ASM_PFX(InstallInterruptHandler):
45 movl %esp, %ebp
46 pushl %edi
47 pushfl # save eflags
48 cli # turn off interrupts
49 subl $6, %esp # open some space on the stack
50 movl %esp, %edi
51 sidt %es:(%edi) # get fword address of IDT
52 movl %es:2(%edi), %edi # move offset of IDT into EDI
53 addl $6, %esp # correct stack
54 mov 4(%ebp), %eax # Get vector number
55 shll $3, %eax # multiply by 8 to get offset
56 addl %eax, %edi # add to IDT base to get entry
57 movl 8(%ebp), %eax # load new address into IDT entry
58 movw %ax, %es:(%edi) # write bits 15..0 of offset
59 shrl $16, %eax # use ax to copy 31..16 to descriptors
60 movw %ax, %es:6(%edi) # write bits 31..16 of offset
61 popfl # restore flags (possible enabling interrupts)
62 pop %edi
63 ret
64
65 .macro JmpCommonIdtEntry errno, vector
66 /* jmp commonIdtEntry - this must be hand coded to keep the assembler from
67 * using a 8 bit reletive jump when the entries are
68 * within 255 bytes of the common entry. This must
69 * be done to maintain the consistency of the size
70 * of entry points...
71 */
72 pushl \errno
73 pushl \vector
74 #.byte 0e9h # jmp 16 bit reletive
75 #.long commonIdtEntry - $ - $4 # offset to jump to
76 jmpl *commonIdtEntry
77 .endm
78
79 .align 0x02
80 ASM_PFX(SystemExceptionHandler):
81 INT0:
82 JmpCommonIdtEntry errno=0,vector=0
83 INT1:
84 JmpCommonIdtEntry errno=0,vector=1
85 INT2:
86 JmpCommonIdtEntry errno=0,vector=2
87 INT3:
88 JmpCommonIdtEntry errno=0,vector=3
89 INT4:
90 JmpCommonIdtEntry errno=0,vector=4
91 INT5:
92 JmpCommonIdtEntry errno=0,vector=5
93 INT6:
94 JmpCommonIdtEntry errno=0,vector=6
95 INT7:
96 JmpCommonIdtEntry errno=0,vector=7
97 INT8:
98 # Double fault causes an error code to be pushed so no phony pushl necessary
99 nop
100 nop
101 pushl $8
102 jmpl *commonIdtEntry
103 INT9:
104 JmpCommonIdtEntry errno=0,vector=9
105 INT10:
106 # Invalid TSS causes an error code to be pushed so no phony pushl necessary
107 nop
108 nop
109 pushl $10
110 jmpl *commonIdtEntry
111 INT11:
112 # Segment Not Present causes an error code to be pushed so no phony pushl necessary
113 nop
114 nop
115 pushl $11
116 jmpl *commonIdtEntry
117 INT12:
118 # Stack fault causes an error code to be pushed so no phony pushl necessary
119 nop
120 nop
121 pushl $12
122 jmpl *commonIdtEntry
123 INT13:
124 # GP fault causes an error code to be pushed so no phony pushl necessary
125 nop
126 nop
127 pushl $13
128 jmpl *commonIdtEntry
129 INT14:
130 # Page fault causes an error code to be pushed so no phony pushl necessary
131 nop
132 nop
133 pushl $14
134 jmpl *commonIdtEntry
135 INT15:
136 JmpCommonIdtEntry errno=0,vector=15
137 INT16:
138 JmpCommonIdtEntry errno=0,vector=16
139 INT17:
140 # Alignment check causes an error code to be pushed so no phony pushl necessary
141 nop
142 nop
143 pushl $17
144 jmpl *commonIdtEntry
145 INT18:
146 JmpCommonIdtEntry errno=0,vector=18
147 INT19:
148 JmpCommonIdtEntry errno=0,vector=19
149 INTUnknown:
150 JmpCommonIdtEntry errno=0,vector=20
151 JmpCommonIdtEntry errno=0,vector=21
152 JmpCommonIdtEntry errno=0,vector=22
153 JmpCommonIdtEntry errno=0,vector=23
154 JmpCommonIdtEntry errno=0,vector=24
155 JmpCommonIdtEntry errno=0,vector=25
156 JmpCommonIdtEntry errno=0,vector=26
157 JmpCommonIdtEntry errno=0,vector=27
158 JmpCommonIdtEntry errno=0,vector=28
159 JmpCommonIdtEntry errno=0,vector=29
160 JmpCommonIdtEntry errno=0,vector=30
161 JmpCommonIdtEntry errno=0,vector=31
162
163 ASM_PFX(SystemTimerHandler):
164 JmpCommonIdtEntry errno=0,vector=ASM_PFX(mTimerVector)
165
166 commonIdtEntry:
167 # +---------------------+
168 # + EFlags +
169 # +---------------------+
170 # + CS +
171 # +---------------------+
172 # + EIP +
173 # +---------------------+
174 # + Error Code +
175 # +---------------------+
176 # + Vector Number +
177 # +---------------------+
178 # + EBP +
179 # +---------------------+ <-- EBP
180
181 cli
182 pushl %ebp
183 movl %esp, %ebp
184
185 #
186 # Align stack to make sure that EFI_FX_SAVE_STATE_IA32 of EFI_SYSTEM_CONTEXT_IA32
187 # is 16-byte aligned
188 #
189 andl $0xfffffff0, %esp
190 subl $12, %esp
191
192 ## UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax#
193 pushl %eax
194 pushl %ecx
195 pushl %edx
196 pushl %ebx
197 leal 24(%ebp), %ecx
198 pushl %ecx # ESP
199 pushl (%ebp) # EBP
200 pushl %esi
201 pushl %edi
202
203 ## UINT32 Gs, Fs, Es, Ds, Cs, Ss#
204 movl %ss, %eax
205 pushl %eax
206 movzwl 16(%ebp), %eax
207 pushl %eax
208 movl %ds, %eax
209 pushl %eax
210 movl %es, %eax
211 pushl %eax
212 movl %fs, %eax
213 pushl %eax
214 movl %gs, %eax
215 pushl %eax
216
217 ## UINT32 Eip#
218 pushl 12(%ebp)
219
220 ## UINT32 Gdtr[2], Idtr[2]#
221 subl $8, %esp
222 sidt (%esp)
223 subl $8, %esp
224 sgdt (%esp)
225
226 ## UINT32 Ldtr, Tr#
227 xorl %eax, %eax
228 strw %ax
229 pushl %eax
230 sldt %ax
231 pushl %eax
232
233 ## UINT32 EFlags#
234 pushl 5*4(%ebp)
235
236 ## UINT32 Cr0, Cr1, Cr2, Cr3, Cr4#
237 movl %cr4, %eax
238 orl $0x208, %eax
239 movl %eax, %cr4
240 pushl %eax
241 movl %cr3, %eax
242 pushl %eax
243 movl %cr2, %eax
244 pushl %eax
245 xorl %eax, %eax
246 pushl %eax
247 movl %cr0, %eax
248 pushl %eax
249
250 ## UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7#
251 movl %dr7, %eax
252 pushl %eax
253 ## clear Dr7 while executing debugger itself
254 xorl %eax, %eax
255 movl %eax, %dr7
256
257 movl %dr6, %eax
258 pushl %eax
259 ## insure all status bits in dr6 are clear...
260 xorl %eax, %eax
261 movl %eax, %dr6
262
263 movl %dr3, %eax
264 pushl %eax
265 movl %dr2, %eax
266 pushl %eax
267 movl %dr1, %eax
268 pushl %eax
269 movl %dr0, %eax
270 pushl %eax
271
272 ## FX_SAVE_STATE_IA32 FxSaveState#
273 subl $512, %esp
274 movl %esp, %edi
275 #.byte 0f, 0ae, 00000111y #fxsave [edi]
276 fxsave (%edi)
277
278 ## UINT32 ExceptionData#
279 pushl 2*4(%ebp)
280
281 ## Prepare parameter and call
282 movl %esp, %edx
283 pushl %edx
284 movl 1*4(%ebp), %eax
285 pushl %eax
286 cmpl $32, %eax
287 jb CallException
288 call ASM_PFX(TimerHandler)
289 jmp ExceptionDone
290 CallException:
291 call ASM_PFX(ExceptionHandler)
292 ExceptionDone:
293 addl $8, %esp
294
295 cli
296 ## UINT32 ExceptionData#
297 addl $4, %esp
298
299 ## FX_SAVE_STATE_IA32 FxSaveState#
300 movl %esp, %esi
301 #db 0fh, 0aeh, 00001110y # fxrstor [esi]
302 fxrstor (%esi)
303 addl $512, %esp
304
305 ## UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7#
306 popl %eax
307 movl %eax, %dr0
308 popl %eax
309 movl %eax, %dr1
310 popl %eax
311 movl %eax, %dr2
312 popl %eax
313 movl %eax, %dr3
314 ## skip restore of dr6. We cleared dr6 during the context save.
315 addl $4, %esp
316 popl %eax
317 movl %eax, %dr7
318
319 ## UINT32 Cr0, Cr1, Cr2, Cr3, Cr4#
320 popl %eax
321 movl %eax, %cr0
322 addl $4, %esp # not for Cr1
323 popl %eax
324 movl %eax, %cr2
325 popl %eax
326 movl %eax, %cr3
327 popl %eax
328 movl %eax, %cr4
329
330 ## UINT32 EFlags#
331 popl 5*4(%ebp)
332
333 ## UINT32 Ldtr, Tr#
334 ## UINT32 Gdtr[2], Idtr[2]#
335 ## Best not let anyone mess with these particular registers...
336 addl $24, %esp
337
338 ## UINT32 Eip#
339 popl 3*4(%ebp)
340
341 ## UINT32 Gs, Fs, Es, Ds, Cs, Ss#
342 ## NOTE - modified segment registers could hang the debugger... We
343 ## could attempt to insulate ourselves against this possibility,
344 ## but that poses risks as well.
345 ##
346 popl %gs
347 popl %fs
348 popl %es
349 popl %ds
350 popl 4*4(%ebp)
351 popl %ss
352
353 ## UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax#
354 popl %edi
355 popl %esi
356 addl $4, %esp # not for ebp
357 addl $4, %esp # not for esp
358 popl %ebx
359 popl %edx
360 popl %ecx
361 popl %eax
362
363 movl %ebp, %esp
364 popl %ebp
365 addl $8, %esp
366 iretl
367
368
369 ##############################################################################
370 # data
371 ##############################################################################
372
373 .align 2, 0x0
374 gdtr:
375 .word 8*8 - 1
376 .long GDT_BASE
377
378 ##############################################################################
379 # global descriptor table (GDT)
380 ##############################################################################
381
382
383 .align 2, 0x90
384 GDT_BASE:
385 .quad 0x0 // null descriptor
386 .quad 0x00cf92000000ffff // linear data segment descriptor
387 .quad 0x00cf9a000000ffff // linear code segment descriptor
388 .quad 0x00cf92000000ffff // system data segment descriptor
389 .quad 0x00cf9a000000ffff // system code segment descriptor
390 .quad 0x0 // spare segment descriptor
391 .quad 0x0
392 .quad 0x0
393
394 .align 0x02
395
396 idtr:
397 .word IDT_END - IDT_BASE - 1 # IDT limit
398 .long IDT_BASE
399
400 ##############################################################################
401 # interrupt descriptor table (IDT)
402 #
403 # Note: The hardware IRQ's specified in this table are the normal PC/AT IRQ
404 # mappings. This implementation only uses the system timer and all other
405 # IRQs will remain masked. The descriptors for vectors 33+ are provided
406 # for convenience.
407 ##############################################################################
408
409 .align 0x02
410
411 IDT_BASE:
412 .skip 256 * 16
413
414 /**
415 # divide by zero (INT 0)
416 DIV_ZERO_SEL equ $-IDT_BASE
417 dw 0 # offset 15:0
418 dw SYS_CODE_SEL # selector 15:0
419 db 0 # 0 for interrupt gate
420 db 0eh OR 80h # type = 386 interrupt gate, present
421 dw 0 # offset 31:16
422
423 # debug exception (INT 1)
424 DEBUG_EXCEPT_SEL equ $-IDT_BASE
425 dw 0 # offset 15:0
426 dw SYS_CODE_SEL # selector 15:0
427 db 0 # 0 for interrupt gate
428 db 0eh OR 80h # type = 386 interrupt gate, present
429 dw 0 # offset 31:16
430
431 # NMI (INT 2)
432 NMI_SEL equ $-IDT_BASE
433 dw 0 # offset 15:0
434 dw SYS_CODE_SEL # selector 15:0
435 db 0 # 0 for interrupt gate
436 db 0eh OR 80h # type = 386 interrupt gate, present
437 dw 0 # offset 31:16
438
439 # soft breakpoint (INT 3)
440 BREAKPOINT_SEL equ $-IDT_BASE
441 dw 0 # offset 15:0
442 dw SYS_CODE_SEL # selector 15:0
443 db 0 # 0 for interrupt gate
444 db 0eh OR 80h # type = 386 interrupt gate, present
445 dw 0 # offset 31:16
446
447 # overflow (INT 4)
448 OVERFLOW_SEL equ $-IDT_BASE
449 dw 0 # offset 15:0
450 dw SYS_CODE_SEL # selector 15:0
451 db 0 # 0 for interrupt gate
452 db 0eh OR 80h # type = 386 interrupt gate, present
453 dw 0 # offset 31:16
454
455 # bounds check (INT 5)
456 BOUNDS_CHECK_SEL equ $-IDT_BASE
457 dw 0 # offset 15:0
458 dw SYS_CODE_SEL # selector 15:0
459 db 0 # 0 for interrupt gate
460 db 0eh OR 80h # type = 386 interrupt gate, present
461 dw 0 # offset 31:16
462
463 # invalid opcode (INT 6)
464 INVALID_OPCODE_SEL equ $-IDT_BASE
465 dw 0 # offset 15:0
466 dw SYS_CODE_SEL # selector 15:0
467 db 0 # 0 for interrupt gate
468 db 0eh OR 80h # type = 386 interrupt gate, present
469 dw 0 # offset 31:16
470
471 # device not available (INT 7)
472 DEV_NOT_AVAIL_SEL equ $-IDT_BASE
473 dw 0 # offset 15:0
474 dw SYS_CODE_SEL # selector 15:0
475 db 0 # 0 for interrupt gate
476 db 0eh OR 80h # type = 386 interrupt gate, present
477 dw 0 # offset 31:16
478
479 # double fault (INT 8)
480 DOUBLE_FAULT_SEL equ $-IDT_BASE
481 dw 0 # offset 15:0
482 dw SYS_CODE_SEL # selector 15:0
483 db 0 # 0 for interrupt gate
484 db 0eh OR 80h # type = 386 interrupt gate, present
485 dw 0 # offset 31:16
486
487 # Coprocessor segment overrun - reserved (INT 9)
488 RSVD_INTR_SEL1 equ $-IDT_BASE
489 dw 0 # offset 15:0
490 dw SYS_CODE_SEL # selector 15:0
491 db 0 # 0 for interrupt gate
492 db 0eh OR 80h # type = 386 interrupt gate, present
493 dw 0 # offset 31:16
494
495 # invalid TSS (INT 0ah)
496 INVALID_TSS_SEL equ $-IDT_BASE
497 dw 0 # offset 15:0
498 dw SYS_CODE_SEL # selector 15:0
499 db 0 # 0 for interrupt gate
500 db 0eh OR 80h # type = 386 interrupt gate, present
501 dw 0 # offset 31:16
502
503 # segment not present (INT 0bh)
504 SEG_NOT_PRESENT_SEL equ $-IDT_BASE
505 dw 0 # offset 15:0
506 dw SYS_CODE_SEL # selector 15:0
507 db 0 # 0 for interrupt gate
508 db 0eh OR 80h # type = 386 interrupt gate, present
509 dw 0 # offset 31:16
510
511 # stack fault (INT 0ch)
512 STACK_FAULT_SEL equ $-IDT_BASE
513 dw 0 # offset 15:0
514 dw SYS_CODE_SEL # selector 15:0
515 db 0 # 0 for interrupt gate
516 db 0eh OR 80h # type = 386 interrupt gate, present
517 dw 0 # offset 31:16
518
519 # general protection (INT 0dh)
520 GP_FAULT_SEL equ $-IDT_BASE
521 dw 0 # offset 15:0
522 dw SYS_CODE_SEL # selector 15:0
523 db 0 # 0 for interrupt gate
524 db 0eh OR 80h # type = 386 interrupt gate, present
525 dw 0 # offset 31:16
526
527 # page fault (INT 0eh)
528 PAGE_FAULT_SEL equ $-IDT_BASE
529 dw 0 # offset 15:0
530 dw SYS_CODE_SEL # selector 15:0
531 db 0 # 0 for interrupt gate
532 db 0eh OR 80h # type = 386 interrupt gate, present
533 dw 0 # offset 31:16
534
535 # Intel reserved - do not use (INT 0fh)
536 RSVD_INTR_SEL2 equ $-IDT_BASE
537 dw 0 # offset 15:0
538 dw SYS_CODE_SEL # selector 15:0
539 db 0 # 0 for interrupt gate
540 db 0eh OR 80h # type = 386 interrupt gate, present
541 dw 0 # offset 31:16
542
543 # floating point error (INT 10h)
544 FLT_POINT_ERR_SEL equ $-IDT_BASE
545 dw 0 # offset 15:0
546 dw SYS_CODE_SEL # selector 15:0
547 db 0 # 0 for interrupt gate
548 db 0eh OR 80h # type = 386 interrupt gate, present
549 dw 0 # offset 31:16
550
551 # alignment check (INT 11h)
552 ALIGNMENT_CHECK_SEL equ $-IDT_BASE
553 dw 0 # offset 15:0
554 dw SYS_CODE_SEL # selector 15:0
555 db 0 # 0 for interrupt gate
556 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
557 dw 0 # offset 31:16
558
559 # machine check (INT 12h)
560 MACHINE_CHECK_SEL equ $-IDT_BASE
561 dw 0 # offset 15:0
562 dw SYS_CODE_SEL # selector 15:0
563 db 0 # 0 for interrupt gate
564 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
565 dw 0 # offset 31:16
566
567 # SIMD floating-point exception (INT 13h)
568 SIMD_EXCEPTION_SEL equ $-IDT_BASE
569 dw 0 # offset 15:0
570 dw SYS_CODE_SEL # selector 15:0
571 db 0 # 0 for interrupt gate
572 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
573 dw 0 # offset 31:16
574
575 REPEAT (32 - 20)
576 dw 0 # offset 15:0
577 dw SYS_CODE_SEL # selector 15:0
578 db 0 # 0 for interrupt gate
579 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
580 dw 0 # offset 31:16
581 ENDM
582
583 # 72 unspecified descriptors
584 db (72 * 8) dup(0)
585
586 # IRQ 0 (System timer) - (INT 68h)
587 IRQ0_SEL equ $-IDT_BASE
588 dw 0 # offset 15:0
589 dw SYS_CODE_SEL # selector 15:0
590 db 0 # 0 for interrupt gate
591 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
592 dw 0 # offset 31:16
593
594 # IRQ 1 (8042 Keyboard controller) - (INT 69h)
595 IRQ1_SEL equ $-IDT_BASE
596 dw 0 # offset 15:0
597 dw SYS_CODE_SEL # selector 15:0
598 db 0 # 0 for interrupt gate
599 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
600 dw 0 # offset 31:16
601
602 # Reserved - IRQ 2 redirect (IRQ 2) - DO NOT USE!!! - (INT 6ah)
603 IRQ2_SEL equ $-IDT_BASE
604 dw 0 # offset 15:0
605 dw SYS_CODE_SEL # selector 15:0
606 db 0 # 0 for interrupt gate
607 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
608 dw 0 # offset 31:16
609
610 # IRQ 3 (COM 2) - (INT 6bh)
611 IRQ3_SEL equ $-IDT_BASE
612 dw 0 # offset 15:0
613 dw SYS_CODE_SEL # selector 15:0
614 db 0 # 0 for interrupt gate
615 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
616 dw 0 # offset 31:16
617
618 # IRQ 4 (COM 1) - (INT 6ch)
619 IRQ4_SEL equ $-IDT_BASE
620 dw 0 # offset 15:0
621 dw SYS_CODE_SEL # selector 15:0
622 db 0 # 0 for interrupt gate
623 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
624 dw 0 # offset 31:16
625
626 # IRQ 5 (LPT 2) - (INT 6dh)
627 IRQ5_SEL equ $-IDT_BASE
628 dw 0 # offset 15:0
629 dw SYS_CODE_SEL # selector 15:0
630 db 0 # 0 for interrupt gate
631 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
632 dw 0 # offset 31:16
633
634 # IRQ 6 (Floppy controller) - (INT 6eh)
635 IRQ6_SEL equ $-IDT_BASE
636 dw 0 # offset 15:0
637 dw SYS_CODE_SEL # selector 15:0
638 db 0 # 0 for interrupt gate
639 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
640 dw 0 # offset 31:16
641
642 # IRQ 7 (LPT 1) - (INT 6fh)
643 IRQ7_SEL equ $-IDT_BASE
644 dw 0 # offset 15:0
645 dw SYS_CODE_SEL # selector 15:0
646 db 0 # 0 for interrupt gate
647 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
648 dw 0 # offset 31:16
649
650 # IRQ 8 (RTC Alarm) - (INT 70h)
651 IRQ8_SEL equ $-IDT_BASE
652 dw 0 # offset 15:0
653 dw SYS_CODE_SEL # selector 15:0
654 db 0 # 0 for interrupt gate
655 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
656 dw 0 # offset 31:16
657
658 # IRQ 9 - (INT 71h)
659 IRQ9_SEL equ $-IDT_BASE
660 dw 0 # offset 15:0
661 dw SYS_CODE_SEL # selector 15:0
662 db 0 # 0 for interrupt gate
663 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
664 dw 0 # offset 31:16
665
666 # IRQ 10 - (INT 72h)
667 IRQ10_SEL equ $-IDT_BASE
668 dw 0 # offset 15:0
669 dw SYS_CODE_SEL # selector 15:0
670 db 0 # 0 for interrupt gate
671 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
672 dw 0 # offset 31:16
673
674 # IRQ 11 - (INT 73h)
675 IRQ11_SEL equ $-IDT_BASE
676 dw 0 # offset 15:0
677 dw SYS_CODE_SEL # selector 15:0
678 db 0 # 0 for interrupt gate
679 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
680 dw 0 # offset 31:16
681
682 # IRQ 12 (PS/2 mouse) - (INT 74h)
683 IRQ12_SEL equ $-IDT_BASE
684 dw 0 # offset 15:0
685 dw SYS_CODE_SEL # selector 15:0
686 db 0 # 0 for interrupt gate
687 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
688 dw 0 # offset 31:16
689
690 # IRQ 13 (Floating point error) - (INT 75h)
691 IRQ13_SEL equ $-IDT_BASE
692 dw 0 # offset 15:0
693 dw SYS_CODE_SEL # selector 15:0
694 db 0 # 0 for interrupt gate
695 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
696 dw 0 # offset 31:16
697
698 # IRQ 14 (Secondary IDE) - (INT 76h)
699 IRQ14_SEL equ $-IDT_BASE
700 dw 0 # offset 15:0
701 dw SYS_CODE_SEL # selector 15:0
702 db 0 # 0 for interrupt gate
703 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
704 dw 0 # offset 31:16
705
706 # IRQ 15 (Primary IDE) - (INT 77h)
707 IRQ15_SEL equ $-IDT_BASE
708 dw 0 # offset 15:0
709 dw SYS_CODE_SEL # selector 15:0
710 db 0 # 0 for interrupt gate
711 db 0eh OR 80h # (10001110)type = 386 interrupt gate, present
712 dw 0 # offset 31:16
713
714 db (1 * 8) dup(0)
715
716 **/
717 IDT_END: