
DEC STD 144             COMPANY CONFIDENTIAL




        TITLE:  Disk Standard for Recording and Handling Manufacturing
                Detected Bad Sectors

     ABSTRACT:  This standard is both a hardware and a software standard.
                It specifies the hardware disk format, controller require-
                ments and software handling of manufacturing site deter-
                mined bad sectors of the RK06 and RK07 data cartridges
                and future disks.  Conformance to this standard will result
                in improving reliability for the combined hardware/software
                system as experienced by our customers.

                This standard defines the format used at the manufacturing
                site to record the locations of sectors containing disk
                surface errors.  The highest numbered track of the car-
                tridge is used to record track, cylinder, and sector loc-
                ation of the error in both 20 and 22 sector format.  Pro-
                vision is also made for recording serial numbers and other
                pertinent manufacturing information.  In addition, errors
                found at the time of manufacture and errors found in subse-
                quent field use are indicated by means of good sector flags
                in word 2 of the header.  This standard specifies two
                operating system techniques for handling these bad regions:
                one for small systems and one for large systems.  Both
                techniques prevent the user from using bad sectors
                detected at the manufacturing site.




-----+-----+---------+-----------+---+----+-------+----------------------------+
DATE |ECO #| AUTHOR  |APPROVED   |REV|SEC |PAGES  | TITLE                      |
-----+-----+---------+-----------+---+----+-------+                            |
24AUG|-----|Robert   |           |   |    :       | Disk Standard for Recording|
76   |     |Rottmayer|           | A | -  :       | and Handling Manufacturing |
18NOV|00001|Robert   |           |   |    :       | Detected Bad Sectors       |
76   |     |Rottmayer|           | B |-   :Pg. 7.0|                            |
     |     |         |           |   |    :       | DEC STD 144                |
     |     |         |           |   |    :       |                            |
     |     |         |           |   |    :       |                            |
     |     |         |           |   |    :       |                            |
     |     |         |           |   |    :       |                            |
     |     |         |           |   |    :       +----+-----+-----------+-----+
     |     |         |           |   |    :       |SIZE|CODE |  NUMBER   |REV  |
     |     |         |           |   |    :       | A  | DS  | EL00144   |  B  |
-----+-----+---------+-----------+---+----+-------+----+-----+-----------+-----+



1.0  INTRODUCTION

1.1  Motivation

The RK06 and RK07 cartridges will be a DEC manufactured and controlled
proprietary medium.  It is anticipated that the manufacturing process
will include a determination of error type and location on the cartridge.
Furthermore, it is anticipated that most cartridges will not have error-
free surfaces.  It is the intent that errors will be flagged by a care-
fully margined and calibrated tester such that the use of flagged
sectors will permit any drive to operate within the error spec for that
drive.  It is desired to communicate this error information in a uniform
way to the appropriate operating system.  This standard specifies the
responsibilities of the hardware and software in order to obtain reliable
handling of manufacturing site determined bad sectors.


1.2  Goals

1.2.1  Specify the respective responsibilities for manufacturing, en-
       gineering, and operating system software so as to create a reliable
       hardware/software system.  Specifically, the operating system
       must never receive an error condition because of an attempt to
       read or write a manufacturing determined bad sector.

1.2.2  Specify the format for information written on the RK06 and RK07
       cartridges at the manufacturing site which identifies bad disk
       surface regions.

1.2.3  Specify the requirements for controllers to handle error
       information.

1.2.4  Specify the software handling of this error information on DECsys-
       tem 10, PDP-11, and PDP-15.

1.2.5  Specify a technique which can be extended to all future disks and
       controllers.

1.2.6  Specify software techniques which are reasonable for small and
       large systems.


1.3  Non-Goals

1.3.1  The software is not required to make bad sectors appear good to a
       user who allocates contiguous sectors.

1.3.2  This standard does no address the handling of additional sectors
       which are found bad after the disk leaves manufacturing, but
       allocates a header bit and spare sectors on the highest numbered
       track for the extension of this standard to flagging of errors from
       field use.


1.4  Scope

The standard specifies how manufacturing will identify bad surface
regions an the disk cartridge.  The standard specifies how RK06 and RK07
controllers and future controllers will handle this bad region information.
The standard applies to all operating systems using the RK06 and RK07
and future disks.


1.5  Previous Standardization Efforts

There have been no previous standards.


1.6  Related Current Standards

