diff --git a/student-distrib/paging.c b/student-distrib/paging.c index 04d4531921e8b2a36dc6d9588b1cc8800cd7a67b..b353fe6027855891e6c29e6de9281aea5c0b71f5 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 624a5d9b165385366e0262f981f1572380b4fc17..81eb0b0719289565dcf0a7bcf7bc9c31b43e91ec 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 e1082c48ceeed2c6110c9eb0534f4203acd04164..f772e75157fed103bfa122380af4e8c9418369a1 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 13d4fd3ac346e84969589c7d4d235165eabc0cfb..527683ba6bf898e193a535e2cc1e769237f2ec77 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;