diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-06 08:53:21 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-06 08:53:21 +0000 |
| commit | f044a1740f49d632d1436df949fa2285918e5937 (patch) | |
| tree | d68229c56f7f326063cbf5159134e4889424ef22 /arch/x86_64 | |
| parent | f7df7167f0c54bd8da79dbf2d48bda5d7491fd32 (diff) | |
| download | teachos-f044a1740f49d632d1436df949fa2285918e5937.tar.xz teachos-f044a1740f49d632d1436df949fa2285918e5937.zip | |
Remove unused variable declarations
Diffstat (limited to 'arch/x86_64')
| -rw-r--r-- | arch/x86_64/src/kernel/main.cpp | 42 |
1 files changed, 8 insertions, 34 deletions
diff --git a/arch/x86_64/src/kernel/main.cpp b/arch/x86_64/src/kernel/main.cpp index e867bad..3436127 100644 --- a/arch/x86_64/src/kernel/main.cpp +++ b/arch/x86_64/src/kernel/main.cpp @@ -8,42 +8,28 @@ namespace teachos::arch::kernel { auto print_mem_info(arch::memory::memory_info * mem_info) -> void { - using namespace video::vga; - auto mem_lower = mem_info->mem_lower; - auto mem_upper = mem_info->mem_upper; + video::vga::text::write("Memory info low: ", video::vga::text::common_attributes::green_on_black); + video::vga::text::write_number(mem_info->mem_lower, video::vga::text::common_attributes::green_on_black); } auto print_memory_map(arch::memory::memory_map * mminfo) -> void { - using namespace video::vga; - - auto entry_size = mminfo->entry_size; - auto entry_version = mminfo->entry_version; auto remaining_size = mminfo->tag.size - (4 * sizeof(uint32_t)); - auto entry_amount = remaining_size / entry_size; + auto entry_amount = remaining_size / mminfo->entry_size; auto begin = &mminfo->entries; auto end = begin + entry_amount; for (auto entry = begin; entry != end; - entry = (teachos::arch::memory::memory_area *)(((uint8_t *)entry) + ((entry_size + 7) & ~7))) + entry = (teachos::arch::memory::memory_area *)(((uint8_t *)entry) + ((mminfo->entry_size + 7) & ~7))) { - auto base_addr = entry->base_addr; - auto length = entry->length; - auto type = entry->type; - auto reserved = entry->reserved; + video::vga::text::write("Looping Memory area", video::vga::text::common_attributes::green_on_black); } } auto print_elf_sections(arch::memory::elf_symbols_section * symbol) -> void { - using namespace video::vga; - - auto num = symbol->num; - auto entsize = symbol->entsize; - auto shndx = symbol->shndx; - auto begin = &symbol->sections; - auto end = begin + num; + auto end = begin + symbol->num; /* * Loop over the elf section to access the information needed. @@ -53,18 +39,9 @@ namespace teachos::arch::kernel * The increment part aligns the size to an 8-byte address. */ for (auto section = begin; section != end; - section = (teachos::arch::memory::elf_section_header *)(((uint8_t *)section) + ((entsize + 7) & ~7))) + section = (teachos::arch::memory::elf_section_header *)(((uint8_t *)section) + ((symbol->entsize + 7) & ~7))) { - auto sh_name = section->sh_name; - auto sh_type = section->sh_type; - auto sh_flags = section->sh_flags; - auto sh_addr = section->sh_addr; - auto sh_offset = section->sh_offset; - auto sh_size = section->sh_size; - auto sh_link = section->sh_link; - auto sh_info = section->sh_info; - auto sh_addralign = section->sh_addralign; - auto sh_entsize = section->sh_entsize; + video::vga::text::write("Looping Code section", video::vga::text::common_attributes::green_on_black); } } @@ -80,9 +57,6 @@ namespace teachos::arch::kernel (arch::memory::multi_boot_info *)arch::boot::multiboot_information_pointer; auto multiboot_tag = &(multiboot_information_pointer->tags); - auto multiboot_start = arch::boot::multiboot_information_pointer; - auto multiboot_end = arch::boot::multiboot_information_pointer + multiboot_information_pointer->total_size; - /* * Loop over the multiboot2 tags to access the information needed. * Tags are defined in the header file and are padded so that each |
