aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/kernel/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/src/kernel/main.cpp')
-rw-r--r--arch/x86_64/src/kernel/main.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/arch/x86_64/src/kernel/main.cpp b/arch/x86_64/src/kernel/main.cpp
index 40b2fe5..01c955b 100644
--- a/arch/x86_64/src/kernel/main.cpp
+++ b/arch/x86_64/src/kernel/main.cpp
@@ -28,6 +28,7 @@ namespace teachos::arch::kernel
auto print_memory_map(arch::memory::memory_map * mminfo) -> void
{
+ // TODO: Probably same issue as elf sections because the values are kind of weird as well
auto expected_entry_size = mminfo->entry_size;
constexpr auto actual_entry_size = sizeof(arch::memory::memory_area);
assert(expected_entry_size == actual_entry_size);
@@ -45,23 +46,20 @@ namespace teachos::arch::kernel
auto print_elf_sections(arch::memory::elf_symbols_section * symbol) -> void
{
+ // TODO: Check if sectiosn now actually match the elf file
auto expected_entry_size = symbol->entry_size;
constexpr auto actual_entry_size = sizeof(arch::memory::elf_section_header);
assert(expected_entry_size == actual_entry_size);
auto expected_total_size = symbol->tag.size;
auto actual_total_entry_size = actual_entry_size * symbol->number_of_sections;
- constexpr auto actual_total_section_size =
- sizeof(arch::memory::elf_symbols_section) - actual_entry_size - sizeof(uint32_t);
+ constexpr auto actual_total_section_size = sizeof(arch::memory::elf_symbols_section) - sizeof(uint32_t);
auto actual_total_size = actual_total_entry_size + actual_total_section_size;
assert(expected_total_size == actual_total_size);
- auto begin = &symbol->sections;
+ auto begin = reinterpret_cast<arch::memory::elf_section_header *>(&symbol->end);
auto end = begin + symbol->number_of_sections;
- // TODO: Last value is completly wrong, should show 0 but shows huge value for size of entries in the table of the
- // SHT_NULL elf section entry. Memory around value also make no sense and look even worse? But according to api
- // value should be zero :(
- // assert(begin->is_null());
+ assert(begin->is_null());
std::size_t symbol_table_section_count = 0U;
std::size_t dynamic_section_count = 0U;
@@ -80,9 +78,8 @@ namespace teachos::arch::kernel
video::vga::text::write("Looping Code section", video::vga::text::common_attributes::green_on_black);
}
- // TODO: Contains two symbol tables and 4 dynamic sections, that is definetly wrong, perhaps same reason as above?
assert(symbol_table_section_count == 1U);
- assert(dynamic_section_count == 1U);
+ assert(dynamic_section_count <= 1U);
}
auto main() -> void