bootboot

package module
v0.0.0-...-3d281c1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: CC0-1.0 Imports: 1 Imported by: 0

README

bootboot

The BOOTBOOT provider for Surge's core

Documentation

Index

Constants

View Source
const (
	Magic = 0x544F4F42 // "BOOT"

	MMIO = 0xFFFFFFFFF8000000
	FB   = 0xFFFFFFFFFC000000
	INFO = 0xFFFFFFFFFFE00000
	ENV  = 0xFFFFFFFFFFE01000
	CORE = 0xFFFFFFFFFFE02000

	ProtocolMinimal   = 0
	ProtocolStatic    = 1
	ProtocolDynamic   = 2
	ProtocolBigendian = 128

	BIOS     = 0
	UEFI     = 4
	RPI      = 8
	COREBOOT = 12

	ARGB = 0
	RGBA = 1
	ABGR = 2
	BGRA = 3

	MmapUsed = 0 /* don't use. Reserved or unknown regions */
	MmapFree = 1 /* usable memory */
	MmapAcpi = 2 /* acpi memory, volatile and non-volatile as well */
	MmapMmio = 3 /* memory mapped IO region */

	InitrdMaxsize = 16 /* Mb */
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BOOTBOOT

type BOOTBOOT struct {
	Magic      uint32   /* 'BOOT' magic */
	Size       uint32   /* length of bootboot structure, minimum 128 */
	Protocol   uint8    /* 1, static addresses, see PROTOCOL_* and LOADER_* above */
	FbType     uint8    /* framebuffer type, see FB_* above */
	Numcores   uint16   /* number of processor cores */
	Bspid      uint16   /* Bootstrap processor ID (Local APIC Id on x86_64) */
	Timezone   int16    /* in minutes -1440..1440 */
	Datetime   [8]uint8 /* in BCD yyyymmddhhiiss UTC (independent to timezone) */
	InitrdPtr  uint64   /* ramdisk image position and size */
	InitrdSize uint64
	FbPtr      uint64 /* framebuffer pointer and dimensions */
	FbSize     uint32
	FbWidth    uint32
	FbHeight   uint32
	FbScanline uint32
	Arch       arch /* the rest (64 bytes) is platform specific */
	/* use like this:
	 * MMapEnt *mmap_ent = &bootboot.mmap; mmap_ent++;
	 * until you reach bootboot->size, while(mmap_ent < bootboot + bootboot->size) */
	Mmap MMapEnt
}

type MMapEnt

type MMapEnt struct {
	Ptr uint64
	// contains filtered or unexported fields
}

MMapEnt stores in least significant tetrad (half byte) of size this means size described in 16 byte units (not a problem, most modern firmware report memory in pages, 4096 byte units anyway).

func (*MMapEnt) IsFree

func (e *MMapEnt) IsFree() bool

func (*MMapEnt) Size

func (e *MMapEnt) Size() uint64

func (*MMapEnt) Type

func (e *MMapEnt) Type() uint64

Jump to

Keyboard shortcuts

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