From 835960fd85989ee961b5a932f467e6e4f545d201 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 5 Aug 2020 21:33:48 +0200 Subject: Added some cpu function wrappers --- src/features/proc.c | 5 +++-- src/features/syscall.c | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/features') diff --git a/src/features/proc.c b/src/features/proc.c index 7acbf03..d0fd66c 100644 --- a/src/features/proc.c +++ b/src/features/proc.c @@ -1,5 +1,6 @@ // MIT License, Copyright (c) 2020 Marvin Borner +#include #include #include #include @@ -70,7 +71,7 @@ struct proc *proc_make() void proc_init() { - __asm__ volatile("cli"); + cli(); current = root = proc_make(); bin_load("/init", root); irq_install_handler(0, scheduler); @@ -81,6 +82,6 @@ void proc_init() *(void **)(&entry) = (u32 *)root->regs.eip; __asm__ volatile("movl %%eax, %%ebp" ::"a"(root->regs.ebp)); __asm__ volatile("movl %%eax, %%esp" ::"a"(root->regs.esp)); - __asm__ volatile("sti"); + sti(); entry(); } diff --git a/src/features/syscall.c b/src/features/syscall.c index c3a758a..50963b7 100644 --- a/src/features/syscall.c +++ b/src/features/syscall.c @@ -15,5 +15,6 @@ void syscall_handler(struct regs *r) void syscall_init() { + idt_set_gate(0x80, (u32)isr128, 0x08, 0x8E); isr_install_handler(0x80, syscall_handler); } -- cgit v1.2.3