Documentation ¶
Overview ¶
Package mbr is a minimial implementation of Master Boot Record parsing and writing, implemented in support of GUID Partition Table parsing and writing. It is based on the UEFI Specification v2.6.
Index ¶
Constants ¶
const MBRSize = 512
MBRSize is the size of an MBR record without logical block size padding
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MBR ¶
type MBR struct { BootCode [424]byte // 424 bytes should be enough for anybody... Pad [16]byte // unnamed blank space in efi spec? UniqueMBRDiskSignature uint32 Unknown [2]byte PartitionRecord [4]PartitionRecord Signature Signature }
MBR is a Go representation of a legacy Master Boot Record.
func NewProtectiveMBR ¶
NewProtectiveMBR constructs an MBR struct with fields conformant to the UEFI specification 2.6 "Protective MBR"
type OSType ¶
type OSType byte
OSType marks the partition type in an MBR Partition Record
TODO(raggi): fill in other types and organize from: "Partition types" by Andries Brouwer: See "Links to UEFI-Related Documents" (http://uefi.org/uefi) under the heading "OS Type values used in the MBR disk layout".