diff options
author | Freya Murphy <freya@freyacat.org> | 2024-01-29 19:19:29 -0500 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-01-29 19:19:29 -0500 |
commit | b9754579df4eeff3d94aed514a37920d68d39940 (patch) | |
tree | 88509189d763bc1df17746048d519f79e505aa4d /src/arch/amd64/idt.S | |
parent | pic (diff) | |
download | corn-b9754579df4eeff3d94aed514a37920d68d39940.tar.gz corn-b9754579df4eeff3d94aed514a37920d68d39940.tar.bz2 corn-b9754579df4eeff3d94aed514a37920d68d39940.zip |
pic done
Diffstat (limited to 'src/arch/amd64/idt.S')
-rw-r--r-- | src/arch/amd64/idt.S | 68 |
1 files changed, 66 insertions, 2 deletions
diff --git a/src/arch/amd64/idt.S b/src/arch/amd64/idt.S index afb1149..1098057 100644 --- a/src/arch/amd64/idt.S +++ b/src/arch/amd64/idt.S @@ -1,6 +1,11 @@ extern idt_exception_handler global isr_stub_table +extern idt_pic_timer +extern idt_pic_keyboard +extern idt_pic_mouse +extern idt_pic_eoi + %macro PUSHALL 0 push rbx push rcx @@ -62,6 +67,49 @@ isr_stub_%+%1: iretq %endmacro +%macro PICGeneric 1 +isr_stub_%+%1: + PUSHALL + cld + mov rdi, %1 + call idt_pic_eoi + POPALL + iretq +%endmacro + +%macro PICTimer 1 +isr_stub_%+%1: + PUSHALL + cld + call idt_pic_timer + mov rdi, %1 + call idt_pic_eoi + POPALL + iretq +%endmacro + +%macro PICKeyboard 1 +isr_stub_%+%1: + PUSHALL + cld + call idt_pic_keyboard + mov rdi, %1 + call idt_pic_eoi + POPALL + iretq +%endmacro + +%macro PICMouse 1 +isr_stub_%+%1: + PUSHALL + cld + call idt_pic_mouse + mov rdi, %1 + call idt_pic_eoi + POPALL + iretq +%endmacro + ; do nothing ; args: interrupt number %macro ISRIgnore 1 @@ -107,10 +155,26 @@ ISRExceptionCode 29 ISRExceptionCode 30 ISRException 31 -%assign i 32 +PICTimer 32 ; 0 +PICKeyboard 33 ; 1 +PICGeneric 34 ; 2 +PICGeneric 35 ; 3 +PICGeneric 36 ; 4 +PICGeneric 37 ; 5 +PICGeneric 38 ; 6 +PICGeneric 39 ; 7 +PICGeneric 40 ; 8 +PICGeneric 41 ; 9 +PICGeneric 42 ; 10 +PICGeneric 43 ; 11 +PICMouse 44 ; 12 +PICGeneric 45 ; 13 +PICGeneric 46 ; 14 +PICGeneric 47 ; 15 ; ignore other interrupts -%rep 0x100 - i +%assign i 48 +%rep 256 - i ISRIgnore i %assign i i+1 %endrep |