summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorAmlal <amlal@nekernel.org>2025-05-04 20:06:12 +0200
committerAmlal <amlal@nekernel.org>2025-05-04 20:06:12 +0200
commitcada70508de1c6f614067825683338fcde56caaf (patch)
treeff62c02c5e3339d4a71976559d8b62dd04911c19 /lib
parent1c8414d3348c55fcf132839a04fdedec5efaacbe (diff)
dev: add epm.tex, specification for the Explicit Partition Map.
Signed-off-by: Amlal <amlal@nekernel.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/partition-map.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/partition-map.h b/lib/partition-map.h
index 05ff83f..28d480a 100644
--- a/lib/partition-map.h
+++ b/lib/partition-map.h
@@ -1,6 +1,6 @@
/* -------------------------------------------
- Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved.
+ Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
------------------------------------------- */
@@ -35,8 +35,9 @@
#define EPM_MAGIC "EPMMS" /* mass storage */
#endif
-#define EPM_MAX_BLKS (128) /* 1 on UEFI EPM. */
+#define EPM_MAX_BLKS (128) /* 1 on UEFI EPM, because of it would only fit on a sector. */
+/// @brief Size of a partition block (roughly 512 bytes)
#define EPM_PART_BLK_SZ sizeof(struct part_block)
/// @brief Start of EPM headers.
@@ -81,11 +82,11 @@ typedef struct part_block part_block_t;
///! @brief variant enum.
///! use it in the boot block version field.
enum {
- EPM_INVALID = 0x00,
- EPM_GENERIC_OS = 0xcf,
- EPM_LINUX = 0x8f,
- EPM_BSD = 0x9f,
- EPM_ZKAOS = 0x1f,
+ EPM_INVALID = 0x00,
+ EPM_GENERIC_OS = 0xcf,
+ EPM_LINUX = 0x8f,
+ EPM_BSD = 0x9f,
+ EPM_NEKERNEL_OS = 0x1f,
};
/// @brief check for supported filesystem.
@@ -95,6 +96,8 @@ boolean cb_filesystem_exists(caddr_t fs, size_t len);
bool cb_parse_partition_block_data_at(voidptr_t blob, size_t blob_sz, size_t index, size_t* end_lba,
size_t* start_lba, size_t* sector_sz);
+/// @brief Parse Partition block info at index.
+/// @param index the partition block to parse.
part_block_t* cb_parse_partition_block_at(voidptr_t blob, size_t blob_sz, size_t index);
#endif // ifndef __PARTITION_MAP_H__