NeKernel dev
Loading...
Searching...
No Matches
EPM.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
10
11#ifndef FIRMWAREKIT_EPM_H
12#define FIRMWAREKIT_EPM_H
13
14#include <NeKit/Config.h>
15
16#define kEPMNameLength (32)
17#define kEPMFilesystemLength (16)
18#define kEPMMagicLength (5)
19
20/* @brief AMD64 magic for EPM */
21#define kEPMMagic86 "EPMAM"
22
23/* @brief RISC-V magic for EPM */
24#define kEPMMagicRISCV "EPMRV"
25
26/* @brief ARM magic for EPM */
27#define kEPMMagicARM "EPMAR"
28
29/* @brief 64x0 magic for EPM */
30#define kEPMMagic64k "EPM64"
31
32/* @brief 32x0 magic for EPM */
33#define kEPMMagic32k "EPM32"
34
35/* @brief POWER magic for EPM */
36#define kEPMMagicPPC "EPMPC"
37
38/* @brief Invalid magic for EPM */
39#define kEPMMagicError "EPM??"
40
41#ifdef __NE_AMD64__
42#define kEPMMagic kEPMMagic86
43#else
44#ifdef __NE_ARM64__
45#define kEPMMagic kEPMMagicARM
46#else
47#define kEPMMagic kEPMMagicError
48#endif
49#endif
50
53#define kEPMPartBlockLba (sizeof(EPM_PART_BLOCK))
54
56#define kEPMRevisionBcd (0x0100)
57
59#define kEPMBootBlockLba (0U)
60
61#define kEPMReserveLen (399)
62
63struct EPM_GUID;
64struct EPM_PART_BLOCK;
65
66/* The first 0 > 128 addresses of a disk contains these headers. */
67
75
95
98
99enum {
101 kEPMGeneric = 0xcf,
102 kEPMLinux = 0x8f,
103 kEPMBSD = 0x9f,
105 kEPMLegacy = 0x2f,
108};
109
110inline EPM_GUID kEPMNilGuid = {0x0U, 0x0U, 0x0U, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}};
111
112#endif // ifndef FIRMWAREKIT_EPM_H
#define PACKED
#define kEPMMagicLength
Definition EPM.h:18
@ kEPMNeKernel
BSD on EPM.
Definition EPM.h:104
@ kEPMLinux
Generic OS.
Definition EPM.h:102
@ kEPMGeneric
Definition EPM.h:101
@ kEPMLegacy
NeKernel.
Definition EPM.h:105
@ kEPMBSD
Linux on EPM.
Definition EPM.h:103
@ kEPMInvalidOS
Legacy VMKernel.
Definition EPM.h:107
@ kEPMInvalid
Definition EPM.h:100
#define kEPMFilesystemLength
Definition EPM.h:17
EPM_GUID kEPMNilGuid
Definition EPM.h:110
#define kEPMNameLength
The Explicit Partition Map scheme.
Definition EPM.h:16
#define kEPMReserveLen
Definition EPM.h:61
char Char
Definition Config.h:51
__UINT16_TYPE__ UInt16
Definition Config.h:40
__INT64_TYPE__ Int64
Definition Config.h:46
__UINT8_TYPE__ UInt8
Definition Config.h:55
__UINT32_TYPE__ UInt32
Definition Config.h:44
__INT32_TYPE__ Int32
Definition Config.h:38
__INT16_TYPE__ Int16
Definition Config.h:42
EPM GUID structure.
Definition EPM.h:69
Kernel::UInt16 Data2
Definition EPM.h:71
Kernel::UInt16 Data3
Definition EPM.h:72
Kernel::UInt8 Data4[8]
Definition EPM.h:73
Kernel::UInt32 Data1
Definition EPM.h:70
The EPM boot block.
Definition EPM.h:80
Kernel::Char Name[kEPMNameLength]
Definition EPM.h:82
Kernel::Int64 LbaStart
Definition EPM.h:87
Kernel::Char Reserved[kEPMReserveLen]
Definition EPM.h:93
Kernel::Int16 Flags
Definition EPM.h:90
Kernel::Int64 LbaEnd
Definition EPM.h:88
Kernel::Char Fs[kEPMFilesystemLength]
Definition EPM.h:92
Kernel::Int32 FsVersion
Definition EPM.h:91
EPM_GUID Guid
Definition EPM.h:83
Kernel::Int32 Version
Definition EPM.h:84
Kernel::Int64 SectorSz
Definition EPM.h:86
Kernel::Int64 NumBlocks
Definition EPM.h:85
Kernel::Int16 Kind
Definition EPM.h:89
Kernel::Char Magic[kEPMMagicLength]
Definition EPM.h:81