There are no generally accepted or published related standards.  Refer-
ence to parts of this standard may be found in the specification for the
RK06 drive, cartridge and controllers.


1.7  Future Standards Activities

Due to incompatibilities with existing software, this standard will not
apply to RP04, RP05, and RP06.  The RL01 will implement the last track
error list but not the good sector flags.  Other future drives will
implement this standard but may change the specific RK06/RK07 format.


1.8  Incompatibilities

The only known incompatibilities with current software are that certain
systems may assume all sectors available.


2.0  DEFINITIONS

Cylinder - Two or more tracks which are physically located at the same
radii and can thus all be accessed without head movement.

Track - A track is the region encompassed on one surface by one revo-
lution of the disk with the head stationary.

Sector - A track is made up of fixed length sectors.  A sector is the
smallest unit which can be read or written.

20 Sector Format - The format used for sectors with 128 36-bit words, as
on the DEC system 10, or 256 18-bit words as on the PDP15.

22 Sector Format - The format used for sectors with 256 16-bit words, as
on the PDP-11.

Error - Failure of a sector to meet the missing bit, extra bit or timing
requirement of cartridge specification.


3.0  DEFINITION OF THE STANDARD OF THE CARTRIDGE SPEC

This standard defines the recording format which is used for identifying
bad sectors on the RK06 and RK07 disk cartridge when it leaves manu-
facturing.  Bad sectors are identified in two ways:  by clearing a good
sector flag in the header of the bad sector and by listing the bad sec-
tors in a file recorded on the highest number track in the cartridge.
The use of the good sector flag in each header prevents software from
accidently trying to access a bad region and is especially useful to
small systems which cannot follow the large system handling technique.
These are described in detail below.

NOTE:  Neither method is hardware protected and may be accidently
       overwritten by software.  It is a violation of this standard
       to overwrite the first 10 sectors of the highest track.


3.1  Good Sector Flags

Each sector on every track contains a header consisting of three 16-bit
words regardless of data format (20 or 22 sector).

                                            CYLINDER
+----------------------------------------------------+
| 0   0   0   0   0   0                              |       WORD 1
+----------------------------------------------------+       CYLINDER
 15  14  13  12  11  10  9  8  7  6  5  4  3  2  1  0
                         FOR                                 WORD 2
 FLAGS                   MAT     TRACK      SECTOR           SEC/TRK/FMT
+-------------------------------------+--------------+       FLAGS
|        0   0   0   0      0         |              |
+-------------------------------------+--------------+
 15  14  13  12  11  10  9  8  7  6  5  4  3  2  1  0

                               WORD 1      WORD 2            WORD 3
+-------------------------------------+--------------+       HEADER CHECK
|        0   0   0   0                |              |
+-------------------------------------+--------------+
 15  14  13  12  11  10  9  8  7  6  5  4  3  2  1  0

These header words are defined in the RK06 UNIBUS Disk Subsystem
Specification.  When a cartridge is shipped from Manufacturing, bit 14
of word 2 will be a one.  This bit is reserved for System Software to
clear in order to indicate that the associated sector has gone bad in
use.  However, this standard does not require software to clear this
bit.  Software is prohibited from using it for any other purpose.  Bit
15 will be set to zero in every sector found to be bad during the veri-
fication and formatting operation in Manufacturing.  It will be set to
one in every sector of good track.

During normal read and write operations a bad sector error will occur if
either of the two error header bits is zero.  The controller will not
read or write the data in such a sector, but will instead indicate an
error to the software.  All controllers will indicate a bad sector error
whenever bit 15 or 14 is zero.  These good sector flags may be set or
reset only by reformatting the entire track.  If the cartridge is refor-
matted, the formatting program must look up the appropriate sector in
the bad sector file and set bit 15 of word 2 to zero if that sector
appears in the bad sector file.


3.2  Bad Sector File

The bad sector file is a list of the bad sectors in the cartridge and is
recorded on the highest number track and cylinder on the cartridge.  This
track is written in 22 sector 16-bit word format, so that it can be read
on DECsystem 10's, PDP-11's and PDP-15's.

3.2.1  Data Field Format

The data field in the first sector of the last track has the following
format and is repeated in the following nine sectors.

               WORD
               ----
                0             Cartridge
                1             Serial Number
                              -------------
                2             Unused
                              ------
                3             Written with Zeros for Data Cartridge,
                                          all ones for alignment cartridge
                4             Bad
                5             Sector
                              ------
                6             Bad
                7             Sector
                              ------
                .
                .
                .
                              ------
                .             Last Bad
                .             Sector
                              ------
                .             Ones
                .             Ones
                .
                .
                .
                254           Ones
                255           Ones

