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.c | |
parent | pic (diff) | |
download | corn-b9754579df4eeff3d94aed514a37920d68d39940.tar.gz corn-b9754579df4eeff3d94aed514a37920d68d39940.tar.bz2 corn-b9754579df4eeff3d94aed514a37920d68d39940.zip |
pic done
Diffstat (limited to 'src/arch/amd64/idt.c')
-rw-r--r-- | src/arch/amd64/idt.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/arch/amd64/idt.c b/src/arch/amd64/idt.c index c903ca8..5c6261c 100644 --- a/src/arch/amd64/idt.c +++ b/src/arch/amd64/idt.c @@ -5,6 +5,7 @@ #include <serial.h> #include "idt.h" +#include "pic.h" #define IDT_SIZE 256 @@ -106,6 +107,28 @@ char *EXCEPTIONS[] = { "Exception 0x1F Reserved", }; +void idt_pic_eoi(uint8_t exception) { + pic_eoi(exception - PIC_REMAP_OFFSET); +} + +static size_t timer = 0; + +void idt_pic_timer(void) { + timer += 1; + char buf[20]; + ltoa(timer, buf, 10); + serial_out_str(buf); + serial_out_str("\n"); +} + +void idt_pic_keyboard(void) { + serial_out_str("ps2 kbd"); +} + +void idt_pic_mouse(void) { + serial_out_str("ps2 mouse"); +} + void idt_exception_handler(uint64_t exception, uint64_t code) { // TODO don't just panic char buf[80]; |