16.6 Tape Drive Emulation and Format Variants

<< Click to Display Table of Contents >>

Navigation:  ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 16 – Device Model & DMA >

16.6 Tape Drive Emulation and Format Variants

16.6.1 Virtual Tape Architecture

 

EMulatR emulates SCSI tape drives via the SCSITape class, which presents standard sequential-access SCSI semantics to the guest OS. The guest sees a tape device that responds to SCSI tape commands (READ, WRITE, WRITE_FILEMARKS, SPACE, REWIND, ERASE, LOAD/UNLOAD) and maintains tape position state (BOT, EOT, file mark positions, block count).

 

On the host side, the virtual tape is backed by a disk file that stores tape data in a structured container format. EMulatR supports two — and possibly three — variant formats for guest virtual tape to disk storage:

 


 

16.6.2 Supported Tape Container Formats

 

Format 1: SIMH .TAP — The widely-used SIMH tape image format. Each tape record is prefixed with a 4-byte little-endian record length header, followed by the record data, followed by a duplicate 4-byte length trailer. File marks are encoded as a zero-length record (4 bytes of 0x00000000). End of medium is encoded as two consecutive file marks. This format is portable across emulator platforms (SIMH, Hercules, and others) and is the primary interchange format for guest operating system installation media.

 

Format 2: TPC (Tape Position Control) — An extended tape container format that adds metadata capabilities beyond SIMH .TAP. TPC format includes a file header with tape geometry and density information, per-record metadata (timestamps, write pass identifiers), and support for variable-length records with explicit block size tracking. TPC provides better fidelity for tape operations that inspect or manipulate tape medium properties, such as MODE_SENSE/MODE_SELECT for tape density and compression parameters.

 

Format 3: VTape (under evaluation) — A potential third format under consideration that would provide a more compact representation with optional compression and sparse block allocation. VTape would target large virtual tape libraries where storage efficiency matters. This format is not yet committed and may be adopted or deferred based on guest OS compatibility testing.

 


 

16.6.3 Format Selection and Tape Operations

 

The tape container format is selected per device instance in EMulatR.ini and is detected by the SCSITape class at device initialization by inspecting the file header. All tape operations — read, write, space, rewind — are translated into host-side file seek and read/write operations against the container file, with the container format handling record framing and file mark encoding.

 

The guest OS is unaware of the host-side container format. It sees a standard SCSI sequential-access device responding to standard SCSI tape commands. The container format is an emulator implementation detail that affects only host-side storage layout and interoperability with other emulator platforms.

 

See Also: deviceLib/SCSITape.h – Virtual tape device implementation; deviceLib/SCSI_helpers.h – SCSI command definitions.