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

Triple Faulting

parent cfee6a89
No related branches found
No related tags found
No related merge requests found
...@@ -36,8 +36,6 @@ void paging_initi(void){ ...@@ -36,8 +36,6 @@ void paging_initi(void){
/* Kernel 4 MB page */ /* Kernel 4 MB page */
page_directory[1] = KERNEL_ADDR | SIZE | READ_WRITE | PRESENT; page_directory[1] = KERNEL_ADDR | SIZE | READ_WRITE | PRESENT;
//clear();
/* call assembly linkage to set registers */ /* call assembly linkage to set registers */
loadPageDirectory(page_directory); loadPageDirectory(page_directory);
enablePaging(); enablePaging();
......
...@@ -19,6 +19,7 @@ void i8253_init(void){ ...@@ -19,6 +19,7 @@ void i8253_init(void){
void pit_handler(){ void pit_handler(){
//printf("[PIT] Interrupt Test"); //printf("[PIT] Interrupt Test");
scheduler();
send_eoi(0); send_eoi(0);
//todo //todo
......
...@@ -30,16 +30,8 @@ void rtc_init(void) ...@@ -30,16 +30,8 @@ void rtc_init(void)
/* Enable interrupts */ /* Enable interrupts */
sti(); sti();
/* Testing */
//freq = 2;
//rtc_write(0, &freq, 4);
/* Enable RTC interrupt line */
enable_irq(RTC_IRQ); 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) ...@@ -75,7 +67,7 @@ int32_t rtc_read(int32_t fd, void* buf, int32_t nbytes)
/* Wait until interrupt handler clears flag */ /* Wait until interrupt handler clears flag */
while (interrupt_flag); while (interrupt_flag);
return 0; return 0;
} }
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
//in a certain mount of time, swap out of the current process and run the next one //in a certain mount of time, swap out of the current process and run the next one
void scheduler(void){ void scheduler(void){
// printf("[SCHEDULE]");
if (control.cur_pid == -1) return; if (control.cur_pid == -1) return;
int32_t flag = 0; int32_t flag = 0;
...@@ -33,6 +35,9 @@ void scheduler(void){ ...@@ -33,6 +35,9 @@ void scheduler(void){
// update current pid, tss and remap paging // update current pid, tss and remap paging
remap_proc(i); remap_proc(i);
printf("[SCHEDULE]");
control.cur_pid = i; control.cur_pid = i;
tss.ss0 = KERNEL_DS; tss.ss0 = KERNEL_DS;
tss.esp0 = _8_MB - _8_KB * control.cur_pid; tss.esp0 = _8_MB - _8_KB * control.cur_pid;
......
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