Skip to content
Snippets Groups Projects
Commit cfee6a89 authored by Divyam Khandelwal's avatar Divyam Khandelwal
Browse files

PIT now interrupting, need to write handler

parent a3e3c4b1
No related branches found
No related tags found
No related merge requests found
......@@ -143,6 +143,9 @@ void initialize_IDT(void)
SET_IDT_ENTRY(idt[18], MACHINE_CHECK);
SET_IDT_ENTRY(idt[19], FLOATING_POINT);
// insert PIT handler into IDT table
SET_IDT_ENTRY(idt[PIT_INDEX], PIT_INTERRUPT);
// insert KB handler into IDT table
SET_IDT_ENTRY(idt[KEYBOARD_INDEX], KB_INTERRUPT);
......
......@@ -5,6 +5,7 @@
#include "lib.h"
#include "syscall.h"
#define PIT_INDEX 0x20
#define KEYBOARD_INDEX 0x21
#define RTC_INDEX 0x28
#define SYS_CALL_INDEX 0x80
......@@ -37,5 +38,6 @@ void MACHINE_CHECK(void);
void FLOATING_POINT(void);
void RTC_INTERRUPT(void);
void KB_INTERRUPT(void);
void PIT_INTERRUPT(void);
#endif
......@@ -28,6 +28,7 @@
.globl FLOATING_POINT
.globl RTC_INTERRUPT
.globl KB_INTERRUPT
.globl PIT_INTERRUPT
# - Each function acts as a bridge sending
# the interrupt value
......@@ -173,3 +174,15 @@ KB_INTERRUPT:
STI
IRET
PIT_INTERRUPT:
CLI
PUSHAL
CALL pit_handler
POPAL
STI
IRET
\ No newline at end of file
......@@ -164,6 +164,10 @@ void entry(unsigned long magic, unsigned long addr) {
rtc_init();
printf("RTC Initialized\n");
printf("Initializing PIT\n");
i8253_init();
printf("PIT Initialized\n");
printf("Initializing paging\n");
paging_initi();
printf("Paging Initialized\n");
......
......@@ -18,6 +18,7 @@ void i8253_init(void){
void pit_handler(){
//printf("[PIT] Interrupt Test");
send_eoi(0);
//todo
......
......@@ -75,13 +75,7 @@ int32_t rtc_read(int32_t fd, void* buf, int32_t nbytes)
/* Wait until interrupt handler clears flag */
while (interrupt_flag);
/* Reset flag, necessary? */
//interrupt_flag = 1;
/* Testing */
//printf("Fu");
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment