feat(pit): add pit to isr and idt entries

This commit is contained in:
aliamelo committed 2021-07-17 11:57:21 +02:00
1 parent 416b4337c7
commit 8762f55b24
3 files changed
+14 -6

No files matched your search

+11 -6
View File
@@ -1,8 +1,9 @@
#include "idt.h" #include "idt.h"
#include "stdio.h"
#include "pic/pic.h"
#include "io.h" #include "io.h"
#include "pic/keyboard.h" #include "pic/keyboard.h"
#include "pic/pic.h"
#include "pic/pit.h"
#include "stdio.h"
static struct idt idt = { 0 }; static struct idt idt = { 0 };
@@ -25,15 +26,19 @@ static struct idt_entry_info infos[] = {
{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0},
// user-defined (32-255) // user-defined (32-255)
{0, INTERRUPT_TYPE}, {pic_keyboard, INTERRUPT_TYPE} {pic_pit, INTERRUPT_TYPE}, {pic_keyboard, INTERRUPT_TYPE}
}; };
void handle_interrupt(struct int_args *args) void handle_interrupt(struct int_args *args)
{ {
if (args->int_code >= 32) switch (args->int_code)
{ {
add_key_to_buffer(); case 32: // PIT
pit_handler();
outb(MASTER_PORT_A, OCW2_EOI);
return;
case 33: // keyboard
keyboard_handler();
outb(MASTER_PORT_A, OCW2_EOI); outb(MASTER_PORT_A, OCW2_EOI);
return; return;
} }
+1
View File
@@ -48,4 +48,5 @@ ISR_NO_ERRCODE(int_xm, 19)
ISR_NO_ERRCODE(int_ve, 20) ISR_NO_ERRCODE(int_ve, 20)
// user-defined // user-defined
ISR_NO_ERRCODE(pic_pit, 32)
ISR_NO_ERRCODE(pic_keyboard, 33) ISR_NO_ERRCODE(pic_keyboard, 33)
+2
View File
@@ -24,6 +24,8 @@ void int_xm(void); // SIMD Floating-Point Exception
void int_ve(void); // Virtualization Exception void int_ve(void); // Virtualization Exception
// ISR for PIC interrupts. // ISR for PIC interrupts.
void pic_pit(void);
void pic_keyboard(void); void pic_keyboard(void);
#endif /* !ISR_H */ #endif /* !ISR_H */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.