From 72d627ba6e92b424c8923dc1602d9e2a8085a870 Mon Sep 17 00:00:00 2001 From: Divyam Khandelwal <divyam@wirelessprv-10-194-9-252.near.illinois.edu> Date: Sat, 21 Apr 2018 15:06:46 -0500 Subject: [PATCH] Triple Faulting --- student-distrib/paging.c | 2 -- student-distrib/pit.c | 1 + student-distrib/rtc.c | 10 +--------- student-distrib/scheduler.c | 5 +++++ 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/student-distrib/paging.c b/student-distrib/paging.c index 04d4531..b353fe6 100644 --- a/student-distrib/paging.c +++ b/student-distrib/paging.c @@ -36,8 +36,6 @@ void paging_initi(void){ /* Kernel 4 MB page */ page_directory[1] = KERNEL_ADDR | SIZE | READ_WRITE | PRESENT; - //clear(); - /* call assembly linkage to set registers */ loadPageDirectory(page_directory); enablePaging(); diff --git a/student-distrib/pit.c b/student-distrib/pit.c index 624a5d9..81eb0b0 100644 --- a/student-distrib/pit.c +++ b/student-distrib/pit.c @@ -19,6 +19,7 @@ void i8253_init(void){ void pit_handler(){ //printf("[PIT] Interrupt Test"); + scheduler(); send_eoi(0); //todo diff --git a/student-distrib/rtc.c b/student-distrib/rtc.c index e1082c4..f772e75 100644 --- a/student-distrib/rtc.c +++ b/student-distrib/rtc.c @@ -30,16 +30,8 @@ void rtc_init(void) /* Enable interrupts */ sti(); - /* Testing */ - //freq = 2; - //rtc_write(0, &freq, 4); - - /* Enable RTC interrupt line */ enable_irq(RTC_IRQ); - /* Testing */ - //freq = 8192; - //rtc_write(0, &freq, 4); } /* @@ -75,7 +67,7 @@ int32_t rtc_read(int32_t fd, void* buf, int32_t nbytes) /* Wait until interrupt handler clears flag */ while (interrupt_flag); - + return 0; } diff --git a/student-distrib/scheduler.c b/student-distrib/scheduler.c index 13d4fd3..527683b 100644 --- a/student-distrib/scheduler.c +++ b/student-distrib/scheduler.c @@ -3,6 +3,8 @@ //in a certain mount of time, swap out of the current process and run the next one void scheduler(void){ + // printf("[SCHEDULE]"); + if (control.cur_pid == -1) return; int32_t flag = 0; @@ -33,6 +35,9 @@ void scheduler(void){ // update current pid, tss and remap paging remap_proc(i); + + printf("[SCHEDULE]"); + control.cur_pid = i; tss.ss0 = KERNEL_DS; tss.esp0 = _8_MB - _8_KB * control.cur_pid; -- GitLab