mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-15 01:10:08 +00:00
ab77f94348
This component creates a GPT on a Block device. It supports the common actions, as in adding, deleting and modifying entries in the GPT, while considering alignment constraints. If needed it will round the length of a partition down to meet those constraints. The component will not perform layout checking, i.e., it does not care about overlapping partitions. Only when apping a partition it will make sure that the partition will fit. Please read _repos/gems/src/app/gpt_write/README_ for more detailed information on how to use the component and feel free to check out _repos/gems/run/gpt_write.run_. Fixes #2814.
49 lines
959 B
C++
49 lines
959 B
C++
/*
|
|
* \brief Protective MBR partition table definitions
|
|
* \author Josef Soentgen
|
|
* \date 2018-05-03
|
|
*/
|
|
|
|
/*
|
|
* Copyright (C) 2018 Genode Labs GmbH
|
|
*
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
* under the terms of the GNU Affero General Public License version 3.
|
|
*/
|
|
|
|
#ifndef _PMBR_H_
|
|
#define _PMBR_H_
|
|
|
|
/* Genode includes */
|
|
#include <base/fixed_stdint.h>
|
|
|
|
|
|
namespace Protective_mbr
|
|
{
|
|
enum { TYPE_PROTECTIVE = 0xEE, };
|
|
|
|
/**
|
|
* Partition table entry format
|
|
*/
|
|
struct Partition
|
|
{
|
|
Genode::uint8_t unused[4] { };
|
|
Genode::uint8_t type { };
|
|
Genode::uint8_t unused2[3] { };
|
|
Genode::uint32_t lba { };
|
|
Genode::uint32_t sectors { };
|
|
} __attribute__((packed));
|
|
|
|
/**
|
|
* Master boot record header
|
|
*/
|
|
struct Header
|
|
{
|
|
Genode::uint8_t unused[446] { };
|
|
Partition partitions[4] { };
|
|
Genode::uint16_t magic { 0xaa55 };
|
|
} __attribute__((packed));
|
|
}
|
|
|
|
#endif /* _PMBR_H_ */
|