a cow based x86_64 operating system, using limine and stivale2
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
918 B

1 year ago
#pragma once
#include "../drivers/storage_interface.h"
typedef struct {
uint64_t low, high;
1 year ago
} __attribute__((packed)) GUID;
1 year ago
1 year ago
typedef struct disk_part {
1 year ago
const struct storage_interface* interface;
uint32_t type;
1 year ago
uint32_t id;
GUID guid;
1 year ago
uint64_t begin;
uint64_t end;
uint64_t attributes;
// null terminated
char name[36];
1 year ago
} disk_part_t;
1 year ago
1 year ago
#define PARTITION_UNKNOWNED 0
// efi system partition
#define PARTITION_ESP 1
#define PARTITION_BIOS 2
#define PARTITION_WINDOWS 3
#define PARTITION_LINUX_FS 4
#define PARTITION_LINUX_ROOT 4
#define PARTITION_LINUX_BOOT 5
#define PARTITION_LINUX_SWAP 6
#define PARTITION_LINUX_HOME 7
#define PARTITION_LINUX_LVM 8
1 year ago
void gpt_scan(const struct storage_interface* sti);
1 year ago
disk_part_t* find_partition(GUID guid);
disk_part_t* search_partition(const char* name);
1 year ago
1 year ago
// release partition information memory
void gpt_cleanup(void);