From 42ae768f08f2ec8a41d2ea2183f30a571f0c432f Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 22 Apr 2025 08:48:07 +0200 Subject: dev, kernel: VEPM WiP implementation, and syschk fixes in WiP. - Currently working on VEPM and adapting it to SysChk. - Refactor DriveMgr for VEPM. - Fix warnings in HeFS.cc, ALIGN(8) on HeFS.h - Update PIO modules to use VEPM. Signed-off-by: Amlal El Mahrouss --- dev/kernel/FirmwareKit/EPM.h | 11 +++++++++-- dev/kernel/FirmwareKit/GPT.h | 16 +++------------- dev/kernel/FirmwareKit/VEPM.h | 29 +++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 15 deletions(-) (limited to 'dev/kernel/FirmwareKit') diff --git a/dev/kernel/FirmwareKit/EPM.h b/dev/kernel/FirmwareKit/EPM.h index 548bb9a7..6db82506 100644 --- a/dev/kernel/FirmwareKit/EPM.h +++ b/dev/kernel/FirmwareKit/EPM.h @@ -80,8 +80,8 @@ typedef struct EPM_GUID */ struct PACKED EPM_PART_BLOCK { - Kernel::Char Magic[kEPMMagicLength]; - Kernel::Char Name[kEPMNameLength]; + Kernel::Char Magic[kEPMMagicLength] = {0}; + Kernel::Char Name[kEPMNameLength] = {0}; EPM_GUID Guid; Kernel::Int32 Version; Kernel::Int64 NumBlocks; @@ -108,4 +108,11 @@ enum kEPMInvalidOS = 0xff, }; +inline EPM_GUID kEPMNilGuid = { + 0x0U, + 0x0U, + 0x0U, + { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } +}; + #endif // ifndef FIRMWAREKIT_EPM_H diff --git a/dev/kernel/FirmwareKit/GPT.h b/dev/kernel/FirmwareKit/GPT.h index aab6b650..4be1fed2 100644 --- a/dev/kernel/FirmwareKit/GPT.h +++ b/dev/kernel/FirmwareKit/GPT.h @@ -17,19 +17,9 @@ namespace Kernel { - struct GPT_GUID; struct GPT_PARTITION_TABLE; struct GPT_PARTITION_ENTRY; - /// @brief GPT GUID structure. - typedef struct GPT_GUID - { - Kernel::UInt32 Data1; - Kernel::UInt16 Data2; - Kernel::UInt16 Data3; - Kernel::UInt8 Data4[8]; - } GPT_GUID; - struct PACKED GPT_PARTITION_TABLE final { Char Signature[kMagicLenGPT]; @@ -41,7 +31,7 @@ namespace Kernel UInt64 LBAAltHeader; UInt64 FirstGPTEntry; UInt64 LastGPTEntry; - GPT_GUID Guid; + EfiGUID Guid; UInt64 StartingLBA; UInt32 NumPartitionEntries; UInt32 SizeOfEntries; @@ -51,8 +41,8 @@ namespace Kernel struct PACKED GPT_PARTITION_ENTRY { - GPT_GUID PartitionTypeGUID; - GPT_GUID UniquePartitionGUID; + EfiGUID PartitionTypeGUID; + EfiGUID UniquePartitionGUID; UInt64 StartLBA; UInt64 EndLBA; UInt64 Attributes; diff --git a/dev/kernel/FirmwareKit/VEPM.h b/dev/kernel/FirmwareKit/VEPM.h index 9d8fa4d4..2b95e12d 100644 --- a/dev/kernel/FirmwareKit/VEPM.h +++ b/dev/kernel/FirmwareKit/VEPM.h @@ -8,7 +8,36 @@ #define FIRMWAREKIT_VEPM_H #include +#include /// @brief The Virtual Explicit Partition Map scheme extension. +#ifdef __NE_VEPM__ +#ifdef kEPMMagic +#undef kEPMMagic +#endif // kEPMMagic + +#define kEPMMagic "EPMVM" + +/// @brief VEPM GUID. +/// @note This is the GUID used to identify a VEPM partition. +inline EPM_GUID kVEPMGuidEPM = { + 0x9a1b3f2e, + 0x4c3f, + 0x4d52, + { 0xa7, 0x83, 0x9c, 0x21, 0x7b, 0x5e, 0x4d, 0xac } +}; + +/// @brief VEPM GUID. +/// @note This is the GUID used to identify a VEPM partition (EFI version) +inline EfiGUID kVEPMGuidEFI = { + 0x9a1b3f2e, + 0x4c3f, + 0x4d52, + { 0xa7, 0x83, 0x9c, 0x21, 0x7b, 0x5e, 0x4d, 0xac } +}; + +#define kVEPMGuidStr "9a1b3f2e-4c3f-4d52-a783-9c217b5e4dac" +#endif // __NE_VEPM__ + #endif // FIRMWAREKIT_VEPM_H \ No newline at end of file -- cgit v1.2.3