user program (still many #PF)

This commit is contained in:
2026-04-02 17:05:51 +02:00
parent 11a9dd4adb
commit aa30d9c6b5
11 changed files with 107 additions and 16 deletions
+4 -3
View File
@@ -77,7 +77,7 @@ void idt_init()
idt_set_entry(i, vector_0_handler + (i*16), 0);
}
idt_set_entry(0x80, vector_128_handler, 0);
idt_set_entry(0x80, vector_128_handler, 3);
idt_load(&idt);
DEBUG("IDT initialized");
@@ -264,9 +264,10 @@ struct cpu_status* interrupt_dispatch(struct cpu_status* context)
// Send an EOI so that we can continue having interrupts
outb(0x20, 0x20);
if (ticks % SCHEDULER_QUANTUM == 0) {
// Scheduler is temporarily disabled to test user trampoline
/* if (ticks % SCHEDULER_QUANTUM == 0) {
return scheduler_schedule(context);
}
} */
break;
+1 -1
View File
@@ -45,7 +45,7 @@ static void x86_enable_fpu()
__asm__ volatile("mov %%cr4, %0" : "=r"(cr4));
cr4 |= 0x200;
__asm__ volatile("mov %0, %%cr4" :: "r"(cr4));
uint16_t cw = 0x37F;
uint16_t cw = 0x37F; // control word
asm volatile("fldcw %0" :: "m"(cw));
}