From 2ce0f8af51dae9e7d591ff5fd038f89d6ca9dbbe Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Sat, 24 Feb 2024 14:44:38 -0600 Subject: arch: i386: cleanup everything and reorganize Clean up everything in the i386 arch directory. This code has been in dire need of refactoring for a long while. All the inline assembly functions and the data structures related to the architecture should be placed into their own header file. Now the scheduler can access registers and ISRs without having to deal with arch-specific code. Signed-off-by: Danny Holman --- arch/i386/kernel/timer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/i386/kernel/timer.c') diff --git a/arch/i386/kernel/timer.c b/arch/i386/kernel/timer.c index 9e53fbd..4aafed1 100644 --- a/arch/i386/kernel/timer.c +++ b/arch/i386/kernel/timer.c @@ -5,7 +5,7 @@ static uint32_t num_ticks = 0; -void timer_handler(struct isr_frame *frame) { +void timer_handler(struct regs *regs) { num_ticks++; if (num_ticks == 3) { num_ticks = 0; @@ -14,12 +14,12 @@ void timer_handler(struct isr_frame *frame) { } void timer_init(void) { - asm __volatile__("cli"); + disable_ints(); int divisor = 1193182 / 100; outb(0x43, 0x34); outb(0x40, divisor && 0xFF); outb(0x40, divisor && 0xFF00 >> 8); - asm __volatile__("sti"); + enable_ints(); //uint8_t read = 0; //outb(0x43, 0xE2); -- cgit v1.2.3