boot

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GSIAllocator

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

GSIAllocator hands out global system interrupts, avoiding collisions between devices that need unique lines (e.g. virtio-mmio instances).

func NewGSIAllocator

func NewGSIAllocator(start uint32, reserved []uint32) *GSIAllocator

func (*GSIAllocator) Allocate

func (a *GSIAllocator) Allocate() uint32

type InitFile

type InitFile struct {
	Path     string
	Mode     os.FileMode
	Data     []byte
	DevMajor int
	DevMinor int
}

type LinuxLoader

type LinuxLoader struct {
	NumCPUs int
	MemSize uint64
	MemBase uint64

	GetCmdline         func(arch hv.CpuArchitecture) ([]string, error)
	GetInit            func(arch hv.CpuArchitecture) (*ir.Program, error)
	GetKernel          func() (io.ReaderAt, int64, error)
	GetSystemMap       func() (io.ReaderAt, error)
	CreateVM           func(vm hv.VirtualMachine) error
	CreateVMWithMemory func(vm hv.VirtualMachine) error

	SerialStdout io.Writer
	SerialStdin  io.Reader

	Devices []hv.DeviceTemplate

	AdditionalFiles []InitFile

	// GPUEnabled enables GPU support by loading virtio-gpu and virtio-input modules
	GPUEnabled bool

	// PreloadModules is a list of modules to preload when the kernel boots.
	// This is populated automatically based on configuration (e.g. GPUEnabled).
	PreloadModules []kernel.Module

	// CacheDir is the directory for caching decompressed kernels.
	// If empty, no caching is performed.
	CacheDir string

	// SkipKernelLoad skips kernel loading when restoring from a snapshot.
	// When true, only device creation is performed during Load().
	// The caller must restore a snapshot after VM creation.
	SkipKernelLoad bool
	// contains filtered or unexported fields
}

func (*LinuxLoader) CPUCount

func (l *LinuxLoader) CPUCount() int

implements hv.VMConfig.

func (*LinuxLoader) Callbacks

func (l *LinuxLoader) Callbacks() hv.VMCallbacks

func (*LinuxLoader) ConfigureVCPU

func (l *LinuxLoader) ConfigureVCPU(vcpu hv.VirtualCPU) error

func (*LinuxLoader) Load

func (l *LinuxLoader) Load(vm hv.VirtualMachine) error

Load implements hv.VMLoader.

func (*LinuxLoader) Loader

func (l *LinuxLoader) Loader() hv.VMLoader

func (*LinuxLoader) MemoryBase

func (l *LinuxLoader) MemoryBase() uint64

func (*LinuxLoader) MemorySize

func (l *LinuxLoader) MemorySize() uint64

func (*LinuxLoader) NeedsInterruptSupport

func (l *LinuxLoader) NeedsInterruptSupport() bool

func (*LinuxLoader) OnCreateVCPU

func (l *LinuxLoader) OnCreateVCPU(vCpu hv.VirtualCPU) error

OnCreateVCPU implements hv.VMCallbacks.

func (*LinuxLoader) OnCreateVM

func (l *LinuxLoader) OnCreateVM(vm hv.VirtualMachine) error

OnCreateVM implements hv.VMCallbacks.

func (*LinuxLoader) OnCreateVMWithMemory

func (l *LinuxLoader) OnCreateVMWithMemory(vm hv.VirtualMachine) error

OnCreateVMWithMemory implements hv.VMCallbacks.

func (*LinuxLoader) RunConfig

func (l *LinuxLoader) RunConfig() (hv.RunConfig, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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