Search   
Home  Print View  

 

Specs

Branch Content

VTFS File System

VTFS stands for Virtual Tape File System. It is intended as an abstraction for programs running at the LC-81 minicomputer for interchanging data between disimiles tape-based storage mediums. Tapes can be either real such audio cassettes and open reel audio tapes, or virtual, simulated with Floppy Disks or ROM memory.

Format

The tape content is encoded in ASCII. In the case of non-textual content (such as binary files or programs object code), it is coded in Hexadecimal which in turn is encoded in ASCII.

The entire media is treated as a single sequence of bytes broken into Blocks being this the transfer unit. VTFS reads or writes tapes one block at the time into internal buffers. Applications read or write one byte at the time from VTFS buffers. VTFS takes care of the synchronization between application requests and buffers content.

In real tapes, blocks are physically separated by gaps. This is required for tapes containing long files because they will eventually stop in the middle of a file; tapes must stop with the head positioned over a gap, not a data zone.

The size of the block is fixed for a given tape but it can vary from tape to tape. Some types of media such as Floppy have a pr-established block size but this parameter is generally user-defined and ranges from 256 to 4096 bytes. The maximum number of blocks a file can contain is 256, hence the maximun size for a VTFS file is 1 MB.

The block format for real tapes is as following:

    gap
    02H     ASCII Start-Of-Transmission (STX)
    MSN     Block Number (Hex less signif. nibble)
    LSN     Block Number (Hex most signif. nibble)
    .
    .
    data
    .
    .                                .
    03H        ASCII End-Of-Transmission (ETX)
    gap

In virtual tapes, blocks contain just the data.

LABEL

The first block of a volume (Block 0) is always a LABEL containing information about the rest of the volume. The format is as following:

    Start Mark            (ASCII 'SOH': 01H)
    File System ID        (VTFS)
    File System Version   (1.0)
    Medium                (ex: T)
    Block Size            (ex: 1024)
    Block Count           (ex: 21)
    Encoding              (ex: A)
    File ID (FID)         (ex: 04)
    File Description      (ex: Employees Master File)
    Read-Only             (Y or N)
    File Creation Date    (ej: 2016-08-11)

These fields are delimited by a Line Feed character (0AH). The last one after the 'File Creation Date' field is interpreted as the end of the LABEL.

Field 'Medium' accept one of the values: 'T' (real Tape), 'V' (Virtual tape). This is important since some VTFS operations (such as overwriting a block in the middle of the tape) are restricted to virtual tapes.

Field 'Block Count' is mandatory for program files but can be ignored for other kind of files, specially those stored in real tapes: having to rewind the tape to the begining for just updating the LABEL can prove impractical in certain cases.

Encoding can be one of the values: 'A' (textual), 'H' (hexadecimal). This is important because VTFS makes the conversion hex-to-bin as it writes to the memory buffer in case of Enconding 'H'.

File ID or FID, is the way programs refer files. When the tape is mount on the tape drive, a 2-digits 7-segments display shows that ID to tell the operator which file is in which drive. This allows the operator to place tapes in arbitrary drives without getting lost.

'File Description' is optional being its purpose to show some additional information in a terminal, if that were the case.

End Of Tape mark (EOT)

Each file ends with a End-Of-Tile mark (EOT) placed after the last data byte of the file. Actual mark is ASCII FS (1CH).

LC-81 Homebrew Minicomputer -- this software is based on Help Books running at melissa