NOTE: DOCUMENT X3T9.2/87-096 R0 .fo left .sp Date: June 19, 1986 To: John B. Lohmeyer, X3T9.2 Chair NCR Corporation Wichita, Kansas From: Gary R. Stephens IBM Corporation Tucson, Arizona Subject: Revised Tape Model Text Enclosed please find a diskette containing revised text for the Tape Model which is one of my outstanding work items. The diskette is formatted for an IBM PC, DOS, Release 2.0, in a double sided format. The files of interest are SCSISMOD.SCT in the raw form and SCSISMOD.PRT in the printed format. Attached is a print of the SCSISMOD.PRT file for inclusion in the next mailing after you assign an appropriate number. Gary R. Stephens .* .* .fo left :h2.Sequential Access Device Model .* :h3.Physical Elements :p Sequential Access devices (called devices below) optimize their use in writing or retrieving user data in a sequential manner. Some operations involve skip-sequential operations where the device moves to certain positions without transferring data and then resumes sequential operations. Position changes usually take a long time when compared to Direct Access operations. :p Sequential Access devices are usually tape devices. The remainder of this description is from the point of view of a tape device, however, other implementations are possible. :p The recording medium for tape devices consists of various widths and lengths of a flexible substrate coated with a semi-permanent magnetic material. The recording medium may be wound onto single reels or encapsulated into cartridges containing both a supply reel and a take up reel. The most common widths of magnetic medium used are 0.5 inch and 0.25 inch. The density and format of information written to the medium is its most frequently changed attribute. Several ANSI standards exist covering the construction of reels and cartridges for interchange as well as recording techniques for many of the format/density combinations. :p A device uses one or more read or write components to access the medium. .* The position on the medium where a longitudinal pattern of recorded signal may be written by one write component is called a track. A track is parallel to the reference edge of the medium. A device may write or read from one or more tracks at a time depending on format. The reference edge showin in the figure below is illustrative. The reference edge may be eith the top or bottom edge, depending on the specific format being used. .* .sp 2 .fo off .kp on ------------------------------------------------------------------- Track Layout on Medium (Medium Reference Edge) --------------------------------------------------------- Track 0 ------------------------------------------------ Track 1 ------------------------------------------------ . ------------------------------------------------ . ------------------------------------------------ . ------------------------------------------------ Track n ------------------------------------------------ --------------------------------------------------------- ------------------------------------------------------------------- .kp off .fo left .* :p .* A complete unit composed of the reel or cartridge and the medium is called a volume. Volumes have an attribute of being mounted on or demounted from a suitable transport mechanism. .* Mounted is the state of a volume when a device is physically capable of executing commands that cause the the medium to be moved. A volume is demounted when it is being loaded, threaded, unloaded, or unthreaded, or when not attached to a device. :p A device has an attribute of being ready or not ready. .* Ready corresponds to the state of a device when a volume is mounted. Some devices have a manual switch which logically placed a device in a not ready state even when a volume is mounted. .* The not ready state corresponds to the state of a device having no volume mounted or when the operator has operated a switch mechanism to logically prevent normal operation of the device. From an initiator point of view, ready is a state of a device when it is possible to execute non-motion as well as motion related commands. From an initiator point of view, a device is in a not ready state when all motion related commands receive a CHECK CONDITION status. :p Another attribute of a volume is called write protected or file protected. .* The write protected attribute of a volume is used to determine whether an initiator may write information on a volume. Control of the state of this attribute is usually left with the operator and/or owner of the volume. The attribute is usually only alterable when a volume is demounted. :p The medium has two physical attributes called physical beginning of medium (PBOM) and physical end of medium (PEOM). .* PBOM is that end of the medium attached to the take-up reel when a volume is mounted. In many cartridges containing two reels, PBOM is attached to the the take-up reel; .* PEOM is that end of the medium attached to the supply reel. Refer to the figure below. .* .sp 2 .fo off .kp on ------------------------------------------------------------------- Volume Layout (Medium Reference Edge) ---------------------------------------------------------- PBOM ------------------------------------------------ PEOM ------------------------------------------------ ------------------------------------------------ ------------------------------------------------ ------------------------------------------------ ------------------------------------------------ ------------------------------------------------ (Take-up Hub) (Supply Hub) ---------------------------------------------------------- ------------------------------------------------------------------- .kp off .fo left .* :p On a new volume, recording of one or more information tracks begins after mounting the volume and moving the medium from PBOM toward PEOM. Depending on the format being used, part or all of the physical tracks are recorded. If only part of the tracks are recorded at a time and the device, when approaching PEOM, reverses direction and begins writing on unused tracks, recording is called serpentine recording. Some devices also perform a rewind-like operation to position near PBOM and begin writing on unused tracks. This alternate method is also called serpentine recording but is not as efficient as the first method. :p The number of tracks written at one time varies between formats (e.g., 1, 2, 7, 9, and 18). .* The number of tracks used together at one time are called a track group. Nine-track devices using 0.5-inch medium record nine tracks at one time and have only one track group. Some 0.25-inch devices have 4, 9, 11, or 15 tracks which are written one track at a time in a serpentine fashion. In these formats, there are 4, 9, 11 or 15 track groups, respectively, each consisting of only one track. For recorded volumes, reading follows the same course of tracks as when writing. :p The entire length of medium from PBOM to PEOM is not usable for recording data. For 0.5-inch devices, several meters of medium are reserved at both the PBOM end and PEOM end to ensure that recording begins in good medium and that the medium is never pulled from the supply reel. In some instances, the medium is permanently affixed to the hubs. In other devices, the medium is kept from slipping on the hubs by the friction caused by several turns of medium around the hub. :p The usable length of the medium on a volume has additional points defined to locate the first position in the first (or only) track group where any recording may begin. This position is called Beginning of Medium (BOM). Some standards define the physical requirements for the position of BOM. The point after BOM where user data may be recorded is called Logical Beginning of Track Group (LBOT) -- LBOT1 for serpentine recording devices. :p For devices with only a single track group, the position farthest from BOM after which data cannot be recorded or read is called End of Medium (EOM). On serpentine devices, reaching this position requires that operations continue on another track group. For serpentine devices and track groups written while removing medium from the supply reel, this position is called Logical End of Track Group 1 (LEOT1). For the second track group, when written in a reverse direction, LBOT2 for track group 2 is usually near the position for LEOT1. (Note: for devices that record track groups only in one direction, all track groups are oriented like track group 1.) On serpentine devices, EOM is sometimes related to the LEOTx position of the last track group. :p Because of physical factors and environment, LEOTx positions are subdivided into Write End of Track x (WEOTx) and Read End of Track x (REOTx). The intent of such a distinction is that, for interchange, a volume written in one environment may be read in another environment. Therefore, the REOTx positions are closer to the physical end of the medium (either end) than WEOTx to enhance the probability of interchange. These differences are usually defined by applicable standards. Detection of EOM is defined in many ANSI standards. .* .sp 2 .fo off .kp on ------------------------------------------------------------------- Volumes with only one Track Group PBOM BOM ---------------------------------- EOM PEOM ------------------------------------------------------------------- .kp off .sp .kp on ------------------------------------------------------------------- Volumes with more than one Track Group (Bidirectional Recording) PBOM BOM LBOT1 --------------------------> LEOT1 PEOM Trk Grp 1 LEOT2 <-------------------------- LBOT2 Trk Grp 2 . . . LEOTn <-------------------------- LBOTn Trk Grp n ------------------------------------------------------------------- .kp off .sp .kp on ------------------------------------------------------------------- Detail on EOM/LEOT1 (LBOT) (EOM) PBOM BOM LBOT1 -------> EMW ----> LEOT1 PEOM Trk Grp 1 |--------------| (WEOTx REOTx) ------------------------------------------------------------------- .kp off .fo left .* :p When writing, independent of the position of EOM, the initiator needs an indication that it is approaching EOM. The position prior to EOM where the initiator is notified is called the End of Medium Warning (EMW) position. For some ANSI standards there are physical requirements for a marker on the medium to be detected by the device and were defined when devices had no (or very small) data buffers. For devices which implement large data buffers, the physical EMW position defined in the standards may be too close to EOM to permit emptying the data buffers and retaining compatibility with the standards for remaining capacity. A logical concept called Early End of Media Warning (EEMW) permits signalling the initiator at a position early enough to permit the data buffer to be written to the medium and leave room for ANSI standard labels, etc. The EEMW position is defined in the vendor specification. The illustrations below show the relative position of these positions. .* .sp 2 .fo off .kp on ------------------------------------------------------------------- Volumes with only one Track Group PBOM BOM LBOT -------------------> EMW --> EOM PEOM (EEMW) ------------------------------------------------------------------- .kp off .sp .kp on ------------------------------------------------------------------- Volumes with more than one Track Group (Bidirectional Recording) PBOM BOM LBOT1 --------------------------> LEOT1 PEOM Trk Grp 1 LEOT2 <-------------------------- LBOT2 Trk Grp 2 . . . LEOTn <-- EMW <------------------ LBOTn Trk Grp n (EOM) (EEMW) ------------------------------------------------------------------- .kp off .* .kp on ------------------------------------------------------------------- Volumes with more than one Track Group (Unidirectional Recording) PBOM BOM LBOT1 --------------------------> LEOT1 PEOM Trk Grp 1 LBOT2 --------------------------> LEOT2 Trk Grp 2 . . . LBOTn ------------------> EMW --> LEOTn Trk Grp n (EEMW) (EOM) ------------------------------------------------------------------- .kp off .fo left .* :p The areas from PBOM to BOM and EOM/LEOT1 to PEOM are usually unrecorded. The area from BOM to LBOT or LBOT1 usually contains a format identification (format ID) in the form of a tone burst or some other recognizable pattern. User data is not recorded in this area. The format ID content is an attribute of a volume used for interchange purposes and is defined in applicable standards. .* :h3.Partitions within a Volume .* :p Another attribute of a volume is called a partition. Partitions consist of one or more unoverlapped mini-volumes each with its own beginning and ending points occupying a single physical volume. Each partition within a volume has definitions for Beginning of Partition x (BOPx) which is similar to LBOT, Logical End of Partition x (LEOPx) which is similar to EMW or EEMW, as applicable, and a Physical End of Partition x (PEOPx) similar to EOM. PEOPx is broken down into Write End of Partition x (WEOPx) and Read End of Partition x (REOPx) as with EOM. All volumes have a minimum of one partition called the Default Data Partition. When a volume is newly mounted, it is positioned to BOM which is also the BOP1 position -- the beginning of the Default Data Partition. Partitions on a volume do not need to be recorded in any defined order (except the relationship of BOM to the Default Data Partition) nor do all partition numbers in a sequence need to be present on a volume. It is sufficient for a device to be able to locate a partition given its code value or determine that it does not exist on the volume. For interchange, information about which partitions are present on a volume may be stored on the volume in a device defined area (usually unavailable to the initiator) or it may be an intrinsic attribute of the device implementation. :p Using the unidirectional serpentine recording model, and assuming that each physical track group is defined as a partition, the following figure shows the partition oriented positions. .* .sp 2 .fo off .kp on ------------------------------------------------------------------- Partitions - One Partition per Track Group Volumes with more than one Track Group (Recorded in One Direction) PBOM BOM LBOT1 --------------------------> LEOT1 PEOM Trk Grp 1 (BOP1) (LEOP1) (PEOP1) (WEOP1/REOP1) LBOT2 --------------------------> LEOT2 Trk Grp 2 (BOP2) (LEOP2) (PEOP2) (WEOP2/REOP2) . . . . . . LBOTn --------------------------> LEOTn Trk Grp n (BOPn) (LEOPn) (PEOPn) (WEOPn/REOPn) ------------------------------------------------------------------- .kp off .fo left .*;( :p The example shows the beginning and ending points for a partition aligned with major physical points. This is not a mandatory requirement for partitins. It is sufficient for a device to be able to locate to and stay in any partition bounded by BOPx and PEOPx. The device reports to the initiator as if the current partition were the only available storage area on the volume until directed to switch to another partition. If the format of the volume includes only one track group, then the definitions for BOM/BOP1, EMW(EEMW)/LEOP1, and EOM/PEOP1 usually define the same physical positions. .* .sp 2 .fo off .kp on ------------------------------------------------------------------- Partitions - One Partition per Two Track Groups Volumes with more than one Track Group (Recorded Reverse) PBOM BOM LBOT1 --------------------------> LEOT1 PEOM Trk Grp 1 (BOP1) LEOT2 <-------------------------- LBOT2 " Trk Grp 2 (PEOP1) (LEOP1) (WEOP1/REOP1) . . . . . . . . . LBOTn-1 ------------------------>LEOTn-1 " Trk Grp n-1 (BOPx) LEOTn <-- EMW <------------------ LBOTn " Trk Grp n (PEOPx) (LEOPx) (WEOPx/REOPx) ------------------------------------------------------------------- .kp off .fo left .* :p One historical aspect of sequential access devices crosses partition boundaries. A REWIND operation always positions the medium to the BOM position. The LOCATE command or MODE SELECT command is used to position to BOPx when x is other than 1. These commands may be used to position to BOP1, but they may only be used to position to the other partitions. :p Three methods are defined in the MODE SENSE/MODE SELECT commands for managing partitions: :ul :li. device defined fixed locations; :li. device defined based on an initiator supplied number of partitions and a device specific allocation algorithm; and, :li. definition by name and capacity by an initiator. :eul :p Each method is progressively more difficult to implement and manage. The first two methods have been implemented in some 0.25-inch cartridge devices. .* :h3.Logical Elements within a Partition :p The area between BOPx and PEOPx contains only two initiator managed kinds of objects, Physical Blocks and File Marks, separated by gaps which are transferred between an initiator and a target or about which status is given. (See sequential access commands READ, SPACE, READ REVERSE, WRITE, and WRITE FILEMARKS.) The format ID at BOM, although at BOP1, is not specifically written or read by an initiator via a command. :p The initiator supplied or requested data is called a data block. Physical blocks are recorded units of initiator data blocks formatted according to the specifications of the format of the volume. A single physical block may contain one data block, a partial data block or multiple data blocks. When the physical block and the data block are not recorded in a one-to-one relationship, it is the responsibility of the device to perform all blocking, unblocking, padding, stripping, splitting and/or rebuilding of the data block(s) sent by an initiator. :p File Marks, or Tape Marks, are special recorded elements containing no user data written and are used by an initiator to set off sections of recorded data from one another. These sections of recorded data are usually called files or data sets. The file mark format is defined in some ANSI standards. The device writes file marks and detects file marks. Initiators traditionally use file marks to separate user data from labels, logical groupings of data from each other, and provide an end of data indication. At least one ANSI standard specifically defines file mark use for this purpose. Note: Most current standards do not define an explicit end of data indication so initiator/host software has used conventions with file marks to substitute for an explicit end of data indication. :p Between physical blocks and/or file marks on the medium are gaps. Although recorded on the medium, there is normally no distinguishable mark between two gaps. A gap may be a length of erased medium or a recorded pattern distinct from physical blocks and file marks. Two physical blocks are separated by one or more gaps as are two file marks or a physical block and a file mark. :p Inter-block gaps, the gap between physical blocks and file marks are introduced on the medium at the time a physical block or file mark is written without explicit action by the initiator. n some devices, the length of inter-block gaps may be controlled by the initiator. Minimum and maximum lengths for inter-block gaps are defined in some ANSI standards. :p Erase gaps are physical sections of the medium similar to inter-block gaps but are introduced through explicit commands from the initiator or through device implemented error recovery actions. The length of an erase gap may, in some devices, be controlled by an initiator. Minimum and maximum lengths for erase gaps is defined in some ANSI standards. Some devices may have no implementation of an erase gap, but all devices have an implementation of an inter-block gap. :p After writing data from BOPx, the medium is considered to be a contiguous grouping of physical blocks, file marks, and gaps. Certain ANSI standards define gap lengths which, if exceeded, are to be considered as having reached blank medium or a void. Depending on the format, such a void may be treated as an end-of-data indication, an error recovery area causing an interchange error, or a severe error with the medium. Unrecorded volumes (new or erased) exhibit void characteristics if an attempt is made to read or space the volume before data has been written. :p A Sequential Access device may be capable of supporting fixed or variable length data blocks. The capability implemented by a device is acquired from the device through the READ BLOCK LIMITS command. A device that supports only fixed length physical blocks may only be capable of supporting data blocks of the same length. The length of a data block is in bytes. The length of a physical block may or may not be recorded as an exact byte count, depending on the format. A device supporting variable length data blocks or having a format and control for partitioning data blocks across fixed length physical blocks is usually capable of writing and reading a range of data block sizes. The concept of fixed or variable mode for writing and reading data blocks only indicates the method by which the initiator specifies the size of a data block for transfer and not the method of recording on the medium. .* :h3.Data Buffering :p A device may contain a storage area capable of holding one or more data blocks - a data buffer. A storage area incapable of holding at least one maximum length data block supported by a device does not qualify as a data buffer. Such a storage area cannot support data recovery of a maximum length data block should an unrecoverable write error occur. :p A device with a data buffer may be capable of operating in either a buffered mode or an unbuffered mode. Either term is only applicable to the manner in which the device manages data blocks or filemarks to be written to the medium. The reason for this restriction is that in buffered mode, even though a device reports successful write-type operations, the data block(s) and/or filemarks may not have been physically written to the medium. This data integrity exposure is eliminated by an initiator when it selects an unbuffered mode of operation. In unbuffered mode, successful completion of a write-type command indicates successful transmission to the medium. :p A device with no data buffer is an unbuffered device and operates only in an unbuffered mode. A device data buffer may contain 'read ahead' data from the medium or data block(s)/filemarks waiting to be written to the medium. :p On write commands, a device operating in buffered mode transfers command status to an initiator once all write data has been transferred from the initiator. When writing filemarks (in Immediate mode), command status is transferred once the command is validated and the operation is started. Conversely, an initiator may be able to select an unbuffered mode of operation where the command status is not transferred until the data blocks have been successfully recorded on the medium. :p Should an unrecoverable write error occur while in buffered mode, the device generates an error condition to be presented for the active command or, if no command is active, on the next applicable command. (-- may be enhanced if asynchronous reporting is added to SCSI-2---) :p The REPORT POSITION command may be used to determine the number, storage space occupied by data blocks not written before the error was encountered. For some devices, the data block number range defined for the format is available to the initiator in the command response. :p On read-type commands, buffered and unbuffered mode is not applicable and not selectable by an initiator. The device implementation determines when and how much data to read ahead. Certain thresholds may be adjusted by an initiator using the MODE SELECT command. Such adjustments may be self-defeating when two initiators with unlike characteristics share the same device. Use of the RESERVE and RELEASE commands allows an initiator to set and hold threshold values, but the sharing aspect of operation is defeated (i.e., a common transaction logging operation). A device with 'read ahead' data blocks in the data buffer does not report an unrecoverable read error until the data block containing the unrecoverable read data is requested by an initiator. :p The WRITE FILEMARKS command with a count of zero or a count greater than zero with the Immediate bit set to zero is used to cause unwritten blocks to be written to the medium. This operation is called a synchronize operation. At the end of a synchronize operation no data blocks remain in the data buffer which have not been written to the medium. The logical and physical positions are the same. A synchronize operation has no affect on a data buffer which contains only read-ahead data or data from write commands for which the data has been successfully written to the medium. .* :h3.Recorded Object Descriptors (Block Numbering) :p Some recording formats specify that recorded objects (data blocks, physical blocks, and file marks) have descriptors included in the recorded information on the medium to help determine write sequence and also to help detect device positioning errors. The descriptor values are unique within a partition and may be unique within a volume. :p For some pre-formatted volumes, the descriptors are associated with physical data blocks. In variable length implementations, the descriptor can be associated with a physical block when the data block and physical block have a one-to-one relationship on the medium. :p Some formats may carry both recorded object descriptors and physical block descriptors. The LOCATE command defines a four-byte field to hold such descriptors. The command field may be a real physical value. However, it is sufficient for a device to be able to map a four-byte code in the CDB to a unique recorded object within the partition. :p When a data block is split over more than one physical block or multiple data blocks are concatenated to form a physical block, the data block descriptor and physical block descriptor have no relationship to each other. The physical block descriptor, unless it is also the data block descriptor is never made available to an initiator. File marks may or may not have recorded descriptors, but, if descriptors are used in the format then each file mark is assigned a value even if it is not recorded with the file mark. :p The READ POSITION and LOCATE commands use the format dependent descriptors. The size (limited to 4 bytes maximum), and content of a block descriptor is format specific and is be transparent to an initiator. That is, the READ POSITION command provides block descriptors which may be returned at some later time to a device using a LOCATE command to position to the same location (provided the volume has not been rewritten in the interim). :p The use of the term 'block number' may imply some arithmetic sequence applied to the assignment of recorded object descriptor values. The block number assignment algorithm may be defined in an applicable format standard. .* :h3.Direction and Position Definitions :p For sequential access devices, positioning has the connotation of logically being in, before, after, or at some defined place within a volume. This definition means the position is capable of being repeated under the same circumstances. The orientation of the use of the four words (in, before, after, at) is in one direction from BOPx toward PEOPx. All positioning defined below is worded from this perspective. Unbuffered devices may have some physical equivalent to these logical positions. However, these definitions do not require the medium to have a physical position equivalent to the logical position unless explicitly stated. :p The forward direction is defined as logically progressing from BOPx toward PEOPx. In serpentine devices, logically forward direction has no relationship to physical motion of the medium. :p The reverse or backward direction is defined as logically progressing from PEOPx toward BOPx. In serpentine devices, logically reverse or backward direction has no relationship to physical motion of the medium. :p The concept of being in some position means not being outside a defined region. The definition allows the position to be on the boundary of a defined region. When a volume is mounted and the medium motion is stopped, the position is always in some partition. When a volume is first mounted, the position is always in the Default Data Partition. When moving between partitions, there is no stable position. :p The concept of being 'at' some position indicates being positioned to the extremity of a partition. A sequential access device may be positioned at BOM or at BOPx or at end-of-data or at EOM or at PEOPx since these are stable positions at the extremities of a partition. :p The concept of being 'before' some position indicates that there is some data block, file mark, other defined mark or defined position when moving toward PEOPx which may be reached if the proper commands are issued. Not all positions can be reached unless data is written to PEOPx. When at BOPx, the position is also before LEOPx since this is a defined position beyond the current position. The current position may be before a data block, before a file mark, before LEOPx, before PEOPx, etc. Being before a data block means that if the initiator issues a valid READ command the data is transferred to the initiator. The phrase "...being before a data block..." also carries the connotation of knowledge on the part of the device that a data block is present. This further implies having just been placed in the current position from the PEOPx side of the data block. Otherwise, the phrase "...before the next recorded data block or file mark, if any...' is the correct phrase. The LOCATE command is described using this phrasing since positioning can be from either direction and the type of the next recorded element, if any, may not be known. :p The concept of being after some position indicates that there is some data block, file mark, other defined mark or defined position on the BOPx side of the current position which may be reached if the proper commands are issued. Unless a partition has some data block or file mark written in it there is no after position defined. When a READ command for a single data block has been successfully executed the logical position is after the data block transferred. A READ REVERSE command would transfer the same data block but in a byte reverse order. For a read command, encountering a file mark leaves the logical position after the file mark. The phrase "...being after a data block..." also carries the connotation of knowledge on the part of the device that a data block is present. This further implies having just been placed in the current position from the BOPx side of the data block. Otherwise, the phrase "...after the previously recorded data block or file mark...' is correct. The LOCATE command is described using this phrasing since positioning can be from either direction and the type of recorded element before the current position may not be known.