miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
Loading...
Searching...
No Matches
gpt.c File Reference
#include <miniOS/drivers/gpt.h>
#include <miniOS/drivers/block_layer.h>
#include <miniOS/io.h>
#include <string.h>
Include dependency graph for gpt.c:

Macros

#define SECTOR_SIZE   512

Functions

static bool guid_is_zero (const gpt_guid_t *g)
int gpt_parse (gpt_partition_t *partitions, int max_count, int *count)

Variables

static const uint8_t GPT_SIG [8] = { 'E', 'F', 'I', ' ', 'P', 'A', 'R', 'T' }

Macro Definition Documentation

◆ SECTOR_SIZE

#define SECTOR_SIZE   512

Function Documentation

◆ gpt_parse()

int gpt_parse ( gpt_partition_t * partitions,
int max_count,
int * count )

gpt_parse() - Read and validate the GPT from the boot disk. @partitions: Output array for parsed partitions. @max_count: Maximum number of entries @partitions can hold. @count: Output: number of valid (non-empty) partition entries found.

Reads LBA 1 (GPT header), validates the "EFI PART" signature and revision, then iterates the partition entry table (default: LBA 2-33) and populates @partitions with all non-empty entries, up to @max_count.

Returns
: 0 on success, -1 if the signature is invalid or an I/O error occurs.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ guid_is_zero()

bool guid_is_zero ( const gpt_guid_t * g)
static
Here is the caller graph for this function:

Variable Documentation

◆ GPT_SIG

const uint8_t GPT_SIG[8] = { 'E', 'F', 'I', ' ', 'P', 'A', 'R', 'T' }
static