Documentation
¶
Overview ¶
Package exec provides support for kernel image loading and booting in bare metal Go applications.
This package is only meant to be used with `GOOS=tamagom` as supported by the TamaGo framework for bare metal Go, see https://github.com/usbarmory/tamago.
Index ¶
Constants ¶
const ( VideoTypeEFI = 0x70 Video64BitBase = 1 << 1 )
Screen information https://github.com/torvalds/linux/blob/master/include/uapi/linux/screen_info.h
const (
MinProtocolVersion = 0x0205 // https://docs.kernel.org/arch/x86/boot.html
)
Linux kernel information https://docs.kernel.org/arch/x86/boot.html
Variables ¶
var ( EFI64LoaderSignature = [4]byte{0x45, 0x4c, 0x36, 0x34} // "EL64" EFI32LoaderSignature = [4]byte{0x45, 0x4c, 0x33, 0x32} // "EL32" )
EFI Information (efi_info) signatures
Functions ¶
This section is empty.
Types ¶
type EFI ¶
type EFI struct {
LoaderSignature [4]byte
SystemTable uint32
MemoryDescSize uint32
MemoryDescVersion uint32
MemoryMap uint32
MemoryMapSize uint32
SystemTableHigh uint32
MemoryMapHigh uint32
}
EFI represents the Linux Zero Page `efi_info` structure.
func (*EFI) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
type ELFImage ¶
type ELFImage struct {
// Region is the memory area for image loading.
Region *dma.Region
// ELF is a bootable bare-metal ELF image.
ELF []byte
// contains filtered or unexported fields
}
ELFImage represents a bootable bare-metal ELF image.
type LinuxImage ¶
type LinuxImage struct {
// Region is the memory area for image loading.
Region *dma.Region
// Memory is the system memory map
Memory []bzimage.E820Entry
// Kernel is the Linux kernel image.
Kernel []byte
// KernelOffset is the Linux kernel offset from RAM start address.
KernelOffset int
// BzImage is the kernel extracted by by Parse() or Load().
BzImage *bzimage.BzImage
// InitialRamDisk is the Linux kernel initrd file.
InitialRamDisk []byte
// InitialRamDiskOffset is the initrd offset from RAM start address.
InitialRamDiskOffset int
// CmdLine is the Linux kernel command line arguments.
CmdLine string
// CmdLineOffset is the command line offset from RAM start address.
CmdLineOffset int
// ParamsOffset is the boot parameters offset from RAM start address.
ParamsOffset int
// EFI is the boot parameters EFI information.
EFI *EFI
// Screen is the boot parameters frame buffer information.
Screen *Screen
// contains filtered or unexported fields
}
LinuxImage represents a bootable Linux kernel image.
func (*LinuxImage) Boot ¶
func (image *LinuxImage) Boot(cleanup func()) (err error)
Boot calls a loaded Linux kernel image.
func (*LinuxImage) Entry ¶
func (image *LinuxImage) Entry() uint
Entry returns the image entry address.
func (*LinuxImage) Load ¶
func (image *LinuxImage) Load() (err error)
Load loads a Linux kernel image in memory.
func (*LinuxImage) Parse ¶
func (image *LinuxImage) Parse() (err error)
type Screen ¶
type Screen struct {
OrigX uint8
OrigY uint8
ExtMemK uint16
OrigVideoPage uint16
OrigVideoMode uint8
OrigVideoCols uint8
OrigVideoeGabx uint16
OrigVideoLines uint8
OrigVideoIsVGA uint8
OrigVideoPoints uint16
LfbWidth uint16
LfbHeight uint16
LfbDepth uint16
LfbBase uint32
LfbSize uint32
CLMagic uint16
CLOffset uint16
LfbLineLength uint16
RedSize uint8
RedPos uint8
GreenSize uint8
GreenPos uint8
BlueSize uint8
BluePos uint8
RsvdSize uint8
RsvdPos uint8
VesapmSeg uint16
VesapmOff uint16
Pages uint16
VesaAttributes uint16
Capabilities uint32
ExtLfbBase uint32
// contains filtered or unexported fields
}
Screen represents the Linux Zero Page `screen_info` structure.
func (*Screen) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.