diff options
Diffstat (limited to 'arch/x86_64')
| -rw-r--r-- | arch/x86_64/include/arch/memory/multiboot.hpp | 16 |
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 |
