diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-19 11:25:08 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-19 11:25:08 +0000 |
| commit | b6ce3a41fb53eabc6fde12c13f598d228435642a (patch) | |
| tree | 90036f29e0e7d70fb5c364bcaeaee602ce2f164b /arch | |
| parent | f9ddd266e1ab1a7fcd4952a066083ca19fba63cf (diff) | |
| download | teachos-b6ce3a41fb53eabc6fde12c13f598d228435642a.tar.xz teachos-b6ce3a41fb53eabc6fde12c13f598d228435642a.zip | |
Adjust memory_area structure to grub2 code
Diffstat (limited to 'arch')
| -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 |
