diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-08 11:30:01 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-08 11:30:01 +0000 |
| commit | 7edd03e9a14a3025b4d2b2ff51d838d20b79b2c4 (patch) | |
| tree | d156c915f05067ea699522f0705863917b00558a /arch/x86_64/src | |
| parent | bb2089599007fb5e25e613e67088a05731df4347 (diff) | |
| download | teachos-7edd03e9a14a3025b4d2b2ff51d838d20b79b2c4.tar.xz teachos-7edd03e9a14a3025b4d2b2ff51d838d20b79b2c4.zip | |
Added doxygen comments to all fields and structs
Diffstat (limited to 'arch/x86_64/src')
| -rw-r--r-- | arch/x86_64/src/kernel/main.cpp | 3 | ||||
| -rw-r--r-- | arch/x86_64/src/memory/multiboot.cpp | 41 |
2 files changed, 44 insertions, 0 deletions
diff --git a/arch/x86_64/src/kernel/main.cpp b/arch/x86_64/src/kernel/main.cpp index 2ba4fe2..6486b7c 100644 --- a/arch/x86_64/src/kernel/main.cpp +++ b/arch/x86_64/src/kernel/main.cpp @@ -63,6 +63,9 @@ namespace teachos::arch::kernel // value should be zero :( // assert(begin->is_null()); + // TODO: Check if only contains one DYNSYM or SYMTAB but not both! + // TODO: Check if only contains one dynamic section + for (auto section = begin; section != end; ++section) { video::vga::text::write("Looping Code section", video::vga::text::common_attributes::green_on_black); diff --git a/arch/x86_64/src/memory/multiboot.cpp b/arch/x86_64/src/memory/multiboot.cpp new file mode 100644 index 0000000..91e7550 --- /dev/null +++ b/arch/x86_64/src/memory/multiboot.cpp @@ -0,0 +1,41 @@ +#include "multiboot.hpp" + +namespace teachos::arch::memory +{ + auto elf_section_flags::writeable() const -> bool { return is_bit_set(0); } + + auto elf_section_flags::occupies_memory() const -> bool { return is_bit_set(1); } + + auto elf_section_flags::is_executable() const -> bool { return is_bit_set(2); } + + auto elf_section_flags::contains_duplicate_data() const -> bool { return is_bit_set(4); } + + auto elf_section_flags::contains_strings() const -> bool { return is_bit_set(5); } + + auto elf_section_flags::section_header_info_is_section_header_table_index() const -> bool { return is_bit_set(6); } + + auto elf_section_flags::preserve_ordering_after_combination() const -> bool { return is_bit_set(7); } + + auto elf_section_flags::requires_special_os_processing() const -> bool { return is_bit_set(8); } + + auto elf_section_flags::is_section_group_member() const -> bool { return is_bit_set(9); } + + auto elf_section_flags::holds_thread_local_data() const -> bool { return is_bit_set(10); } + + auto elf_section_flags::is_compressed() const -> bool { return is_bit_set(11); } + + auto elf_section_flags::has_special_ordering_requirements() const -> bool { return is_bit_set(30); } + + auto elf_section_flags::is_excluded_unless_referenced_or_allocated() const -> bool { return is_bit_set(31); } + + auto elf_section_flags::operator==(elf_section_flags const & other) const -> bool { return flags == other.flags; } + + auto elf_section_flags::is_bit_set(uint8_t index) const -> bool { return flags[index] == 1; } + + auto elf_section_header::is_null() const -> bool + { + return name_table_index == 0U && type == elf_section_type::UNSPECIFIED && + flags == teachos::arch::memory::elf_section_flags{0U} && virtual_address == 0U && file_offset == 0U && + additional_information == 0U && address_alignment == 0U && fixed_table_entry_size == 0U; + } +} // namespace teachos::arch::memory |