Words 0 and 1 contain the serial number of the disk cartridge.  Word 2
is reserved for possible future use and is written with zeros.  Word 3
is written with all zeros for a data cartridge and all 1's for an
alignment cartridge.  After this is the list identifying bad sectors
(if any) with two words for each sector.  The list will be in ascending
order (cylinder, track, sector).


Note - This implies no more than 126 sectors can be bad.

0                                 CYLINDER                  WORD 1
--+----------------------------------------------------
  |
--+----------------------------------------------------
15  14  13  12  11  10  9  8  7  6  5  4  3  2  1  0

     TRACK                             SECTOR               WORD 2
----------------------------+--------------------------
                            |
----------------------------+--------------------------
15  14  13  12  11  10  9  8  7  6  5  4  3  2  1  0


After the pair of words identifying the last bad sector, the remainder
of the data field is written with ones, which correspond to no actual
sector and therefore identify the end of the bad sector list.


3.2.2  Track Format

All the sectors of the last track are written with the bad sector files
in the data field format described in 3.2.1.  The sector format contains
the same preambles, gaps, EEC and post amble as those on any other track.
Tracks other than the last track may be written in either of two dif-
ferent formats (see example section 3.3).  For this reason, sectors
0, 2, 4, 6, and 8 of the bad sector file track will contain sector num-
bers identifying bad sectors when the remainder of cartridge is formatted
in 22 sector 16-bit format and sectors 1, 3, 5, 7, and 9 will contain
sector numbers identifying bad sectors when the remainder of cartridge
is formatted in 20 sector 18-bit format.

The remaining sectors on the track (sectors 10-21) will be recorded
as described in 3.2.1 with no bad sectors identified (i.e. words
4-225 all ones). These are reserved to operating systems to create a
similar list of sectors which become bad during use.  However, use of
this area is not a requirement for conformance to this standard.  Software
is prohibited from using the remaining sectors for other purpose.

The header flag bits defined in 3.1 will be recorded on this track in the
normal manner.  Manufacturing guarantees that at least two even sectors
and two odd sectors must be error-free out of the first 10 sectors and
two even and two odd sectors of the last 12 sectors must be error-free.


3.3  Example

Assume a cartridge with one error near the end of cylinder 5 track 1.
This track can be written in the two formats:
                                     Error                 Index
                                     ----------+-----------+-------------
               22 Sector 16-Bit      Sector 20 | Sector 21 | Sector 0
                                      ---------+-----------+-------------

                                     ----------+-----------+-------------
               20 Sector 18-Bit      Sector 18 | Sector 19 | Sector 0
                                     ----------+-----------+-------------

In the 22 sector format the error falls in sector 20 and bit 15 in
the second header word of this sector will be cleared as in section 1.1.
In the field, if the pack were reformatted to the 20 sector format
the error falls in sector 18 and the flag bit will be cleared by the
formatter program.

The bad sector file on the last track would in this case be:

Sectors 0, 2, 4, 6, 8    Sectors 1, 3, 5, 7, 9       Sector 10 to 21

Word                     Word

  0  Cartridge #           0  Cartridge #              0  Cartridge #
  1                        1                           1
  2  000000o               2   000000o                 2  000000o
  3  000000o               3   000000o                 3  000000o
  4  000005o  Cyl 5        4   000005o  Cyl 5          4  177777o
  5  000424o  Track 1      5   000422o  Track 1        5  177777o
  6  177777o  Sector 20d   6   177777o  Sector 18d     6  177777o
  7  177777o               7   177777o                 7  177777o
255  177777o             255   177777o               255  177777o


4.0  OPERATING SYSTEM CONFORMANCE

4.1  Small Operating System Conformance

Small systems must provide a utility which allocates all of the bad
sectors to a file or set of files which the user will not access or
delete.  This program must be run whenever the disk is refreshed.  Thus,
the user will never allocate or access a bad sector found at the
manufacturing site.

4.2  Large Operating System Conformance

Large systems must mark off the bad sectors as in use whenever the disk
is refreshed.  Thus, the user will never be allowed to allocate or
access a bad sector found at the manufacturing site.

4.3  No system is required to remap bad blocks so that the user who is
allocating contiguous space is unaware of the bad sectors.
