kernel

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GPUModuleConfigs = []string{
	"CONFIG_DRM",
	"CONFIG_DRM_KMS_HELPER",
	"CONFIG_DRM_VIRTIO_GPU",
	"CONFIG_VIRTIO_INPUT",

	"CONFIG_INPUT_EVDEV",
}

GPUModuleConfigs lists the kernel config options needed for GPU support

View Source
var GPUModuleMap = map[string]string{
	"CONFIG_DRM":            "kernel/drivers/gpu/drm/drm.ko.gz",
	"CONFIG_DRM_KMS_HELPER": "kernel/drivers/gpu/drm/drm_kms_helper.ko.gz",
	"CONFIG_DRM_VIRTIO_GPU": "kernel/drivers/gpu/drm/virtio/virtio-gpu.ko.gz",
	"CONFIG_VIRTIO_INPUT":   "kernel/drivers/virtio/virtio_input.ko.gz",
	"CONFIG_INPUT_EVDEV":    "kernel/drivers/input/evdev.ko.gz",
}

GPUModuleMap maps kernel config options to module file paths

Functions

func GetDefaultCachePath

func GetDefaultCachePath() (string, error)

func SetDefaultCachePath

func SetDefaultCachePath(path string)

Types

type File

type File interface {
	io.Reader
	io.ReaderAt
}

type Kernel

type Kernel interface {
	Open() (File, error)
	Size() (int64, error)

	GetModuleDepends(name string) ([]string, error)
	OpenModule(name string) ([]byte, error)

	GetConfig() (map[string]Tristate, error)
	GetDependMap() (map[string][]string, error)

	GetSystemMap() (io.ReaderAt, error)

	PlanModuleLoad(
		configVars []string,
		moduleMap map[string]string,
	) ([]Module, error)
}

func LoadForArchitecture

func LoadForArchitecture(arch hv.CpuArchitecture) (Kernel, error)

type Module

type Module struct {
	Name string
	Data []byte
}

type Tristate

type Tristate int
const (
	TristateNo Tristate = iota
	TristateYes
	TristateModule
)

func (Tristate) String

func (t Tristate) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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