diff options
author | Danny Holman <dholman@gymli.org> | 2024-05-29 00:30:10 -0500 |
---|---|---|
committer | Danny Holman <dholman@gymli.org> | 2024-05-29 00:30:10 -0500 |
commit | 32441640aa2e78fd4aa8db00ec07a62c9d12f2d2 (patch) | |
tree | 92c4799926f6350480118f0a737577143d5726c9 | |
parent | ffc782f8740027d21793c37c6094ebed06d1dfd2 (diff) |
arch: i386: remove last refs to moved headers
Remove all the remaining references to headers that were moved into the
libk.
Signed-off-by: Danny Holman <dholman@gymli.org>
-rw-r--r-- | arch/i386/include/kernel/syscall.h | 3 | ||||
-rw-r--r-- | arch/i386/include/kernel/timer.h | 2 | ||||
-rw-r--r-- | arch/i386/kernel/syscall.c | 27 | ||||
-rw-r--r-- | arch/i386/kernel/timer.c | 8 |
4 files changed, 13 insertions, 27 deletions
diff --git a/arch/i386/include/kernel/syscall.h b/arch/i386/include/kernel/syscall.h index 88ee59a..a689183 100644 --- a/arch/i386/include/kernel/syscall.h +++ b/arch/i386/include/kernel/syscall.h @@ -26,8 +26,9 @@ #define SYS_CLOSE 18 #define SYS_EXEC 19 +#define SYS_HALT 87 #define SYS_REBOOT 88 -int handle_syscall(struct regs *regs); +int handle_syscall(struct isr_frame *frame); #endif diff --git a/arch/i386/include/kernel/timer.h b/arch/i386/include/kernel/timer.h index 1bc2855..c0b3a73 100644 --- a/arch/i386/include/kernel/timer.h +++ b/arch/i386/include/kernel/timer.h @@ -3,7 +3,7 @@ #include <kernel/asm.h> -void timer_handler(struct regs *regs); +void timer_handler(struct isr_frame *frame); void timer_init(void); #endif diff --git a/arch/i386/kernel/syscall.c b/arch/i386/kernel/syscall.c index 27e1c60..e8b69a2 100644 --- a/arch/i386/kernel/syscall.c +++ b/arch/i386/kernel/syscall.c @@ -1,33 +1,22 @@ #include <kernel/syscall.h> #include <kernel/panic.h> -#include <kernel/framebuffer.h> -#include <kernel/keyboard.h> -#include <kernel/string.h> -#include <kernel/io.h> +#include <libk/string.h> +#include <libk/io.h> #include <stddef.h> -extern char *keyboard_buffer; -extern uint32_t kbuf_pos; - -void sys_read(struct regs *regs) { - if (regs->ebx == 1) { - while (kbuf_pos > regs->edx); - memcpy((char*)regs->ecx, keyboard_buffer, regs->edx); - } +void sys_read(struct isr_frame *frame) { } -void sys_write(struct regs *regs) { - if (regs->ebx == 0) - fb_write((char*)regs->ecx, regs->edx); +void sys_write(struct isr_frame *frame) { } -int handle_syscall(struct regs *regs) { - switch (regs->eax) { +int handle_syscall(struct isr_frame *frame) { + switch (frame->eax) { case SYS_READ: - sys_read(regs); + sys_read(frame); break; case SYS_WRITE: - sys_write(regs); + sys_write(frame); break; default: panic("Invalid system call number"); diff --git a/arch/i386/kernel/timer.c b/arch/i386/kernel/timer.c index e93c291..a7d88dd 100644 --- a/arch/i386/kernel/timer.c +++ b/arch/i386/kernel/timer.c @@ -4,11 +4,11 @@ static uint32_t num_ticks = 0; -void timer_handler(struct regs *regs) { +void timer_handler(struct isr_frame *frame) { num_ticks++; if (num_ticks == 3) { num_ticks = 0; - //schedule_next(); + schedule_next(); } } @@ -20,9 +20,5 @@ void timer_init(void) { outb(0x40, divisor && 0xFF00 >> 8); enable_ints(); - //uint8_t read = 0; - //outb(0x43, 0xE2); - //read = inb(0x40); - register_irq_handler(0, timer_handler); } |