Upgrade VMM for processes

This commit is contained in:
2026-03-22 09:03:43 +01:00
parent 3ae56bbad5
commit ac788c55d3
9 changed files with 233 additions and 69 deletions
+9
View File
@@ -32,6 +32,8 @@ global vector_19_handler
global vector_20_handler
global vector_21_handler
global vector_128_handler
interrupt_stub:
; We'll push all general-purpose registers to the stack,
; so they're intact and don't bother the code that was
@@ -312,4 +314,11 @@ align 16
vector_33_handler:
push qword 0
push qword 33
jmp interrupt_stub
; Syscall Interrupt (0x80)
align 16
vector_128_handler:
push qword 0
push qword 128
jmp interrupt_stub
+7 -1
View File
@@ -21,6 +21,8 @@ struct idtr idt_reg;
// Address to our first interrupt handler
extern char vector_0_handler[];
extern char vector_128_handler[];
// Timer ticks
extern volatile uint64_t ticks;
@@ -75,7 +77,7 @@ void idt_init()
idt_set_entry(i, vector_0_handler + (i*16), 0);
}
idt_set_entry(0x80, syscall_handler, 0);
idt_set_entry(0x80, vector_128_handler, 0);
idt_load(&idt);
DEBUG("IDT initialized");
@@ -273,6 +275,10 @@ struct cpu_status_t* interrupt_dispatch(struct cpu_status_t* context)
//process_create("keyboard-initiated", kbdproc_main, NULL); // DEBUG
outb(0x20, 0x20);
break;
case 128: // Syscall Interrupt (0x80)
syscall_handler(context);
break;
default:
DEBUG("Unexpected Interrupt");