`
`U.S. Pat. 6,470,399
`
`Apple 1007
`U.S. Pat. 6,470,399
`
`
`
`
`
`fifiifi-§:@§;§§, 1%
`
`@935;
`
`Q
`
`ima
`
`3 5:31:55 Fmgmmmmg
`
`lil! I
`
`
`
`© 1995 Addison-Weslev Publishers Ltd .
`© 1995 Addison-Wesley Publishing Company L"'1c.
`
`./
`
`Translated from the German edition SCSI-Bus und IDE-Schnittstelle
`published Addison-VVesley (Deutschland) GmbH.
`
`rights reserved.
`or transmitted
`
`reproduced, stored
`of this publication
`or by
`means, electronic, mechanical,
`
`a retrieval
`
`not
`respect to the programs.
`
`by
`designations
`.....,,._._._._.._,~'-'are claL1TI.ed as trademarks.
`
`manufacturers
`
`sellers to disf_c_n_guish
`has made every attempt to
`their products rrtentioned L""l
`
`Cover designed Designers & PartHers,
`prirded by
`Riverside PrL"tting Co. (Reading)
`V ..A~P Group, Kidlington, Ox on.
`Great Britain at T.J.
`
`0-201-42284-0
`
`1. SCSI
`TK7895.B87S36
`6·2--dc20
`
`I. Title
`
`94-23813
`CIP
`
`b
`
`
`
`Preface
`
`The SCSI bus and IDE interface are without question the two rnost important
`interfaces for computer peripherals in use today. The IDE hard disk i.nterface is
`found almost exclusively in the world of IBM PC compatibles. The SCSI bus, on
`the other ha_nd, is designed not only for hard drives but also for tape drives, CD(cid:173)
`ROM, sca_nners, and printers. Almost all modern computers, from PCs to work(cid:173)
`stations to mainframes, are equipped with a SCSI interface.
`Both SCSI and IDE are Ai'JSI standards. Hovvever, aside from the actual
`ANSI documentation, there exists almost no additional reference material to
`either specification. The purpose of this book is to fill that void 'With a clear, con(cid:173)
`cise description of both i.Ylterfaces. The essential terminology is introduced,
`while the commands and protocols are broken dovvn in full. In the interest of
`economy the less important details and options have been omitted in certain
`cases. Often a specific section in the ANSI documentation -vvill be cited for easy
`cross-referencing. After reading this book you should be in the position to easily
`understand relevant technical docw~entation, includi.ng the ANSI specifications
`themselves.
`First and foremost, a thorough introduction to the terminology is h"'l.
`order. Especially with respect to SCSI, there is a deluge of terms and defirtitions
`that are used nowhere else or are used differently than in other cornputer
`domains. Tnese keywords, which ircdude signal names and interface corn(cid:173)
`mands, are t~ypeset in small capital letters,. for example FOK\1AT D"NIT.
`This book is intended for readers vvith a broad rat"Lge of tecbJ:lical back(cid:173)
`grounds and interests. Those vvorking on the design of mass storage devices, for
`example, will find the protocol descriptions extremely useful. Readers ·writing soft(cid:173)
`ware or device drivers may have other interests. They will :End the hardw-are
`descriptions, such as that of the physical organization of a disk drive, very helpful.
`This book is not mea..nt to replace the ANSI docu__,_-rnentation. On the other
`ha_nd,. those specifications are not meat"tt to explain the technology, rather to
`define it. It is very difficult to find your way around in the origin.al documenta(cid:173)
`tion without an u..Ttderstandi.."'l.g of the subject matter. The book's thorough, in(cid:173)
`depth descriptions" along with index and glossary; rrtake it the perfect tutor for
`IDE and SCSt as -vvell as a helpful guide to the Ai'\JSI literatu.re.
`Friedheim Schmidt
`February 1993
`
`v
`
`
`
`Contents
`
`Preface
`
`I
`
`Introduction
`
`1 Computers and peripherals
`1.1 Mass storage
`1.2
`Peripheral interfaces
`
`2 Traditional peripheral interfaces
`The RS-232 serial irtterface
`2.1
`2.2 Tne Centronics printer mterface
`2.3 Hard disks and their mterfaces
`2.4
`ST506
`2.5 ESDI
`
`3 Computer buses
`3.1 Characteristics of buses
`3.2
`Specialized buses
`
`interface
`
`4
`4.1 The origin of IDE
`4.2 Overview
`4.3 Outlook
`4.4 Docum_entation
`
`'"" The physical IDE interface
`The electrical mterface
`5.1
`5.2 Timing specifications
`
`6
`
`IDE protocol
`The register model of the IDE controller
`6.1
`6.2 Command execution
`6.3
`Power-up or hardware reset
`
`vi
`
`v
`
`1
`
`3
`4
`5
`
`7
`7
`10
`13
`19
`23
`
`29
`30
`32
`
`35
`
`37
`37
`38
`40
`41
`
`44
`44
`47
`
`50
`50
`55
`58
`
`
`
`7 The model of an IDE disk drive
`7.1 Orgru.lization of the medium
`7.2 Defect management
`7.3
`The sector buffer
`7.4
`Power conditions
`
`8
`
`9
`
`10
`
`11
`
`IDE commands
`8.1 Mandatory commands
`8.2 Optional commru."'"1ds
`
`9.1
`The evolution of SCSI
`9.2 Overview
`9.3 Outlook
`9.4 Documentation
`
`SCSI hardware
`10.1 SCSI configurations
`10.2 SCSI signals
`10.3 Cables and con..rtectors
`10.4 Single-ended SCSI
`10.5 Differential SCSI
`10.6 SCSI bus phases
`10.7 Synchronous transfers and Fast SCSI
`10.8 Wide SCSI
`
`SCSI bus protocol
`11.1 The rrtessage system
`11.2 I/0 processes
`11.3 SCSI pointers
`11.4 Disconnect-reconnect: freeing the bus
`11.5 Transfer options
`11.6 Tagged queues
`11.7 Termination of I/ 0 processes
`11.8 Error handling in the message system
`11.9 Async:hronous event notification
`
`12
`
`SCSI commands
`12.1 The SCSI target model
`12.2 Command descriptor blocks
`12.3 Commands for all SCSI devices
`12.4 Mode parameter pages for all device classes
`
`Contents
`
`vii
`
`60
`60
`62
`63
`64
`
`66
`66
`70
`
`77
`77
`79
`84
`85
`
`89
`89
`92
`96
`96
`100
`102
`113
`116
`
`117
`117
`119
`122
`123
`124
`126
`127
`129
`129
`
`131
`131
`133
`138
`155
`
`
`
`viii
`
`SCSI Bus and IDE Interface
`
`13 Direct access devices
`13.1 Tne model of a SCSI disk drive
`13.2 Hard disk commands
`13.3 Mode parameter pages for disk drives
`
`14 Tape drives
`14.1 The model of a SCSI tape drive
`14.2 Commands for tape devices
`14.3 Mode parameters for tape devices
`
`15 Printers
`15.1 The model of a SCSI printer
`15.2 Printer commands
`15.3 Mode parameters for printers
`
`16 Scanners
`16.1 Tne rrtadel of a SCSI scanner
`16.2 Scanner corrnnands
`16.3 Mode parameters for scan_ners
`
`17 Processor devices
`17.1 The model of a SCSI processor device
`17.2 Conunands for processor devices
`
`18 Communications devices
`18.1 The model of a SCSI corru-nunications device
`18.2 Co:m__mands for SCSI commu1tications devices
`18.3 Mode parameter pages for communications devices
`
`19 Optical storage and WORM drives
`19.1 The SCSI model of optical storage
`19.2 Commru"'tds for optical storage and "VVOR1v1 drives
`19.3 Mode parameters for optical storage
`
`20 CD-ROIVI
`20.1 Tile model of a SCSI CD-ROM drive
`20.2 Commands for CD-ROM
`20.3 Audio co:mrnands for CD-ROM
`20.4 Mode parameters for CD-ROrv1s
`
`21 Medium-changer devices
`21.1 The model of a SCSI medium-changer device
`21.2 Commands for medium-changers
`21.3 Mode parameter pages for medium-changers
`
`22 The SCSI monitor program
`
`158
`158
`165
`173
`
`180
`180
`184
`190
`
`193
`193
`194
`197
`
`200
`200
`202
`204
`
`206
`206
`207
`
`210
`210
`211
`213
`
`214
`214
`215
`220
`
`222
`222
`224
`227
`229'
`
`233
`233
`235
`237
`
`240
`
`
`
`23
`
`Software interfaces
`23.1 The concept of ASPI
`23.2 SCSI request blocks
`23.3 ASPI initialization and function calls
`
`24 Test equipment
`24.1 SCSI analyzers
`24.2 SCSI emulators
`24.3 Examples from industry
`
`25
`
`SCSI -.-.-..r~+,n,,~r.
`25.1 The NCR 5385
`25.2 Target applications: EI'vfULEX ESP200
`25.3 PC host adapters: FUTUF--E DOM""L\IN Tiv1C-950
`
`Glossary
`Index
`
`Contents
`
`ix
`
`247
`248
`248
`253
`
`257
`257
`258
`259
`
`262
`263
`264
`266
`
`269
`
`273
`
`276
`
`281
`
`283
`
`290
`295
`
`
`
`Inimdusfian
`
`1
`2
`3
`
`‘C0::fipuéers and pezépherais
`T1“adfii{3«1:3L» pe:‘f;phe:ra} inéezfaces
`Compifiier buses
`
`
`
`A
`blocks.
`rnernory,
`liotrtlctions
`
`mat'1
`
`must reside in
`ca..n be run it rnust
`
`be loaded ir1to main mentory hom mass
`such as the
`prograrn comes either from
`step in order
`"-''-'''-'--"-........ The CPU accesses .................. u.n..
`accesses are
`machi.ne i11structions. In
`data. For this reason the CPU and mernory
`above
`fast.
`
`Terminai
`
`Pr1nter
`
`L.1. contrast to .,....,_,,,...,.,.,..,,.,, ... T
`from the
`
`.
`-,
`aev1ces.
`
`
`
`SCSI Bus and IDE Interface
`
`is slovver and more
`
`is
`Con~wtunication
`such as SCSI or IDE. On
`the
`cornmLlnicates 'vvith the CPU and rnemory,
`
`the
`
`disks
`
`rnediurn
`
`cont-rast
`onto
`
`devices Under the
`
`\lideo cassettes
`
`devices
`
`or a
`function as
`
`and
`
`
`
`devices are
`
`abstract
`
`true that sorne
`
`the P~merican J'J a tional
`for SCSI-3.
`
`5
`
`interfaces. The
`the
`u ................................. ,_,. It is also
`In this book I
`
`the first tirne
`
`data
`
`cle'llce model~ Here tl-le
`heha~;Tior of devices to be connected to the ir1terface is described. Th_ese
`
`and so on are
`
`def:lited~
`
`model
`
`rnakes
`
`there are
`
`
`
`6
`
`SCS/Busand/OE
`
`Command set
`
`PostScript
`
`Device model
`
`Printer
`
`Protocol
`
`Centronics
`
`of
`
`page
`
`•
`•
`r
`lit terrace
`difference
`
`ii1 tb._at it conta_irts
`1011r
`it rrtakes rto
`tlle irtterface
`
`if you
`then frte iilterface
`to co:Il.J.~ect
`vvould be a matter of luck
`The IDE htterface a.rtd the SCSI bus are like~/vise
`interface
`like to int;oduce in
`defirJtions. Before
`
`v~lhetller it vvou_ld ~J:nctiort
`
`still
`
`definitions contain
`
`crtd the
`
`IDE and_ SCSI TI-tterfac-es
`
`the other~
`
`vvill
`()fl€ llaltd
`
`
`
`·lhis
`
`Tnese
`
`interfaces are
`face cl1aracteristics that are
`to a certain r l '
`0 r'-'"'"'"
`IDE and SCSI bus
`in the rnore
`rrtake it rrtucr!_ easier to e"raluate and_ ur1dersta.rtd tl-teir rnoClern
`
`the
`
`PS-232C is tf1,e m._ost
`
`for tile
`
`,. rJin.e
`
`used serial i11terface. 'Serial' rneans that the da_ta is
`across a
`conilection. FS-232C is used
`and
`
`IneasurerrLent h~strtwlents
`
`ruid hardvvare
`a fevv build
`This leads to an uncorru~on situation 'Nith
`
`RS-232C and
`cables are used that conduct
`v.rould be 11nthirtkable
`fbree
`
`rrrirj-RS-232~
`
`
`
`8
`
`SCSI Bus and JOE Interface
`
`The
`
`cor,.nection
`Mi_rti-RS-232 establishes a bidirectional
`Each direction has its ovvn data sigHal a_rtd a sin.gle
`shared. The data signals are
`TD (transmit
`and RD
`W-:h_en rwo devices are
`to each
`these signals are crossed such that
`the TD of one device collll_ects to the RD of the other
`
`+15 v
`
`0
`
`-15
`
`Start bit
`0)
`
`8 Data bits
`
`Stop bit
`
`25 U 1
`~~~----~~--~--------/'--------------------------~;~·~:
`1 t0 25
`Receive data
`Receive data
`
`ittterface: rnitti-RS-232.
`
`the ELA.. sta_ndard is the 25-piil DB25. Other con(cid:173)
`such as the DB9 for the IB1vi AT or
`coru:_ector used it:_ various
`On the signal
`betvveen +5 V
`a logical 1 is
`and + 15
`and the receiver recognizes ai"lytrting above +3 V as such.
`logical 0 is represented
`a signal
`behveen -5 V and -15 V.
`receiver recogDizes any signal belovv -3 V as such.
`character. The characters
`Data tra..nsfer takes
`character
`one. On
`are further broken down into
`the receiver then assernbles th_e bits back L"'l.to characters. The
`the other
`nlli'llber
`bits per character lies bet-ween five and
`is needed to transfer one
`The data bits are "'"'o,~oru::.r~
`a start bit ill'ld fol-
`a
`bit rnay be sent for error detection. The
`a
`transfer rate can range berNeen 75 and 115 000 bits
`2..r1d a
`the devices rnust be
`cable alone cannot compensate for
`set at the same
`othenvise no c.x~f~JTJir._;;;.,.._ of data ccul take place.
`this method of trillLSfer over the
`Novv comes a rather confusing
`serial interface is called asynchronous even though the data is sent and received
`relative to a dock
`serial interfaces the terrn
`to
`vvhenever a clock is
`For RS-232C,
`the t:rar1sfer is
`r..,~,_..,..,.,..,.,.,..,~,,"' because the clocks are not tied to each
`Tne RS-232C spec-
`LL.>.UU.A.'--0 J.l-F-,.l.H.<.Lv that
`\Alhen
`
`the data
`
`
`
`Traditional
`
`interfaces
`
`9
`
`referred to as
`
`signals to
`uses
`'-''-J.!.'L..!.LJ, -vvill be made clear in Section 2.2.
`can con-
`vvhen thinking about data throughput
`a byte or character to be 10 bits
`stop; one start and eight data bits).
`When t.lte fastest tfansfer rate possible is
`115 000 bits per sec-
`the maximurr1
`is approximately 11.5
`per second.
`
`.,....,.""""'''""'....,.
`
`MirJ-RS-232 has no .,..,.,..,"·"r·r:d
`used with the ITltE?r:tace
`the
`
`.,....,~ .. ,...,.,..,--. .. ,,; that is often
`It v1orks h"'l.
`
`- characters are some(cid:173)
`cat"GTlot be used for bidirectional transfer of
`a subset
`
`the data is not restricted to certain
`may occur. In this situation there is no roorrt for
`XON
`
`monitors and
`
`hovv-
`
`PC
`
`Printer __________ __,:---s :-----------;'.·o ~' - - - - - - - - - -
`,
`XOFF
`
`XON
`
`\
`
`2.2 XON
`
`of a
`
`cornrnercial
`
`There are no
`
`n,-n_,.,...," data
`can be used at no cost for non-
`rrta..nufacttlrers have also ,devel-
`of RS-232.
`
`As P.S-232 'Nas
`frorn the it-"tterface.
`ll_,_'liversal corr1rnand sets for whole
`
`for use ·with RS-
`
`
`
`1 0
`
`SCSI Bus and IDE Interface
`
`many possible vari(cid:173)
`can see,. an interface that builds on top of RS-232
`As
`ations. The complete description of my printer-PC interface would be: RS-232 at
`9600 baud, 1 stop bit, no parity, XON /XOFF protocot PostScript. If I were to
`change a parameter for only the printer or only the PC, for example by not send(cid:173)
`ing PostScript or starting to use a parity bit, nothing
`print. Although
`mi_ni-RS-232 appears to be simple (only three wires), there are almost an
`uncountable number of ways in which the connection ca.,_~ fail. Wnat is missing
`that allows the devices to agree
`the available
`.LLU.n .. nu.<::...~L RS-232 has
`a
`of
`vvho has 1fvorked with
`it nonetheless has tfte decided '"'r-1..,.,.~,.,..., 1""
`on every
`and is also device
`
`that it exists
`
`for printers. It is an
`interface
`The Centronics interface is a
`standard
`to my knowledge,. has never been officially
`As
`a result there are rr~.any variations. This is especially so ·with respect to the status
`signals that reflect the printer's current state. Centronics defh1.es Lhe physical
`interface and the protocol. As a comma,_'l.d set, either PostScript or another print(cid:173)
`er language is used.
`as a unidirectional interface, the parallel printer
`Origi.11.ally
`be used bidirectionally. 111is extension is not our concern
`PCs can
`link
`here. vVe are interested in Centronics mostly as ru.1.other example of the various
`h1.terfaces.
`it is also a good idea to knovv this interface in
`order to understand the difference from_ SCSI printers (see Figure 2.3).
`
`The
`
`Centronics uses a shielded t-wisted-pair cable vvith 36 signals, of rnaximum
`_._,__.._""-~~- 5 meters (about 16 feet). A 36-pin amphenol connector is used on the
`"'""'nihor end, vv-hich most people have corne to refer to as a Centronics connector.
`Tb.e
`end of the cable has either a
`feinale Centronics or
`a female DB25.
`
`A 0
`to those for transistor-transistor
`Electrical The signal
`a 1 from +2.4 V to +5.0 V. Table 2.1lists the sig(cid:173)
`is recognized from 0 V to +0.8
`nals of Lhe Centronics interface. Note that I have described Lhe data signals start-
`ing with 0; that is7 using the logical names. The actual signal names/' however?
`are DATAl to DJl,:TAS.
`Data transfer takes place in parallel across signals DATAl to DATAS. Tne
`signals STROBE, BUSY and ACKNLG control the sequencing, 1fvhidl is shown in
`Figure 2.3. The term 'protocoY does not apply
`here. Relative to our
`layer modet this timing belongs to the definition of the
`interface.
`
`h
`
`
`
`Traditional peripheral interfaces
`
`Table 2.1 The signals of the Centronics i..nterface.
`
`Pin
`(Cen)
`
`Pin
`(DB25)
`
`Signal
`
`Source Description
`
`1
`2
`3
`4
`5
`6
`7
`8
`9
`10
`11
`12
`13
`14
`
`1
`2
`3
`4
`5
`6
`7
`7
`9
`10
`11
`12
`13
`14
`16
`
`17
`
`STROBE
`DATAl
`DATA2
`DATA3
`DATA4
`DATAS
`DATA6
`DATA7
`DATA8
`ACK:'JLG
`BUSY
`PE
`SELECT
`AUTO FEED
`SIGNAL
`GROUND
`CP.cASSIS
`GROUNu
`+5V
`18
`19-30 18-25 SIGNAL
`GROUND
`INTI
`ERl?.OR
`SLCT II'~
`
`31
`32
`36
`
`16
`15
`17
`
`Host
`Host
`Host
`Host
`Host
`Host
`Host
`Host
`Host
`Printer
`Printer
`Pri..nter
`Printer
`Host
`
`Indicates valid data on DATAl-8
`Data bit 0
`Data bit 1
`Data bit 2
`Data bit 3
`Data bit
`Data bit 5
`Data bit 6
`Data bit 7
`Indicates pr1."1ter has
`Indicates
`is not
`Paper error
`Printer is onli..."1e
`The pr.u"'tter should add a ca_,_"'"fiage rehLrn to eacl1 line feed
`
`DATAl-8
`for new data
`
`Pri_nter
`
`+5 Vpower mA maximum)
`
`Host
`Prit1.ter
`Host
`
`Initialize pri..nter
`General error
`Select printer
`
`DATA1-8
`
`STROBE
`
`BUSY
`
`ACKNLG
`
`I I
`l l !
`
`____ !_ !_
`
`------------~'
`
`i
`
`LJ
`··n
`
`I __
`
`'
`~I ----------------~
`I i
`i u
`
`2.3 Centronics interface timing.
`
`sets the 8 bits on signals DATAl
`it then activates a pulse across
`for at least a
`to DATA8.
`fb_e
`STROBE, which L.idicates that
`is valid data on the data lLDes. In
`printer sets BUSY and reads the data
`As soon as the
`has been success-
`read and the printer is
`to receive the next byte, it dears the BUSY sig-
`nal and sends a
`across the ACKl."'-JLG
`N oTw the
`the
`
`
`
`12
`
`SCSI Bus and IDE Interface
`
`This method of data
`tl1e next
`a..'td send the next STROBE
`data
`STROBE) and another to
`transfer, -vvhere a signal is used to i..ndicate a request
`acknowledge that request (here ACKL'\"LG), is called asynchronous. The mecha(cid:173)
`nism itself is termed
`
`arnount of data trap.sferred per
`upon
`Tne other signals
`leaves its BUSY signal active for each
`ho-vv
`in total. If a C"Yr'11'"l -j-,c;r
`it"'lvolved i__n the handshake need at least 4 rrJcroseconds
`in arou_j_-td 10 ps. This ·would cor(cid:173)
`second. The hru1.dbook for my laser
`100 ps for the
`of BUSY, wrdch
`second.
`
`active. lhere are,
`reflect the pri__nter/s status. L~ese fall under
`\llibJch places them in the
`In addition to these are the
`
`the
`
`of status signals that
`of rrcessage exchange,
`
`AL10FEED, INTI/ and SLCT I\L All of
`
`TI·le Centronics printer h1.terface is our first
`face. Th_e method of data i:-ra_j_"lsfer is very sirrJlar to
`the
`for end of
`and carriage return pertain
`that
`ignoring the
`h1.terface sin-tply
`as a general purpose
`specific signals. Exarrtples of these h1.dude network adapters a..r1d disk
`
`li-tter-
`
`use
`
`drives.
`
`the t"fruLSfer rate. TrJs characteristic of
`1 vvnen
`look at the SCSI bus.
`tl12 Centronics iilterfa_ce itself contair1-s neither a
`.~..~s in the case of
`device model nor a corrLITtal'.d set. As shov•ln in
`necessary in_ order to defL.rte a
`L.rtterface as it sta..nds is flexible. There are even
`advantage of tl"'Js very
`interface.
`CentrorJcs, like RS-232, establishes a ""'''' 1
`devices. This rr~.eans that
`a sirtgle
`because the
`to address different devices is
`to the next
`-vve will discuss.
`
`".,_ __ .,-r,_-.-..n.,.,..,,.,_ COlli'lection bet>Neen
`used for each interface
`This nevv feature
`
`tl1e
`devices that take
`
`
`
`A little
`
`Traditional peripheral interfaces
`
`13
`
`Hard disks and their interfaces
`
`This section and the follo-vving two sections on ST506 and ESDI delve more
`deeply into details thru_~ previous sections? because it is here that the foundation
`for understanding IDE and SCSI is laid. If you are not well acquainted -vvith the
`internals and workings of hard disks}' you will find this section especially inter(cid:173)
`esting. Here, you will learn L~e terminology of the disk drive domain.
`
`drives with
`in
`on.
`-vvere statl.dardized
`Disk drive
`with the SMD interface.
`a diameter of 14 inches and then 8 inches were
`The na:rne comes from the Storage 1v1odule Drives of the
`CDC. CDC
`has since sold its drive
`to
`as a result
`per(cid:173)
`had a transfer rate of 24 ]\,ffiz or
`could not survive the t-ran-
`per second. The
`about 3
`because of the very wide cable. As a result
`sition to 5% inch drives,
`SMD died along with 8 itl.ch drives i.n about 1990.
`Five years after the arrival of
`Seagate i.ntroduced a 5% inch drive
`-vvith a storage capacit-y
`5
`This economical disk drive}' at the lower end
`of the performance scale, used a nevv interface called ST506. You will often hear
`ST506/ST412 beL.!.g used to refer to the same interface. ST506 was not developed
`from scratch, but evolved from the Hoppy interface. The transfer rate was
`increased to 5 MHz
`625 Kbytes per second) but the rnethod moving
`remai_'ied the same. L1. the past few years,
`heads
`sendi.ng step
`advances have allowed
`transfer rate to be doubled once agai.n.
`the
`demru"'l.ds of modem PCs have finally exceeded the interface's capabilities: ST506
`has been steadily losing ground to IDE atl.d SCSI sliice arou..~d 1991.
`It -vvas apparent early on that 5% inch drives would be capable of perfor(cid:173)
`mance that ST506 could not support. S:iviD
`have fitted the bill but it vv-as
`too big a_nd too expensive. In 1983 the disk drive manufacturer Maxtor came out
`with the Enhanced Small Device Interface (ESDI) to remedy this situation. The
`ESDI used the same cables as ST506 but allowed transfer rates of up to 20 1vLl-lz
`(2.4 Mbytes per second). In addition, ESDI had commands, for example, seek to
`track.
`ESDI can occasionally be found h~ the
`and -vvork(cid:173)
`station domain.
`it too is quickly being crovvded out by SCSI. Nevv dri-
`ves -vvith the ESDI interface are no
`being developed.
`
`The disk drive
`model
`
`to understa..nding IDE -vve ·will make hvo stops to examine its prede(cid:173)
`On our
`cessors, the ST506 and ESDI interfaces. Before '!Ire do
`we need to
`become acquainted with the basic model of a disk drive. A hard disk drive stores
`information on a set of rotalli""lg disks. The infon:nation ca..n be written and read
`any number of tL.ues and the data remains intact even after the drive is ttJ.rned off.
`The term 'hard disk' most often refers to a drive with -nr.-.-.--·a-rnn;rc::>
`some
`media drives do use hard disks. A hard disk
`media
`contrasts ·with the flexible rnedia used i.._~ +~r'r»''""' 7
`
`
`
`14
`
`SCSI Bus and IDE Interface
`
`of
`the medium
`
`This model of a disk drive will say nothing about the exact method of
`writing to the medium. Tills means that it will be valid for magnetic disk drives
`as well as magneto-optical, diskettes, and removable media drives. CD-ROM
`and WORM drives, however, do not fall into this category; these formats lack the
`ability to rewrite information.
`
`consists of a number of \Atritable surfaces,
`The disk assembly of a drive
`each of -vvhich stores data on concentric rings called tracks. T'.ne t-racks are further
`illlit. A sector is
`divided into sectors, which are the smallest
`accessed
`first
`the
`track. The
`drive then waits until the desired sector rotates lli'l.der.r1eath the head and reads
`the data.
`bit
`bit.
`the sector is dorte
`and
`behveen rNo and eight disks, and
`storage. Each surface has its uwn
`disk can be
`one track Cillt be vvritten to or read at a
`read/1/>Hite head although
`lli-ue. The heads are
`over the tracks. A set of tracks that
`is called a
`A con-
`can be accessed by the heads from a single
`sector of the drive can be
`sequence of this organization is that
`addressed
`its cylinder, head ili"l.d sector numbers. Tnis is referred to as the
`drive geometry (Figure 2.4).
`
`Cylinders consisting of
`six vertically aligned tracks
`
`Seven tracks
`each divided
`into
`sectors
`
`Three disks
`with a total
`of six surfaces
`
`2.4 Structure
`
`disk medium.
`
`Sedor format
`
`to identify the beginning of a track there is a_n interface signal called
`In
`Il\JTIEX, which issues a pulse at the precise moment when the heads reach this
`position. This is where the first sector of the track begins. At the start of the other
`sectors another interface signat SECTOR, issues a pvJse. If the sector pulse is gen-
`erated by special circuitry that senses the relative
`of t_he disks,
`the drive is said to be hard sectored. The drive is
`sectored if the beginning
`of the sector is
`read
`the rnedium
`the heads.
`
`
`
`Traditional peripheral interfaces
`
`15
`
`disk format-
`A computer uses data in parallel; that is, bytes not bits.
`ter is a chip, which in addition to identifyi..rtg sectors by their sector number also
`takes the serial data from the heads and groups it properly into bytes. The data
`separator sits betvveen the heads and the formatter chip. vVhen data is read from
`the drive it generates an accompanying clock. Finally, the read/write amplifier
`circuitry amplifies the analog signals to and from the heads. The electronics that
`pertain to actual reading and writi..ng of information are collectively referred to
`as the data chan..'lel.
`A sector is made up of a number of different fields -vvhich are -r .. rr,,+ha-.(cid:173)
`.,.o·\-o.,.·...-a,r'l to as the sector format. Sector formats differ from LTtterface to interface
`format CC:Ul be described as follows: first comes a field for "''r.,.-,r•h.-•r._
`followed by the address field. The address field con(cid:173)
`ac'ld sector numbers. Vvitt~ t:bis information the con-
`the correct sector. After the address
`"'-'"-.1.'"--J'-"-''-'-~, wl-tich is used to check
`All fields up to this
`whether the
`referred to as the header. Novv comes the data. Here too a "' 7-.,-,,...h, • .,.,..,,r,...,*-,"'.,...,
`field is used)'
`the actual data of the sector. L'l the place
`address field has a CRC checksum_, the data has a nillT' .. ber of error correction
`code (ECC) bytes. The ECC alloV'TS the controller to test whether the data has
`been correctly written or read. In addition a certai..'l number of incorrectly read
`bits Crut actu.ally be corrected using this code. 11te sector ends with a gap used
`to even out small differences in motor speed. Tile number of data bytes in a sec(cid:173)
`tor corresponds to its formatted capacity
`sector sizes are 512,
`1024 and 4096 bytes. The header, ECC and gaps use up space for bet-ween 40 and
`100 bytes, dependL_~_g on the sector format (Figure 2.5).
`
`troller
`
`VFO
`sync
`
`5\ 2 Bytes data
`
`_.-
`
`·- .. ·-
`
`!sync I Cyi.inder I Head I Sector I ~~~ I
`
`Soft-sector format
`
`!s
`
`512 Bytes data
`
`1
`
`1
`
`Index puls~'--j _____________________ ___jn __
`!
`:
`i
`I
`! Gf-P I Header !Gap IY
`IEcci G3apl
`l 2
`l
`~~
`I
`,
`I
`
`f
`
`-
`
`. . .
`
`.
`
`I Sync I Cy!ir.der I Head I Sector ! CRC !
`
`. - .
`
`Hard-sector format
`
`2.5
`
`sector format.
`
`for data "'""'_.,..,..,.., ,.,. . .0
`after the drive's rnedium has been formatted is it
`'CAT,.,.,...,.,.,,..,. not
`the headers but also the data field. Art
`V'uitten
`the entire drive is formatted at one tirrte
`
`
`
`16
`
`SCSI Bus and IDE Interface
`
`a sector is relatively sirnple. As soon as the head is posi-
`The readirtg
`tioned at the correct cylinder_, the desired head is chosen and the formatter chip
`reads headers until the proper address comes by. The data directly follov,ring this
`header is the data required.
`a sector is a bit more complicated. A write looks just like a read
`header is found_, then t.~e amplifier circuitry svvitches from readi..Tlg
`along with ECC, is written. A write-splice is located
`and the new
`to
`between the header and the data field to allov'~l -Hme to turn on -t."l-te \Vrite current.
`
`Format
`characteristics
`
`It is not
`addresses are adja(cid:173)
`the case that tvvo sectors vvith
`cent to one another on the mediu_,_-rn. Tne li.J.""nited throughput of early drive con-
`trollers made it necessary to
`certain
`L"fl the for:rrtat design. The
`to IDE as well SCSI.
`discussed here are
`
`Interleave
`
`Track d.l-"Ld
`ske•N
`
`sm_all local buffer which held at most a sec-
`drive cont-_rollers had a
`of data. This situation forces the cont"_roller to pass the data on to the
`before reading the next sector. If this can_::_n_ot be accorrtplished irt the
`ti1ue it takes the head to pass over the short gap between sectors, the controller
`must vvait for a complete revolution of the disk for the sector to corne around
`of this era/ this rneant -vvaitL.1.g 17 n1s for the next sector. In order
`the format of the track can employ an interleave to L'lSure
`that there is enough time to get ready for the next sector.
`a interleave of
`for example, the sector with the next adjacent address is rwo physical sec(cid:173)
`This makes it possible to read all sectors of a track with only two rota(cid:173)
`tors
`tions of the disk vvhile ir~urL.J.g that there is ample time to pass the data to the
`computer. Older devices employed even larger i."'l.terleaves. An interleave of
`three means that tvvo physical sectors lie behveen adjacent sector addresses.
`Modern controllers no longer use interleaving;
`have data buffers, wl-'J.ch
`acco:rrtm_odate at least rut entire track.
`
`for r_ransferring large blocks of data the con-
`the data on a single track. If the data occu-
`system ·vvill
`r_rack then the track of the next head in this same cylin(cid:173)
`and so on, until the
`is full. Tne reason for this ,.,.,,..,.,"""''"7--:l'i----"''---.
`der is
`is that the tin1e needed to change heads is much shorter than the time needed to
`change tracks.
`after the entire
`has been used must the heads be
`repositioned to the next cylinder, vvhere the procedure can begin agai..n.
`Even switchLYlg the heads!' vvl"'J.ch is done electronically, can cause
`enough of a
`to miss a sector. When the last sector of a track is read and the
`heads are S\ATitched to begin a new trackf the resulti__ng lag may prevent the first
`sector
`the track being read. Waiting for an additional revolution (called /miss-
`can be avoided
`offsetful.g the first sector address by one or sever-
`sectors. Tnis featu_re is called track skevv (spiral offset). 1viodern con-
`are usually capable
`a track skew of zero \Nith the help
`data channel ,,,..,__._,._,..'""".,."''
`
`
`
`Traditional peripheral interfaces
`
`17
`
`a seek from one cylinder to the next 1.-H.A.J<-"-'-... U-
`The delay
`2 ms. hi t.his case as
`an offset can be employed to
`cylinder is of the order
`avoid missing a rev. However, trapsfers of this size, across cylL."'l.der boundaries/
`rarely occur. Therefore, the implementation of a cylinder skew is
`forgone
`(see Figure 2.6).
`
`index
`
`Interleave 2
`
`!ndex
`
`Track skew
`
`Technical
`
`The
`
`drive model described above is the basis for t...he tecru-tical '""''-''-·~-'""--'-
`rra...r1s-
`
`Two capacities are
`
`heads. Its value is
`format. The forrnatted capacit-y, on the other
`sector forrrtat
`Its value is the
`of sectors per
`and the nurnber of heads.
`
`" ' " " " '
`
`1
`
`read and vvritten to the
`Transfer rate refers to the speed at >Nhich bits are
`,..,,.,.. of the nu..-rnber of bits on a track ru.'l.d
`drive
`the nurnber of rotations of the disk per second. Tne 111--lits are"'"'-·""".'-"'-"'-'·
`second, but MHz is often
`vvh.ich
`to one bit
`the amount of data the
`·=
`interface on a sustai..ned
`canoe eswuaten
`Divide the rrarsfer rate
`eight
`Take tl->..is result and divide it
`the interleave
`as the number of
`needed to read a
`headers and so
`drive in
`second.
`
`1
`
`$
`
`1
`
`
`
`18
`
`SCSI Bus and IDE Interface
`
`medium can be written to and read, plus formatting factors. A drive's peak
`transfer rate,
`is an instantaneous rate,
`be higher.
`
`Average access
`time
`
`The average access time has two components. The average seek time is the mean
`time it takes to position the heads to a specific cylinder. In addition to this is the
`time it takes for the desired sector to rotate under the heads. On average this is
`the time for half a revolution. This second component, called the rotational
`latency; is by no means insignificant. For a disk that rotates at 5400 rotations per
`minute it takes 11 ms for a complete
`This translates to an average
`5.5 ms. The same
`may have an average seek time
`c:.-;-.c,nr .. u accounts
`30%
`aver-
`
`age access time.
`
`all is the
`A hard disk is actually a subsystem many corrtponents. First
`to
`interface mechanism,. consislli"Lg
`the mediurn, the heads, the analog data electronics,
`and the head positioning electronics. This group is called the head disk assem(cid:173)
`bly (HDA). Next comes the data separator to digitize the analog signal data, fol(cid:173)
`lowed by the formatter
`parallelization
`data. The controller is h'l. charge
`orchestrating reading and writing, along \vith positioni.ng the heads. Finally,,
`a host adapter is the link between the controller and the host system (Figure
`2.7).
`
`Control
`
`Data
`separator
`
`l
`ST506 1
`
`I
`
`II Host
`adapter
`
`I :
`
`1•
`
`1l
`
`
`
`1 I Formatter, I :;
`1 data buffer, j ,
`I. 1
`!local
`1 1 1
`i I
`I, inte!!ige_,nc~ i
`1
`I (contro!1ef) 1
`I !
`
`i!
`'
`'
`l I
`i l
`I l I
`I i ~~ ------~~~
`
`1:0
`0
`I
`
`l
`ESDI 1
`
`l
`SCSI 1
`
`!DE
`
`Figure 2.7 Various
`
`interfaces.
`
`Physically, the interface is t.he cable that connects the unit built by the
`to
`are a number different possible loca-
`tions along the data cha.-rmel where this cable can be placed in the design of a
`drive. The trend, as SCSI's success L."'l.dicates, is to incorporate n:1ore and more
`functionality in
`drive itself. This moves the cable further
`the heads, so
`to speak.
`The ST506 interface lies hot""'fATC.)C>r