|
Retro Rocket Kernel
BASIC-Powered Operating System
|
#include "kernel.h"Data Structures | |
| struct | partition_t |
| A disk partition on a storage device. More... | |
| struct | partition_table_t |
| A disk partition table consisiting of four partition_t. More... | |
| struct | gpt_header_t |
| struct | gpt_entry_t |
Macros | |
| #define | PARTITION_TABLE_OFFSET 0x1BE |
| #define | PARTITON_GPT_PROTECTIVE 0xEE |
| #define | GUID_ASCII_LEN 36 |
| #define | GUID_BINARY_LEN 16 |
Functions | |
| struct partition_t | __attribute__ ((packed)) partition_t |
| A disk partition on a storage device. More... | |
| bool | find_partition_of_type (const char *device_name, uint8_t partition_type, char *found_guid, const char *partition_type_guid, uint8_t *partition_id, uint64_t *start, uint64_t *length) |
| Given a device name and partition type ID, find the start and length of that partition on the device. Returns false if the partition could not be found. More... | |
| bool | guid_to_binary (const char *guid, void *binary) |
| bool | binary_to_guid (const void *binary, char *guid) |
Variables | |
| uint8_t | bootable |
| Partition is bootable. More... | |
| uint8_t | starthead |
| Starting head. More... | |
| uint16_t | startcylsect |
| Starting cylinder and sector. More... | |
| uint8_t | systemid |
| partition type id More... | |
| uint8_t | endhead |
| End head. More... | |
| uint16_t | endcylsect |
| End cylinder and sector. More... | |
| uint32_t | startlba |
| Starting LBA. More... | |
| uint32_t | length |
| LBA length. More... | |
| partition_t | p_entry [4] |
| Partition entries. More... | |
| char | signature [8] |
| uint32_t | gpt_revision |
| uint32_t | header_size |
| uint32_t | crc_checksum |
| uint32_t | reserved0 |
| uint64_t | lba_of_this_header |
| uint64_t | lba_of_alternative_header |
| uint64_t | first_usable_block |
| uint64_t | last_usable_block |
| uint8_t | disk_guid [16] |
| uint64_t | lba_of_partition_entries |
| uint32_t | number_partition_entries |
| uint32_t | size_of_each_entry |
| uint32_t | crc_32_of_entries |
| uint8_t | reserved1 [] |
| uint8_t | type_guid [16] |
| uint8_t | unique_id [16] |
| uint64_t | start_lba |
| uint64_t | end_lba |
| uint64_t | attributes |
| char | name [72] |
| #define GUID_ASCII_LEN 36 |
| #define GUID_BINARY_LEN 16 |
| #define PARTITION_TABLE_OFFSET 0x1BE |
| #define PARTITON_GPT_PROTECTIVE 0xEE |
| struct partition_t __attribute__ | ( | (packed) | ) |
A disk partition on a storage device.
A disk partition table consisiting of four partition_t.
| bool binary_to_guid | ( | const void * | binary, |
| char * | guid | ||
| ) |
| bool find_partition_of_type | ( | const char * | device_name, |
| uint8_t | partition_type, | ||
| char * | found_guid, | ||
| const char * | partition_type_guid, | ||
| uint8_t * | partition_id, | ||
| uint64_t * | start, | ||
| uint64_t * | length | ||
| ) |
Given a device name and partition type ID, find the start and length of that partition on the device. Returns false if the partition could not be found.
| device_name | Device name |
| partition_type | Partition type ID to find |
| found_guid | filled with the guid of the found partition, if found on a GPT partition |
| partition_id | Partition ID of found partition, filled if found, or 0xFF if found on a GPT partition |
| start | Start of found partition, filled if found |
| length | Length of found partition, filled if found |
| bool guid_to_binary | ( | const char * | guid, |
| void * | binary | ||
| ) |
| uint64_t attributes |
| uint8_t bootable |
Partition is bootable.
| uint32_t crc_32_of_entries |
| uint32_t crc_checksum |
| uint8_t disk_guid[16] |
| uint64_t end_lba |
| uint16_t endcylsect |
End cylinder and sector.
| uint8_t endhead |
End head.
| uint64_t first_usable_block |
| uint32_t gpt_revision |
| uint32_t header_size |
| uint64_t last_usable_block |
| uint64_t lba_of_alternative_header |
| uint64_t lba_of_partition_entries |
| uint64_t lba_of_this_header |
| uint32_t length |
LBA length.
| char name[72] |
| uint32_t number_partition_entries |
| partition_t p_entry[4] |
Partition entries.
| uint32_t reserved0 |
| uint8_t reserved1[] |
| char signature[8] |
| uint32_t size_of_each_entry |
| uint64_t start_lba |
| uint16_t startcylsect |
Starting cylinder and sector.
| uint8_t starthead |
Starting head.
| uint32_t startlba |
Starting LBA.
| uint8_t systemid |
partition type id
| uint8_t type_guid[16] |
| uint8_t unique_id[16] |