mmc

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package mmc provides support for accessing the SD/eMMC storage provided by the USB Armory. Note that these are very low-level primitives, and care must be taken when using them not to overwrite existing data (e.g. the unikernel itself!)

Index

Constants

This section is empty.

Variables

View Source
var (
	// MaxTransferBytes is the largest transfer we'll attempt.
	// If we're asked to read or write more data than can fit into available DMA memeory
	// we'll had a bad time, so we'll chunk into requests of at most MaxTransferBytes bytes.
	MaxTransferBytes = 32 * 1024
)

Functions

This section is empty.

Types

type Device

type Device struct {
	CardInfo *usdhc.CardInfo
}

Device allows writing to one of the USB Armory storage peripherals, hiding some of the sharp edges around DMA etc.

func (*Device) BlockSize

func (d *Device) BlockSize() uint

BlockSize returns the size in bytes of the each block in the underlying storage.

func (*Device) ReadBlocks

func (d *Device) ReadBlocks(lba uint, b []byte) error

ReadBlocks reads data from the storage device at the given address into b. b must be a multiple of the underlying device's block size.

func (*Device) WriteBlocks

func (d *Device) WriteBlocks(lba uint, b []byte) (uint, error)

WriteBlocks writes the data in b to the device blocks starting at the given block address. If the final block to be written is partial, it will be padded with zeroes to ensure that full blocks are written. Returns the number of blocks written, or an error.

Jump to

Keyboard shortcuts

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