Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ tc(7) — A/UX 2.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mt(1)

tar(1)

tcb(1)

tp(1)

mtio(7)




tc(7) tc(7)
NAME tc - Apple Tape Backup 40SC device driver DESCRIPTION tc is a device driver that supports the Apple Tape Backup 40SC using the generic tape driver interface described in mtio(7), with certain exceptions. To be more compatible with 9-track tape units, this driver approximates 9-track drive tapemarks through the use of special tapemark records. Other exceptions are mentioned where appropriate. The Apple Tape Backup 40SC is connected to the system through the SCSI device chain. To select the correct dev- ice, you must reference the correct device file. The SCSI ID number of the tape backup device should match the number after tc in the device file. The device files for Apple tape backup devices in the form /dev/rmt/tcx /dev/rmt/tcxn where x is the SCSI ID number of the drive in the range 0 through 7. For example, /dev/rmt/tc0 and /dev/rmt/tc0n both select the device with a SCSI ID set to 0. The device reference with suffix n is called a reference to a no- rewinding tape device because it reads or writes from the tape drive without rewinding the tape afterwards. If you use the no-rewinding device, the tape is positioned so that the next archive in a series of archives can be accessed. (These device files are present only if the kernel has been configured properly for the Apple Tape Backup 40SC.) To configure the kernel, run the command newconfig tc to create a kernel with tape-cartridge support. Note that newunix must first be run, to enable creation of device files. The tape cartridge must be formatted in order to store data. Nominal capacity is 40 megabytes (MB). Usable capacity is closer to 38.5 MB (reduced because of formatting overhead). One of the peculiarities of this tape device is that it only reads and writes fixed 8 kilobyte (KB) blocks, streaming when possible. Since the device always reads and writes 8 KB blocks, the driver restricts raw I/O size to a multiple of 8 KB. Reading and writing many 8 KB blocks at once minimizes user-process overhead and maximizes streaming. It should be noted that positioning subcommands always act on physical 8 KB blocks. April, 1990 1



tc(7) tc(7)
The tcb(1) program helps overcome the fixed-block-size prob- lem when it is used to read from the tape or when it is used just before a write to the tape. Each read or write call reads or writes the next record on the tape. When writing, the record size returned is the same length as the block size given. When reading, the record size returned is the actual number of bytes read, which can be no greater than the buffer size; if the record is too long, an error is indicated. For the tc device driver, the ioctls and data structures as- sociated with the mtio(7) generic tape interface are sup- ported, including MTIOCGET and MTIOCTOP. The MTIOCGET ioctl returns the driver's notion of current file and block number information in mt_fileno and mt_blkno. The mt_dsreg field contains the logical block number where the last I/O opera- tion occurred. Though this generally matches mt_blkno, they are both returned for testing purposes. The mt_erreg field always contains the current driver ver- sion. The number is a short integer, which is expressed as x.mn (for example, 3.24). The version is encoded as (100 * x) + (10 *m) + n For this example, the value would be decimal 324. The mt_resid field contains the number of usable blocks on the currently loaded cartridge. If this field is 0, the cartridge is not formatted. FILES /dev/rmt/tc[0-7] Rewind on close /dev/rmt/tc[0-7]n No rewind on close SEE ALSO mt(1), tar(1), tcb(1), tp(1), mtio(7). DIAGNOSTICS If an unformatted cartridge is loaded and the device is opened for read only, EINVAL is returned. BUGS The tapemark format does not conform to any known standard because such standards are nonexistent. When end-of-file is encountered at a simulated tapemark, the tapemark record is transferred to the user's buffer, even though the return from read(2) (correctly) does not include the tapemark bytes. A 0-byte count is returned when a tapemark is read, but another read fetches the first record of the next tape file. 2 April, 1990



tc(7) tc(7)
If the tape device remains in an error state, tc may have to be closed to clear the error condition. The mtio(7) subcommands MTNOP, MTCACHE, and MTNOCACHE are not supported. After issuing the MTFORMAT ioctl, you must close and reopen the device before it will allow any other subcommands. For raw tape I/O accesses, seeks are ignored. April, 1990 3

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026