aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64')
-rw-r--r--arch/x86_64/include/x86_64/boot/ld.hpp12
-rw-r--r--arch/x86_64/scripts/kernel.ld8
-rw-r--r--arch/x86_64/src/memory.cpp2
3 files changed, 11 insertions, 11 deletions
diff --git a/arch/x86_64/include/x86_64/boot/ld.hpp b/arch/x86_64/include/x86_64/boot/ld.hpp
index 6051dd7..51eb23b 100644
--- a/arch/x86_64/include/x86_64/boot/ld.hpp
+++ b/arch/x86_64/include/x86_64/boot/ld.hpp
@@ -20,28 +20,28 @@
namespace teachos::x86_64::boot
{
/**
- * @var _start_linear
+ * @var _start_physical
* @brief The first byte of the loaded kernel image.
*
* @details
* This symbols is defined in the kernel linker script and marks the start of the kernel image in physical memory.
* To use this symbol for its intended purpose, the address of it shall be taken.
*
- * @see _end_linear
+ * @see _end_physical
*/
- extern "C" std::byte _start_linear;
+ extern "C" std::byte _start_physical;
/**
- * @var _end_linear
+ * @var _end_physical
* @brief The first byte after the loaded kernel image.
*
* @details
* This symbols is defined in the kernel linker script and marks the end of the kernel image in physical memory.
* To use this symbol for its intended purpose, the address of it shall be taken.
*
- * @see _start_linear
+ * @see _start_physical
*/
- extern "C" std::byte _end_linear;
+ extern "C" std::byte _end_physical;
} // namespace teachos::x86_64::boot
#endif
diff --git a/arch/x86_64/scripts/kernel.ld b/arch/x86_64/scripts/kernel.ld
index 3d9a7ae..8af242f 100644
--- a/arch/x86_64/scripts/kernel.ld
+++ b/arch/x86_64/scripts/kernel.ld
@@ -3,7 +3,7 @@ ENTRY(_start)
/*****************************************************************************
* Virtual and linear start addresses of the TeachOS kernel
*****************************************************************************/
-TEACHOS_LOW = 1M;
+TEACHOS_PMA = 1M;
PHDRS {
boot_rodata PT_LOAD FLAGS(4);
@@ -22,14 +22,14 @@ SECTIONS
* 32-Bit mode, so we want to live down low, but we need to leave the 1MiB
* hole open since some BIOS functionality resides below it.
***************************************************************************/
- . = TEACHOS_LOW;
+ . = TEACHOS_PMA;
/***************************************************************************
* We want to be able to be able to access all memory (linear and virtual)
* during bootstrapping and operation. To achieve this, we define some
* symbols at the beginning.
***************************************************************************/
- _start_linear = .;
+ _start_physical = .;
_start_virtual = .;
/***************************************************************************
@@ -144,7 +144,7 @@ SECTIONS
* symbols to mark the end of our loaded image.
***************************************************************************/
_end_virtual = ADDR(.bss) + SIZEOF(.bss);
- _end_linear = _end_virtual;
+ _end_physical = _end_virtual;
/DISCARD/ : { *(.comment) }
}
diff --git a/arch/x86_64/src/memory.cpp b/arch/x86_64/src/memory.cpp
index 105d69b..b6901a5 100644
--- a/arch/x86_64/src/memory.cpp
+++ b/arch/x86_64/src/memory.cpp
@@ -25,7 +25,7 @@ namespace teachos::arch::memory
auto const & mbi = multiboot_information_pointer.get();
auto map = mbi->memory_map();
- return {std::make_pair(physical_address{&_start_linear}, physical_address{&_end_linear}),
+ return {std::make_pair(physical_address{&_start_physical}, physical_address{&_end_physical}),
std::make_pair(physical_address{std::bit_cast<std::byte *>(&mbi)},
physical_address{std::bit_cast<std::byte *>(&mbi) + mbi->size_bytes()}),
map};