aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/x86_64/src/kernel/main.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/x86_64/src/kernel/main.cpp b/arch/x86_64/src/kernel/main.cpp
index d94cbba..fa1e464 100644
--- a/arch/x86_64/src/kernel/main.cpp
+++ b/arch/x86_64/src/kernel/main.cpp
@@ -6,6 +6,15 @@
namespace teachos::arch::kernel
{
+ auto assert(bool condition) -> void
+ {
+ video::vga::text::write("Assert failed", video::vga::text::common_attributes::green_on_black);
+ while (!condition)
+ {
+ ;
+ }
+ }
+
auto print_mem_info(arch::memory::memory_info * mem_info) -> void
{
video::vga::text::write("Memory info low: ", video::vga::text::common_attributes::green_on_black);
@@ -14,6 +23,10 @@ namespace teachos::arch::kernel
auto print_memory_map(arch::memory::memory_map * mminfo) -> void
{
+ auto expected_entry_size = mminfo->entry_size;
+ constexpr auto actual_size = sizeof(arch::memory::memory_area);
+ assert(expected_entry_size == actual_size);
+
auto remaining_size = mminfo->tag.size - (4 * sizeof(uint32_t));
auto entry_amount = remaining_size / mminfo->entry_size;