Added kinfo, reduced global state

This commit is contained in:
ssimnb 2026-02-23 12:57:09 +01:00
parent 2213707c6a
commit e72c8fe6fd
30 changed files with 510 additions and 574 deletions

View file

@ -1,6 +1,6 @@
#include <arch/amd64/hal/idt.h>
#include <error.h>
#include <arch/amd64/hal/smp.h>
#include <smp.h>
#include <arch/amd64/hal/timer.h>
#include <kprint.h>
#include <lock.h>
@ -205,8 +205,10 @@ extern void *next_frame(void *addr);
void interrupt_handler(interrupt_frame *r){
//asm("cli");
if(r->int_no < 32){
kprintf("\nOh no! Received interrupt {d}, '{s}'. Below is the provided stack frame\n\n", r->int_no, exception_messages[r->int_no]);
kprintf("\nOh no! Received interrupt 0x{x}, '{s}'. Below is the provided stack frame\n\n", r->int_no, exception_messages[r->int_no]);
if(r->err != 0){
kprintf("error code 0x{xn}", r->err);
@ -235,16 +237,21 @@ void interrupt_handler(interrupt_frame *r){
if(r->int_no == 69){
apic_timer_handler();
return;
}
if(r->int_no == 69 && get_cpu_struct_initialized()
&& get_cpu_struct()->scheduler_initialized){
yield();
return;
}
if(r->int_no == 70){
for(;;){
asm("cli;hlt");
for(;;){
asm("cli");
__builtin_ia32_pause();
}
}
}