Add kprintf for DEBUG(); differentiated from printf()
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user