nigeleke / mktape

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mktape

MIT License Language Build Coverage Version

Site | GitHub | API | Coverage Report

Create a simh tape file to be used on PDP-10.

Written by Nigel Eke, based on the perl script written by Will Senn which was, in turn, inspired by various Perl scripts and based on Hellwig Geisse's mktape.c.

This project probably has very limited use to most people, but users for the PDP-x emulations may find it of interest.

Background

This project stems from the need to create a PDP-10 tap file to load source of another project of mine, onto an emulated PDP-10.

As part of the research into making this work I was pointed to this paper and, in particular, the perl script referenced in Appendix A.

The perl script creates a pre-named tap file (v7.tap) from files f0..f6. More over, the input files have pre-defined block sizes for each of them.

This project generalises the script so that the user can:

  • specify the output file (required)
  • specify the input file(s), minimally one file
  • specify the input file's block-sizes (defaults to 1024 to align with the tapewrite default from the tapeutils repository).

TODO:

  • Amend to create backup format files.
  • Amend to list contents of tap and backup files.
  • Possibly amend to extract contents of tap and backup files.

Development pre-requisites

Normally I would use nix to set up the development environment, but I found in this case, rust didn't play well with some symlinks used by nix, so rust is required.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install cargo-tarpaulin

Build & develop

> cargo build

Unit tests:

> cargo test --lib -- --test-threads=1

Integration tests require test files to be downloaded and stored in the data/ folder. See the README.md in that folder.

> cargo test -- --test-threads=1

Note:

  1. --test-threads=1 is required as one of the test sets an environment variable whose presence my impact the other tests.

Publish

> cargo build -r --bin mktape
> sudo cp target/release/mktape /usr/local/bin/

Usage

Run mktape --help for additional help. In summary:

> mktape <TAPE> list
> mktape <TAPE> create <INPUT>[:<BLOCKSIZE]>...

where:

  • <TAPE> is [-f <FORMAT>] <PATH>
  • <FORMAT> is tap or backup, and defaults to tap
  • Default <BLOCKSIZE> is 1024 if not provided; The environment variable MKTAPE_BLOCK_SIZE can be set to change the default.

About

License:MIT License


Languages

Language:Rust 96.4%Language:Nix 3.6%