aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Gmür <matteo.gmuer1@ost.ch>2024-10-19 11:25:08 +0000
committerMatteo Gmür <matteo.gmuer1@ost.ch>2024-10-19 11:25:08 +0000
commitb6ce3a41fb53eabc6fde12c13f598d228435642a (patch)
tree90036f29e0e7d70fb5c364bcaeaee602ce2f164b
parentf9ddd266e1ab1a7fcd4952a066083ca19fba63cf (diff)
downloadteachos-b6ce3a41fb53eabc6fde12c13f598d228435642a.tar.xz
teachos-b6ce3a41fb53eabc6fde12c13f598d228435642a.zip
Adjust memory_area structure to grub2 code
-rw-r--r--arch/x86_64/include/arch/memory/multiboot.hpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/arch/x86_64/include/arch/memory/multiboot.hpp b/arch/x86_64/include/arch/memory/multiboot.hpp
index 9cca8bc..8ecb1b5 100644
--- a/arch/x86_64/include/arch/memory/multiboot.hpp
+++ b/arch/x86_64/include/arch/memory/multiboot.hpp
@@ -81,14 +81,24 @@ namespace teachos::arch::memory
};
/**
- * @brief Defines an entry in the entries array of the memory_map struct.
+ * @brief Defines an entry in the entries array of the memory_map struct. Has to have all padding stripped between the
+ * individual values, because the size of the entry needs to be exactly 24 bytes and not one byte more. See
+ * https://www.gnu.org/software/c-intro-and-ref/manual/html_node/Packed-Structures.html for more information on the
+ * used attribute.
*/
- struct memory_area
+ struct __attribute__((packed)) memory_area
{
+ uint32_t size; ///< TODO: Not clear what exactly the size signifies
uint64_t base_address; ///< Base address the memory region starts at
uint64_t area_length; ///< Size of the memory region, added to base_address results in the final address
- alignas(8) memory_area_type type; ///< Specific type of memory the region can contain
+ memory_area_type type; ///< Specific type of memory the region can contain
};
+ /*struct memory_area
+ {
+ uint64_t base_address; ///< Base address the memory region starts at
+ uint64_t area_length; ///< Size of the memory region, added to base_address results in the final address
+ memory_area_type type; ///< Specific type of memory the region can contain
+ };*/
/**
* @brief Defines an entry in the multi_boot_tag array of the multi_boot_info struct, of type