a2kit

Module img

source
Expand description

§Disk Image Module

This is a container for disk image modules. The disk image modules serve as the underlying storage for file system modules.

Disk images are represented by the DiskImage trait. Every kind of disk image must respond to a file system’s request for that file system’s preferred allocation block. Certain kinds of disk images must also provide encoding and decoding of track bits.

§Disk Kind Patterns

There is an enumeration called DiskKind that can be used to make branching decisions based on parameters of a given disk. This is intended to be used with rust’s match statement. As an example, if you want to do something only with 3.5 inch disks, you would use a pattern like DiskKind::D35(_). The embedded structure can be used to limit the pattern to specific elements of a track layout.

§Sector Skews

The actual skew tables are maintained separately in bios::skew.

Disk addresses are often transformed one or more times as they propagate from a file system request to a physical disk. The file system may use an abstract unit, like a block, which is transformed into a “logical” sector number, which is further transformed into a “physical” address. In a soft-sectoring scheme the physical address is encoded with the other sector data. If the physical addresses are out of order with respect to the order in which they pass by the read/write head, we have a “physical” skew.

The way this is handled within a2kit is as follows. The fs module provides an enumeration called Block which identifies a disk address in a given file system’s own language. Each disk image implementation has to provide read_block and write_block. These functions have to be able to take a Block and transform it into whatever disk addressing the image uses. The tables in bios::skew are accessible to any image.

Modules§

  • Apple 3.5 inch disk module
  • Apple 5.25 inch disk module
  • Support for 2MG disk images
  • Support for 13 sector disk images (D13,DSK)
  • Support for DOS ordered disk images (DO,DSK)
  • Support for IBM sector dumps
  • Support for ProDOS ordered disk images (PO,DSK)
  • Support for IMD disk images
  • Disk Image Metadata Handling
  • Disk Names
  • Support for NIB disk images
  • Support for TD0 disk images
  • Common components for WOZ1 or WOZ2 disk images
  • Support for WOZ v1 disk images
  • Support for WOZ v2 disk images

Structs§

Enums§

Traits§

  • The main trait for working with any kind of disk image. The corresponding trait object serves as storage for DiskFS. Reading can mutate the object because the image may be keeping track of the head position or other status indicators.
  • Lightweight trait object for reading and writing track bits. The track buffer is borrowed.

Functions§

  • Test a buffer for a size match to DOS-oriented track and sector counts.
  • Package designation for geometry JSON (e.g., “3.5”, “5.25”, …)
  • If a data source is smaller than quantum bytes, pad it with zeros. If it is larger, do not include the extra bytes.