summaryrefslogtreecommitdiff
path: root/kernel/src/drivers/gpt.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/drivers/gpt.hpp')
-rw-r--r--kernel/src/drivers/gpt.hpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/kernel/src/drivers/gpt.hpp b/kernel/src/drivers/gpt.hpp
index 9f43b54..109ede6 100644
--- a/kernel/src/drivers/gpt.hpp
+++ b/kernel/src/drivers/gpt.hpp
@@ -1,4 +1,32 @@
#pragma once
#include <cstdint>
+struct __attribute__((packed)) gpt_lba1 {
+ std::uint8_t signature[8];
+ std::uint32_t revision;
+ std::uint32_t size;
+ std::uint32_t crc32;
+ std::uint32_t reserved;
+ std::uint64_t current_lba;
+ std::uint64_t other_lba;
+ std::uint64_t first_usable;
+ std::uint64_t last_usable;
+ std::uint8_t guid[16];
+ std::uint64_t partition_lba;
+ std::uint32_t count_partitions;
+ std::uint32_t size_of_partition;
+};
+
+struct __attribute__((packed)) gpt_partition_entry {
+ std::uint8_t guid[16];
+ std::uint8_t unique_guid[16];
+ std::uint64_t start_lba;
+ std::uint64_t end_lba;
+ std::uint64_t attributes;
+ std::uint8_t name[72];
+};
+
+static_assert(sizeof(gpt_partition_entry) == (0x38 + 72));
+static_assert(sizeof(gpt_lba1) == 0x58);
+
#define GPT_SIGNATURE "EFI PART" \ No newline at end of file