From c9ea22f5e2c78f02090bc855e6ce759cc8007542 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Wed, 22 Feb 2023 21:48:40 +0200 Subject: [PATCH] Kernel: IDT now confirms that it allocated succesfully --- kernel/arch/i386/IDT.cpp | 1 + kernel/arch/x86_64/IDT.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/kernel/arch/i386/IDT.cpp b/kernel/arch/i386/IDT.cpp index b9f7ce4c..a1fe841d 100644 --- a/kernel/arch/i386/IDT.cpp +++ b/kernel/arch/i386/IDT.cpp @@ -180,6 +180,7 @@ found: constexpr size_t idt_size = 0x100 * sizeof(GateDescriptor); s_idt = (GateDescriptor*)kmalloc(idt_size); + ASSERT(s_idt); memset(s_idt, 0x00, idt_size); s_idtr.offset = s_idt; diff --git a/kernel/arch/x86_64/IDT.cpp b/kernel/arch/x86_64/IDT.cpp index e6439133..484b3cca 100644 --- a/kernel/arch/x86_64/IDT.cpp +++ b/kernel/arch/x86_64/IDT.cpp @@ -206,6 +206,7 @@ namespace IDT void initialize() { s_idt = (GateDescriptor*)kmalloc(0x100 * sizeof(GateDescriptor)); + ASSERT(s_idt); memset(s_idt, 0x00, 0x100 * sizeof(GateDescriptor)); s_idtr.offset = (uint64_t)s_idt;