biosimage

package
v2.8.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: BSD-3-Clause Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func With

func With(state *types.State, callback func(*BIOSImage) error) error

With gets the BIOSImage from a State and executes the specified callback.

Types

type BIOSImage

type BIOSImage struct {
	Content         []byte
	CacheParsed     *uefi.UEFI
	CacheParseError error
	Accessors       map[reflect.Type]any
}

BIOSImage represents the BIOS firmware image.

func Get

func Get(state *types.State) (*BIOSImage, error)

Get returns the BIOSImage given a State.

func New

func New(content []byte) *BIOSImage

New returns a new instance of BIOSImage.

func NewFromParsed

func NewFromParsed(parsed *uefi.UEFI) *BIOSImage

NewFromParsed returns a new instance of BIOSImage.

func (*BIOSImage) DMITable

func (fw *BIOSImage) DMITable() (*dmidecode.DMITable, error)

DMITable parses the SMBIOS section and returns data as as DMITable.

func (*BIOSImage) Info

func (fw *BIOSImage) Info() (*dmidecode.BIOSInfo, error)

Info returns basic BIOS info: vendor, version, release date and revision.

func (*BIOSImage) Parse

func (fw *BIOSImage) Parse() (*uefi.UEFI, error)

Parse returns a parsed UEFI image.

func (*BIOSImage) ReadAt

func (img *BIOSImage) ReadAt(b []byte, offset int64) (n int, err error)

ReadAt implements types.SystemArtifact.

func (*BIOSImage) Size

func (img *BIOSImage) Size() uint64

Size implements types.SystemArtifact.

func (*BIOSImage) String

func (img *BIOSImage) String() string

String implements fmt.Stringer.

type PhysMemMapper

type PhysMemMapper struct{}

PhysMemMapper maps physical memory address space to a BIOS region of a system artifact BIOSImage.

func (PhysMemMapper) Resolve

func (t PhysMemMapper) Resolve(artifact types.SystemArtifact, ranges ...pkgbytes.Range) (pkgbytes.Ranges, error)

Resolve implements types.AddressMapper.

It maps a physical memory address to an offset inside the system artifact (UEFI image).

func (PhysMemMapper) ResolveBIOSRegionOffset

func (PhysMemMapper) ResolveBIOSRegionOffset(artifact types.SystemArtifact, ranges ...pkgbytes.Range) (pkgbytes.Ranges, error)

ResolveBIOSRegionOffset is similar to Resolve, but the given offsets are based on BIOS region instead of the whole UEFI image.

It maps a physical memory address to an offset inside the system artifact (UEFI image).

func (PhysMemMapper) ResolveFullImageOffset

func (PhysMemMapper) ResolveFullImageOffset(artifact types.SystemArtifact, ranges ...pkgbytes.Range) pkgbytes.Ranges

ResolveFullImageOffset maps a physical memory address to an offset inside the system artifact (UEFI image).

func (PhysMemMapper) Unresolve

func (t PhysMemMapper) Unresolve(artifact types.SystemArtifact, ranges ...pkgbytes.Range) (pkgbytes.Ranges, error)

Unresolve implements types.AddressMapper.

It maps an offset of the UEFI image to a physical memory address.

func (PhysMemMapper) UnresolveBIOSRegionOffset

func (PhysMemMapper) UnresolveBIOSRegionOffset(artifact types.SystemArtifact, ranges ...pkgbytes.Range) (pkgbytes.Ranges, error)

UnresolveBIOSRegionOffset is similar to Unresolve, but the given offsets are based on BIOS region instead of the whole UEFI image.

It maps an offset of the BIOS region to a physical memory address.

func (PhysMemMapper) UnresolveFullImageOffset

func (PhysMemMapper) UnresolveFullImageOffset(artifact types.SystemArtifact, ranges ...pkgbytes.Range) pkgbytes.Ranges

UnresolveFullImageOffset maps an offset of the UEFI image to a physical memory address.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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