aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/memory/multiboot
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/src/memory/multiboot')
-rw-r--r--arch/x86_64/src/memory/multiboot/elf_symbols_section.cpp2
-rw-r--r--arch/x86_64/src/memory/multiboot/reader.cpp20
2 files changed, 11 insertions, 11 deletions
diff --git a/arch/x86_64/src/memory/multiboot/elf_symbols_section.cpp b/arch/x86_64/src/memory/multiboot/elf_symbols_section.cpp
index 953a57d..f5d126b 100644
--- a/arch/x86_64/src/memory/multiboot/elf_symbols_section.cpp
+++ b/arch/x86_64/src/memory/multiboot/elf_symbols_section.cpp
@@ -7,7 +7,7 @@ namespace teachos::arch::memory::multiboot
auto elf_section_header::is_null() const -> bool
{
return name_table_index == 0U && type == elf_section_type::INACTIVE && flags == elf_section_flags(0U) &&
- virtual_address == 0U && file_offset == 0U && additional_information == 0U && address_alignment == 0U &&
+ physical_address == 0U && file_offset == 0U && additional_information == 0U && address_alignment == 0U &&
fixed_table_entry_size == 0U;
}
} // namespace teachos::arch::memory::multiboot
diff --git a/arch/x86_64/src/memory/multiboot/reader.cpp b/arch/x86_64/src/memory/multiboot/reader.cpp
index 7bdf48f..4576085 100644
--- a/arch/x86_64/src/memory/multiboot/reader.cpp
+++ b/arch/x86_64/src/memory/multiboot/reader.cpp
@@ -56,16 +56,16 @@ namespace teachos::arch::memory::multiboot
elf_section_header_container sections{begin, end};
- auto const elf_section_with_lowest_virtual_address =
+ auto const elf_section_with_lowest_physical_address =
std::ranges::min_element(sections, [](elf_section_header const & a, elf_section_header const & b) {
- return a.virtual_address < b.virtual_address;
+ return a.physical_address < b.physical_address;
});
- auto const elf_section_with_highest_virtual_address =
+ auto const elf_section_with_highest_physical_address =
std::ranges::max_element(sections, [](elf_section_header const & a, elf_section_header const & b) {
- auto a_virtual_address_end = a.virtual_address + a.section_size;
- auto b_virtual_address_end = b.virtual_address + b.section_size;
- return a_virtual_address_end < b_virtual_address_end;
+ auto a_physical_address_end = a.physical_address + a.section_size;
+ auto b_physical_address_end = b.physical_address + b.section_size;
+ return a_physical_address_end < b_physical_address_end;
});
auto const symbol_table_section_count = std::ranges::count_if(sections, [](elf_section_header const & section) {
@@ -81,11 +81,11 @@ namespace teachos::arch::memory::multiboot
dynamic_section_count <= 1U,
"[Multiboot Reader] ELF Specifications allows only (1) or less dynamic sections, but got more");
- auto const lowest_elf_section = *elf_section_with_lowest_virtual_address;
- kernel_start = lowest_elf_section.virtual_address;
+ auto const lowest_elf_section = *elf_section_with_lowest_physical_address;
+ kernel_start = lowest_elf_section.physical_address;
- auto const highest_elf_section = *elf_section_with_highest_virtual_address;
- kernel_end = highest_elf_section.virtual_address + highest_elf_section.section_size;
+ auto const highest_elf_section = *elf_section_with_highest_physical_address;
+ kernel_end = highest_elf_section.physical_address + highest_elf_section.section_size;
return sections;
}