zimage

package
v7.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: BSD-3-Clause Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package zimage contains a Parser for the arm zImage Linux format. It assumes little endian arm.

Index

Constants

View Source
const (
	Magic      = 0x016f2818
	Endianess  = 0x04030201
	TableMagic = 0x45454545
)

Magic values used in the zImage header and table.

Variables

This section is empty.

Functions

This section is empty.

Types

type Header struct {
	Magic      uint32
	Start      uint32
	End        uint32
	Endianess  uint32
	TableMagic uint32
	TableAddr  uint32
}

Header appears near the beginning of the zImage.

The layout is defined in Linux:

arch/arm/boot/compressed/head.S

type TableEntry

type TableEntry struct {
	Tag  Tag
	Data []uint32
}

TableEntry is an extension to Header. A zImage may have 0 or more entries.

The layout is defined in Linux:

arch/arm/boot/compressed/vmlinux.lds.S

type Tag

type Tag uint32

Tag is used to identify a TableEntry.

const (
	TagKernelSize Tag = 0x5a534c4b
)

Tags used by TableEntry (at the time of writing, there is only one tag).

type ZImage

type ZImage struct {
	Header Header
	Table  []TableEntry
}

ZImage is one of the major formats used by Linux on ARM. This struct is only for storing the metadata.

func Parse

func Parse(f io.ReadSeeker) (*ZImage, error)

Parse a ZImage from a file.

func (*ZImage) GetEntry

func (z *ZImage) GetEntry(t Tag) (*TableEntry, error)

GetEntry searches through the zImage table for the given tag.

func (*ZImage) GetKernelSizes

func (z *ZImage) GetKernelSizes() (piggySizeAddr uint32, kernelBSSSize uint32, err error)

GetKernelSizes returns two kernel sizes relevant for kexec.

Jump to

Keyboard shortcuts

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