genode/repos/gems/src/app/gpt_write/pmbr.h
Josef Söntgen ab77f94348 gems: add tool to write a GPT to a Block device
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.
2018-05-30 13:36:16 +02:00

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_ */