|
ginnOS
The reference: libc, the libraries and the kernel
|
#include "block_device.h"Go to the source code of this file.
Data Structures | |
| struct | partition_device_t |
| partition device structure representing a partition on a block device. More... | |
Macros | |
| #define | GINNOS_ROOT_LABEL "GINNOS_EXT2" |
Functions | |
| bool | partition_initialize (partition_device_t *part, block_device_t *parent, uint32_t start_lba) |
| initialize a partition wrapper device around a parent block device. | |
| bool | partition_detect_ext2 (partition_device_t *part, block_device_t *parent) |
| detect an EXT2 partition on parent block device and initialize partition wrapper. | |
| bool | partition_is_ginnos_root (block_device_t *device) |
| check that an ext2 filesystem on a block device has the ginnOS root label. | |
| bool | partition_find_ginnos_root (partition_device_t *part, block_device_t *parent) |
| find the partition with the ginnOS root label on a disk: the primary MBR partitions, or the GPT partitions if the MBR is a protective one (type 0xEE). | |
| #define GINNOS_ROOT_LABEL "GINNOS_EXT2" |
| bool partition_initialize | ( | partition_device_t * | part, |
| block_device_t * | parent, | ||
| uint32_t | start_lba ) |
initialize a partition wrapper device around a parent block device.
| part | partition device object to initialize. |
| parent | parent block device backend. |
| start_lba | starting LBA sector of partition. |
| bool partition_detect_ext2 | ( | partition_device_t * | part, |
| block_device_t * | parent ) |
detect an EXT2 partition on parent block device and initialize partition wrapper.
checks MBR partition table and candidate LBAs (63, 2048, 0).
| part | partition device object to initialize. |
| parent | parent block device backend. |
| bool partition_is_ginnos_root | ( | block_device_t * | device | ) |
check that an ext2 filesystem on a block device has the ginnOS root label.
the kernel uses this to not mount a disk of another operating system on real hardware.
| device | the block device (a partition) with the filesystem. |
| bool partition_find_ginnos_root | ( | partition_device_t * | part, |
| block_device_t * | parent ) |
find the partition with the ginnOS root label on a disk: the primary MBR partitions, or the GPT partitions if the MBR is a protective one (type 0xEE).
a disk without a partition table is checked as a whole.
| part | the partition device to set up. |
| parent | the disk. |