NeKernel
dev
Loading...
Searching...
No Matches
GPT.h
Go to the documentation of this file.
1
/* ========================================
2
3
Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
4
5
======================================== */
6
7
#pragma once
8
9
#include <
FirmwareKit/EFI/EFI.h
>
10
#include <
NeKit/Config.h
>
11
12
#define kSectorAlignGPT_PartTbl (420U)
13
#define kSectorAlignGPT_PartEntry (72U)
14
#define kMagicLenGPT (8U)
15
#define kMagicGPT ("EFI PART")
// "EFI PART"
16
#define kGPTPartitionTableLBA (512U + sizeof(GPT_PARTITION_TABLE))
17
18
namespace
Kernel
{
19
struct
GPT_PARTITION_TABLE
;
20
struct
GPT_PARTITION_ENTRY
;
21
22
struct
PACKED
GPT_PARTITION_TABLE
final {
23
Char
Signature
[
kMagicLenGPT
];
24
UInt32
Revision
;
25
UInt32
HeaderSize
;
26
UInt32
CRC32
;
27
UInt32
Reserved1
;
28
UInt64
LBAHeader
;
29
UInt64
LBAAltHeader
;
30
UInt64
FirstGPTEntry
;
31
UInt64
LastGPTEntry
;
32
EFI_GUID
Guid
;
33
UInt64
StartingLBA
;
34
UInt32
NumPartitionEntries
;
35
UInt32
SizeOfEntries
;
36
UInt32
CRC32PartEntry
;
37
UInt8
Reserved2
[
kSectorAlignGPT_PartTbl
];
38
};
39
40
struct
PACKED
GPT_PARTITION_ENTRY
{
41
EFI_GUID
PartitionTypeGUID
;
42
EFI_GUID
UniquePartitionGUID
;
43
UInt64
StartLBA
;
44
UInt64
EndLBA
;
45
UInt64
Attributes
;
46
UInt8
Name
[
kSectorAlignGPT_PartEntry
];
47
};
48
}
// namespace Kernel
EFI.h
EFI_GUID
struct EFI_GUID EFI_FINAL EFI_GUID
GUID type, something you can also find in CFKit.
PACKED
#define PACKED
kMagicLenGPT
#define kMagicLenGPT
Definition
GPT.h:14
kSectorAlignGPT_PartTbl
#define kSectorAlignGPT_PartTbl
Definition
GPT.h:12
kSectorAlignGPT_PartEntry
#define kSectorAlignGPT_PartEntry
Definition
GPT.h:13
Config.h
Kernel
UPS inline definitions.
Definition
Device.h:12
Kernel::Char
char Char
Definition
Config.h:51
Kernel::UInt8
__UINT8_TYPE__ UInt8
Definition
Config.h:55
Kernel::UInt32
__UINT32_TYPE__ UInt32
Definition
Config.h:44
Kernel::UInt64
__UINT64_TYPE__ UInt64
Definition
Config.h:48
Kernel::GPT_PARTITION_ENTRY
Definition
GPT.h:40
Kernel::GPT_PARTITION_ENTRY::Attributes
UInt64 Attributes
Definition
GPT.h:45
Kernel::GPT_PARTITION_ENTRY::EndLBA
UInt64 EndLBA
Definition
GPT.h:44
Kernel::GPT_PARTITION_ENTRY::UniquePartitionGUID
EFI_GUID UniquePartitionGUID
Definition
GPT.h:42
Kernel::GPT_PARTITION_ENTRY::Name
UInt8 Name[kSectorAlignGPT_PartEntry]
Definition
GPT.h:46
Kernel::GPT_PARTITION_ENTRY::PartitionTypeGUID
EFI_GUID PartitionTypeGUID
Definition
GPT.h:41
Kernel::GPT_PARTITION_ENTRY::StartLBA
UInt64 StartLBA
Definition
GPT.h:43
Kernel::GPT_PARTITION_TABLE
Definition
GPT.h:22
Kernel::GPT_PARTITION_TABLE::FirstGPTEntry
UInt64 FirstGPTEntry
Definition
GPT.h:30
Kernel::GPT_PARTITION_TABLE::NumPartitionEntries
UInt32 NumPartitionEntries
Definition
GPT.h:34
Kernel::GPT_PARTITION_TABLE::LBAAltHeader
UInt64 LBAAltHeader
Definition
GPT.h:29
Kernel::GPT_PARTITION_TABLE::HeaderSize
UInt32 HeaderSize
Definition
GPT.h:25
Kernel::GPT_PARTITION_TABLE::Signature
Char Signature[kMagicLenGPT]
Definition
GPT.h:23
Kernel::GPT_PARTITION_TABLE::Guid
EFI_GUID Guid
Definition
GPT.h:32
Kernel::GPT_PARTITION_TABLE::StartingLBA
UInt64 StartingLBA
Definition
GPT.h:33
Kernel::GPT_PARTITION_TABLE::Revision
UInt32 Revision
Definition
GPT.h:24
Kernel::GPT_PARTITION_TABLE::Reserved1
UInt32 Reserved1
Definition
GPT.h:27
Kernel::GPT_PARTITION_TABLE::SizeOfEntries
UInt32 SizeOfEntries
Definition
GPT.h:35
Kernel::GPT_PARTITION_TABLE::CRC32PartEntry
UInt32 CRC32PartEntry
Definition
GPT.h:36
Kernel::GPT_PARTITION_TABLE::LBAHeader
UInt64 LBAHeader
Definition
GPT.h:28
Kernel::GPT_PARTITION_TABLE::CRC32
UInt32 CRC32
Definition
GPT.h:26
Kernel::GPT_PARTITION_TABLE::LastGPTEntry
UInt64 LastGPTEntry
Definition
GPT.h:31
Kernel::GPT_PARTITION_TABLE::Reserved2
UInt8 Reserved2[kSectorAlignGPT_PartTbl]
Definition
GPT.h:37
src
kernel
FirmwareKit
GPT.h
Generated by
1.15.0