diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-06 09:58:17 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-06 09:58:17 +0000 |
| commit | 1b33fc5746be4d23b1c4adacc02263fbcf994524 (patch) | |
| tree | be5b588bf13aaaf3304084409bf76ca8967ebc42 /arch/x86_64/src | |
| parent | 8e3c15daad14dfba76444d83bc4133acd00eaf8a (diff) | |
| download | teachos-1b33fc5746be4d23b1c4adacc02263fbcf994524.tar.xz teachos-1b33fc5746be4d23b1c4adacc02263fbcf994524.zip | |
Add assert method
Diffstat (limited to 'arch/x86_64/src')
| -rw-r--r-- | arch/x86_64/src/kernel/main.cpp | 13 |
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; |
