devicepath

package
v0.0.0-...-e83addd Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeEnd     = 0x7f
	InstanceEnd = 1
	SubTypeEnd  = 0xff
)

Device path type values

View Source
const (
	TypeDevice    = 0x01
	SubTypeMemory = 0x03
	SubTypeVendor = 0x04
)
View Source
const (
	TypeACPI    = 2
	SubTypeACPI = 1
)
View Source
const (
	TypeMessaging   = 3
	SubTypeATAPI    = 1
	SubTypeSCSI     = 2
	SubTypeUSB      = 5
	SubTypeMAC      = 0xb
	SubTypeUSBClass = 0xf
	SubTypeMSGSD    = 0x1a
	SubTypeMSGMMC   = 0x1d
)

This section is called"UEFI doesn't understand storage abstractions"

View Source
const (
	TypeMedia        = 4
	SubTypeHardDrive = 1
	SubTypeCDROM     = 2
	SubTypeFile      = 4
)
View Source
const (
	DEVICE_PATH_GUID = "09576E91-6D3F-11D2-8E39-00A0C969723B"
	U_BOOT_GUID      = "e61d73b9-a384-4acc-aeab-82e828f3628b"
)

Variables

View Source
var (
	DevicePathGUID = guid.MustParse(DEVICE_PATH_GUID)
	RootGUID       = guid.MustParse(U_BOOT_GUID)
)
View Source
var Debug = func(string, ...interface{}) {}
View Source
var TypeNames = map[uint8]string{
	TypeEnd:       "TypeEnd",
	TypeDevice:    "TypeDevice",
	TypeACPI:      "TypeACPI",
	TypeMessaging: "TypeMessaging",
	TypeMedia:     "TypeMedia",
}

TypeNames provides a name for a Device Path Type

Functions

func Blob

func Blob(paths ...Path) []byte

func EFIPNPID

func EFIPNPID(ID int) uint32

Types

type ACPI

type ACPI struct {
	HID uint32
	UID uint32
	// contains filtered or unexported fields
}

an ACPI path

func (*ACPI) Blob

func (a *ACPI) Blob() []byte

func (*ACPI) Header

func (a *ACPI) Header() Header

type ATAPI

type ATAPI struct {
	PrimarySecondary uint8
	// Cringe.
	// SlaveMaster uint8
	TargetHost uint8
	LUN        uint16
	// contains filtered or unexported fields
}

func (*ATAPI) Blob

func (a *ATAPI) Blob() []byte

func (*ATAPI) Header

func (a *ATAPI) Header() Header

type CDROM

type CDROM struct {
	BootEntry      uint32
	PartitionStart uint64
	PartitionEnd   uint64
	// contains filtered or unexported fields
}

func (*CDROM) Blob

func (c *CDROM) Blob() []byte

func (*CDROM) Header

func (c *CDROM) Header() Header

type End

type End struct{}

End is an end of device path.

func (*End) Blob

func (e *End) Blob() []byte

func (*End) Header

func (e *End) Header() Header

type FILE

type FILE struct {
	// contains filtered or unexported fields
}

func (*FILE) Blob

func (f *FILE) Blob() []byte

func (*FILE) Header

func (f *FILE) Header() Header

type HardDrive

type HardDrive struct {
	Partition          uint32
	PartitionStart     uint64
	PartitionEnd       uint64
	PartitionSignature [16]uint8
	PartmapType        uint8
	SignatureType      uint8
	// contains filtered or unexported fields
}

func (*HardDrive) Blob

func (h *HardDrive) Blob() []byte

func (*HardDrive) Header

func (h *HardDrive) Header() Header
type Header struct {
	Type    uint8
	SubType uint8
	Length  uint16
}

Header is the common Device Path header.

func (*Header) String

func (h *Header) String() string

String implements String

type MAC

type MAC struct {
	MAC    MACAddress
	IFType uint8
	// contains filtered or unexported fields
}

func (*MAC) Blob

func (m *MAC) Blob() []byte

func (*MAC) Header

func (m *MAC) Header() Header

type MACAddress

type MACAddress struct {
	Addr [32]uint8
}

MAC is a MAC address

type MMC

type MMC struct {
	SlotNumber uint8
	// contains filtered or unexported fields
}

func (*MMC) Blob

func (m *MMC) Blob() []byte

func (*MMC) Header

func (m *MMC) Header() Header

type Memory

type Memory struct {
	Type  uint32
	Start uint64
	End   uint64
	// contains filtered or unexported fields
}

Memory is for memory

func (*Memory) Blob

func (m *Memory) Blob() []byte

func (*Memory) Header

func (m *Memory) Header() Header

type Path

type Path interface {
	Header() Header
	// Blob return []byte so that they can easily be concatenated.
	Blob() []byte
}

func Marshal

func Marshal(s string) ([]Path, error)

Marshal marshals a string to a []Path, returning an error if any. The string is of the form a/b@parm@parm@parm/d

type Root

type Root struct{}

Root is a pre-filled-in Root record. Do we need it? u-boot did but who knows.

func (*Root) Blob

func (r *Root) Blob() []byte

func (*Root) Header

func (r *Root) Header() Header

type SCSI

type SCSI struct {
	TargetID uint16
	LUN      uint16
	// contains filtered or unexported fields
}

func (*SCSI) Blob

func (s *SCSI) Blob() []byte

func (*SCSI) Header

func (s *SCSI) Header() Header

type USB

type USB struct {
	ParentPort   uint8
	USBInterface uint8
	// contains filtered or unexported fields
}

func (*USB) Blob

func (u *USB) Blob() []byte

func (*USB) Header

func (u *USB) Header() Header

type USBClass

type USBClass struct {
	VID            uint16
	DID            uint16
	Class          uint8
	SubClass       uint8
	DeviceProtocol uint8
	// contains filtered or unexported fields
}

func (*USBClass) Blob

func (u *USBClass) Blob() []byte

func (*USBClass) Header

func (u *USBClass) Header() Header

type Vendor

type Vendor struct {
	GUID guid.GUID

	Data []uint8
	// contains filtered or unexported fields
}

Vendor is for vendor data.

func (*Vendor) Blob

func (v *Vendor) Blob() []byte

func (*Vendor) Header

func (v *Vendor) Header() Header

Jump to

Keyboard shortcuts

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