From: Amelia Coutard Date: Wed, 1 Jun 2022 01:24:20 +0000 (+0200) Subject: Changed assert to disable interrupts on assertion failure, before looping hlt X-Git-Url: https://git.ameliathe1st.gay/?a=commitdiff_plain;h=faa060e73f0306b57e3a4e0f3b15acd3d812d4c5;p=voyage-au-centre-des-fichiers.git Changed assert to disable interrupts on assertion failure, before looping hlt --- diff --git a/src/serial.cpp b/src/serial.cpp index 2820cdf..e60413b 100644 --- a/src/serial.cpp +++ b/src/serial.cpp @@ -1,6 +1,7 @@ #include #include "serial.hpp" #include "utils.hpp" +#include "interrupts.hpp" bool os::init_serial_port() { outb(serial_port + 1, 0x00); // Disable interrupts. @@ -68,6 +69,7 @@ void os::assert(bool cond, const char* diagnostic) { if (!cond) { os::print("Error: "); os::println(diagnostic); + os::cli(); while (true) { os::hlt(); } } }