forked from Bananymous/banan-os
Kernel/Userspace: Start initial work on userspace and syscalls
This commit is contained in:
@@ -148,6 +148,12 @@ namespace IDT
|
||||
descriptor.flags = 0x8E;
|
||||
}
|
||||
|
||||
static void register_syscall_handler(uint8_t index, void(*handler)())
|
||||
{
|
||||
register_interrupt_handler(index, handler);
|
||||
s_idt[index].flags = 0xEE;
|
||||
}
|
||||
|
||||
void register_irq_handler(uint8_t irq, void(*handler)())
|
||||
{
|
||||
s_irq_handlers[irq] = handler;
|
||||
@@ -203,6 +209,8 @@ namespace IDT
|
||||
extern "C" void irq14();
|
||||
extern "C" void irq15();
|
||||
|
||||
extern "C" void syscall_asm();
|
||||
|
||||
void initialize()
|
||||
{
|
||||
s_idt = (GateDescriptor*)kmalloc(0x100 * sizeof(GateDescriptor));
|
||||
@@ -262,6 +270,8 @@ namespace IDT
|
||||
REGISTER_IRQ_HANDLER(14);
|
||||
REGISTER_IRQ_HANDLER(15);
|
||||
|
||||
register_syscall_handler(0x80, syscall_asm);
|
||||
|
||||
flush_idt();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user