Add kprintf for DEBUG(); differentiated from printf()

This commit is contained in:
2026-03-21 10:36:54 +01:00
parent 03f87723d1
commit db36899152
8 changed files with 121 additions and 8 deletions
+3
View File
@@ -72,6 +72,9 @@ void idt_init()
// Each vector handler is 16-byte aligned, so <vector_no>*16 = address of that handler
idt_set_entry(i, vector_0_handler + (i*16), 0);
}
idt_set_entry(0x80, syscall_handler, 0);
idt_load(&idt);
DEBUG("IDT initialized");
}
+26
View File
@@ -0,0 +1,26 @@
/*
* @author xamidev <xamidev@riseup.net>
* @brief System call handling
* @license GPL-3.0-only
*/
#include <arch/x86.h>
#include <kernel.h>
struct cpu_status_t* syscall_handler(struct cpu_status_t* regs)
{
DEBUG("Syscall %lx with argument %lx", regs->rdi, regs->rsi);
switch (regs->rdi)
{
case 0:
break;
case 1:
break;
default:
regs->rsi = 0xdeadbeef;
break;
}
return regs;
}