dvh

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package dvh reads the SGI disk volume header ("dvh"): the 512-byte label at block 0 of SGI disks and CD images, holding a directory of raw boot files (sash, fx, ide) and the partition table.

Index

Constants

View Source
const Magic = 0x0be5a941

Magic is the big-endian value at byte 0 of a volume header.

Variables

This section is empty.

Functions

This section is empty.

Types

type BootFile

type BootFile struct {
	Name  string
	LBN   int32 // first 512-byte block of the file
	Bytes int32
}

BootFile is a volume-directory entry: a raw file (sash, fx, ide) stored outside any filesystem, addressed by logical block number.

type Header struct {
	BootFiles  []BootFile
	Partitions [16]Partition
	// contains filtered or unexported fields
}

Header is a parsed volume header.

func Parse

func Parse(b []byte) (*Header, error)

Parse reads a volume header from b, which must hold at least 512 bytes. A checksum mismatch does not fail the parse — real images are served on magic and bounds, and ChecksumOK lets the caller warn.

func (*Header) ChecksumOK

func (h *Header) ChecksumOK() bool

ChecksumOK reports whether the header's int32-word sum is zero, the dvh checksum rule.

func (*Header) EFS

func (h *Header) EFS() (Partition, bool)

EFS returns the filesystem partition to serve: slot 7 when populated (the SGI convention for the whole filesystem), otherwise the first partition of type EFS.

type Partition

type Partition struct {
	Blocks int32
	First  int32
	Type   PartitionType
}

Partition is one slot of the 16-entry partition table. Sizes and offsets are in 512-byte blocks.

type PartitionType

type PartitionType int32

PartitionType identifies what a partition holds.

const (
	TypeVolHdr PartitionType = 0
	TypeRaw    PartitionType = 3
	TypeVolume PartitionType = 6
	TypeEFS    PartitionType = 7
	TypeXFS    PartitionType = 10
)

Partition types from the SGI partition table.

Jump to

Keyboard shortcuts

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