From 6877944d179404d4644f83a9f278da5eacee41b1 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Sat, 8 Jan 2022 01:13:55 -0800 Subject: [PATCH] [kernel] Make unknown IRQs a warning, not a panic There's not a good reason for them to panic the kernel, not even the traceback in the panic will be useful. --- src/include/j6/tables/log_areas.inc | 25 +++++++++++++------------ src/kernel/interrupts.cpp | 7 +++---- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/include/j6/tables/log_areas.inc b/src/include/j6/tables/log_areas.inc index c1e766b..7be21fe 100644 --- a/src/include/j6/tables/log_areas.inc +++ b/src/include/j6/tables/log_areas.inc @@ -1,15 +1,16 @@ LOG(apic, info); -LOG(device, debug); -LOG(paging, info); -LOG(driver, info); -LOG(memory, debug); -LOG(fs, info); -LOG(task, info); -LOG(sched, info); -LOG(loader, debug); LOG(boot, debug); -LOG(syscall,info); -LOG(vmem, debug); -LOG(objs, debug); -LOG(timer, debug); LOG(clock, debug); +LOG(device, debug); +LOG(driver, info); +LOG(fs, info); +LOG(irq, info); +LOG(loader, debug); +LOG(memory, debug); +LOG(objs, debug); +LOG(paging, info); +LOG(sched, info); +LOG(syscall,info); +LOG(task, debug); +LOG(timer, debug); +LOG(vmem, debug); diff --git a/src/kernel/interrupts.cpp b/src/kernel/interrupts.cpp index 9d519a5..5e52cf1 100644 --- a/src/kernel/interrupts.cpp +++ b/src/kernel/interrupts.cpp @@ -7,6 +7,7 @@ #include "idt.h" #include "interrupts.h" #include "io.h" +#include "log.h" #include "memory.h" #include "objects/process.h" #include "printf/printf.h" @@ -169,10 +170,8 @@ irq_handler(cpu_state *regs) { uint8_t irq = get_irq(regs->interrupt); if (! device_manager::get().dispatch_irq(irq)) { - char message[100]; - snprintf(message, sizeof(message), - "Unknown IRQ: %d (vec 0x%lx)", irq, regs->interrupt); - kassert(false, message); + log::warn(logs::irq, "Unknown IRQ: %d (vec 0x%lx)", + irq, regs->interrupt); } *reinterpret_cast(apic_eoi_addr) = 0;