mbr

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidSignature = errors.New("invalid master boot record signature")

Functions

This section is empty.

Types

type Address

type Address [3]uint8

Address is a CHS address.

func (Address) Cylinder

func (a Address) Cylinder() uint16

func (Address) Head

func (a Address) Head() uint8

func (Address) Sector

func (a Address) Sector() uint8

type PartitionEntry

type PartitionEntry struct {
	BootIndicator   uint8
	StartAddress    Address
	Type            uint8
	EndAddress      Address
	StartingLBA     uint32
	NumberOfSectors uint32
}

PartitionEntry corresponds to a partition entry from a MBR.

type Record

type Record struct {
	BootstrapCode   [440]byte
	UniqueSignature uint32
	Partitions      [4]PartitionEntry
}

Record corresponds to a MBR.

func ReadRecord

func ReadRecord(r io.Reader) (*Record, error)

ReadRecord reads a MBR from r. It returns ErrInvalidSignature if the MBR has an invalid signature.

Jump to

Keyboard shortcuts

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