From faa060e73f0306b57e3a4e0f3b15acd3d812d4c5 Mon Sep 17 00:00:00 2001
From: Amelia Coutard <eliottulio.coutard@gmail.com>
Date: Wed, 1 Jun 2022 03:24:20 +0200
Subject: [PATCH] Changed assert to disable interrupts on assertion failure,
 before looping hlt

---
 src/serial.cpp | 2 ++
 1 file changed, 2 insertions(+)

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 <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(); }
 	}
 }
-- 
2.46.0