The Ftape Installation Guide - MTIOCFTFORMAT
FTFMT_FORMAT_TRACK
-- start formatting a tape track
This command initiates the formatting of a tape track. It sets up the
cyclic dma buffer queue, programs the FDC and DMA controllers and send
the `logical forward
' command to the tape drive.
struct ftfmttrack { unsigned int ft_track; /* track to format */ unsigned char ft_gap3; /* size of gap3, for FORMAT_TRK */ };
ft_gap3
gives the size of the gap between the floppy tape
sectors. Its value has to be `233
' for QIC-40 and
QIC-80 cartridges and `248
' for QIC-3010 and
QIC-3020 cartridges.
Neither the mode of the tape drive is changed (i.e. format mode is
not entered) nor the sector coordinates are computed by this
command. The format mode must have been entered previously by the user
level formatting program using the MTIOCFTCMD
ioctl
(see MTIOCFTCMD).
The sector coordinates also have to be computed by the user level
program and must be written into the DMA buffers. To make this possible
ftape-3.04d supports memory mapping of its DMA buffers (`man 2 mmap
'). All
of the drivers DMA memory will be mapped as a contiguous block into the
address space of the user level program. To determine the size of that
memory block the user level program should use the MTSETDRVBUFFER
tape operation (See MTSETDRVBUFFER). If this operation completes with
no error then the kernel driver has successfully allocated the specified
amount of memory, i.e. the arg of the MTSETDRVBUFFER
operation
should also be used as a parameter to `mmap(2)
'.
The user level program then has to use this memory region as a cyclic buffer for the sector coordinates, i.e. when the memory region is too small to hold all the data for a single tape track then the user level program must write the coordinates for the next sector again to the start of the memory region after an overflow.
As this needs some coordination with the kernel level device driver the
program should issue the FTFMT_STATUS
format
operation (See FTFMT_STATUS) before modifying the data of the DMA
buffers. Also, before calling the FTFMT_FORMAT_TRACK
operation the DMA buffers already should be filled with data as the tape
drive will immediately start formatting the cartridge with whatever data
happens to be in the DMA buffers.
Use these buttons to jump to the top menu