mbr

package
v0.0.0-...-c8da316 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 6 Imported by: 8

Documentation

Index

Constants

View Source
const (
	SIGNATURE = 0xAA55
	Sector    = 512
)

Variables

View Source
var InvalidSignature = xerrors.New("Invalid master boot record signature")

Functions

This section is empty.

Types

type CHS

type CHS [3]byte

type MasterBootRecord

type MasterBootRecord struct {
	BootCodeArea           [440]byte
	UniqueMBRDiskSignature [4]byte
	Unknown                [2]byte
	Partitions             [4]Partition
	Signature              uint16
	// contains filtered or unexported fields
}

func NewMasterBootRecord

func NewMasterBootRecord(sr *io.SectionReader) (*MasterBootRecord, error)

func (*MasterBootRecord) Next

func (m *MasterBootRecord) Next() (types.Partition, error)

type Partition

type Partition struct {
	Boot     bool
	StartCHS CHS
	Type     byte
	EndCHS   CHS

	StartSector uint32
	Size        uint32
	// contains filtered or unexported fields
}

func (Partition) Bootable

func (p Partition) Bootable() bool

func (Partition) GetSectionReader

func (p Partition) GetSectionReader() io.SectionReader

func (Partition) GetSize

func (p Partition) GetSize() uint64

func (Partition) GetStartSector

func (p Partition) GetStartSector() uint64

func (Partition) GetType

func (p Partition) GetType() []byte

func (Partition) Index

func (p Partition) Index() int

func (Partition) IsSupported

func (p Partition) IsSupported() bool

func (Partition) Name

func (p Partition) Name() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL