]> git.ameliathe1st.gay Git - voyage-au-centre-des-fichiers.git/commitdiff
Changed assert to disable interrupts on assertion failure, before looping hlt
authorAmelia Coutard <eliottulio.coutard@gmail.com>
Wed, 1 Jun 2022 01:24:20 +0000 (03:24 +0200)
committerAmelia Coutard <eliottulio.coutard@gmail.com>
Wed, 1 Jun 2022 01:24:20 +0000 (03:24 +0200)
src/serial.cpp

index 2820cdf66241e0e7fbf2c587d0de42ee0366cb74..e60413ba64a7b5d590a27ee749fa22e47313e85d 100644 (file)
@@ -1,6 +1,7 @@
 #include <cstddef>
 #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(); }
        }
 }