Hard Drives - specific protocols

ST504/ST416
  Earliest interface for IBM XT.

  Supported 5/10 MB drives
 
  Drive control on the interface card.

  Very slow response.
 
  Very spastic.

  Mostly used MFM data encoding.

  Separate cables for control and data.
    
  Data converted to analog signal to be magnetically recorded on i/o
    card on mother board not on drive, so analog data transmitted over
    data cable.

ESDI 
  Some of the drive control placed on the drive.

  Improved performance.

  Support of drives > 30MB.

  RLL common.

Early protocols/design required the user to hard code number of heads, 
tracks, and other stats about the hard drive in the system bios.


Advantages of Integrated Drive Electronics (IDE)
  IDE - control circuitry of a drive is placed on the drive rather than on 
    the host bus interface card.

  The control circuitry allows the drive to look like a configuration
    friendly to the OS's architecture while being completely incompatible
    at the hardware level.
 
    Looks like 16 heads and 1024 cylinders but is 2 heads and 8192 cylinders. 

  It provides timing and buffering of data.
    OS may specify a specific sector 
    but the controller fetches the whole track and parses the desired sector. 

  Magnetic storage is primarily an analog recording.
    Bits arrive and are embedded in an RLL encoding to provide timing and
    converted into an analog signal.

    This process is performed by circuit called an encoder/decoder or ENDEC.

    The signal is recorded on the surface of the drive.

  By putting the ENDEC on drive, the path of the analog encoded data is 
    very short and less prone to error and distortion.  

  And if the technology or architecture of the drive changes with new drive, 
    User does not have to change the interface card.
 
  In fact the interface is often now part of the mother board chip set,
  And not a separate card in the i/o slots. 


IDE interface - Integrated Drive Electronics 
  Correct name is ATA - AT attachment interface.

  1988 (finalized 1994) Withdrew 1999

  Internally uses RLL

  Extensively used in the PC environment.

  Reasonably fast data transfers.

  Supports two drives on a single interface.
    Master and Slave - integrated circuitry on master controlled both.

  16 bit data bus. (Even with UDMA) 40 pin connector.


IDE interface - Integrated Drive Electronics 
  PIO modes 0, 1, and 2  
  DMA modes 0, 1, and 2 (and multi-word DMA mode 0)
    Mode 2 (and up) only practical mode for DMA

  Most of the control performed by the circuitry on the drive.
    Hence the IDE assignation.

  Capable of lying about number of cylinders, heads, sectors
    Overcomes limits to the PC's basic input output system.

  Supports drives up 528 MB (504MiB).

  Finalized version 
    Supports up to 136.9 GB, although most system bios-es could not.
      PC Bios: 1024 cylinders x 16 Heads * 63 Sectors = 528MB
        In practice, most drives had 2 or 4 heads, so available drives <528  

    Supports both chs and LBA 2^28-2^20  sectors.


ATA-2 - updated standard (?)
  1993 (published 1996) withdrew 2001
  
  Parallel speed 16.67 MBps

  EIDE (non-standard update of original ATA (IDE) standard)

  Faster PIO modes 3, 4
  
  Faster DMA modes.

  PCMIA - pc-card (laptop) support.

  Logical Block Addressing - requires BIOS Support.

  Improved identification of drive architecture (auto configure).

  Suppports second 2 device channel.
  
  Provides CHS/LBA Bios translation and access up to 8.4 GB.

  Indentify Drive command - plug and play functions.


ATA-3 - not really implemented but became part of following upgrade.
  1995/1997  Widthdrew 2002

  Better security - password protection.
 
  Improved reliability, self monitoring technology.
 
  LBA support mandatory

ATAPI (AT Attachment Packet Interface)
  Additional protocols to allow use of "IDE" for CD-ROMs, Tape drives, etc.


ATA/ATAPI-4 
  1996/1998  current
  
  ATAPI integrated into standard.

  Ultra DMA modes 0, 1, and 2 for 16.7,25 and 33.3 MB/s
    Note burst mode values and continuous transfer modes about 1/2.

  UDMA mode 0, 1 not used.  Mode 2 known as UDMA/33

  80-conductor (optional) cable protocol for better transfers at high speed.

  CRC used to guard data.
 
  Advanced Power management. 
    Allows drive to spin down when not in use.  

  Supports  Host protected area - area on hard drive for recovery software.

  Interface standard for interfacing with Firewire bus.

  Enhanced bios support up to 9.4ZB - trillion gigabytes.
  * Drive capable of 9.4ZB but interaction wiht PC still at 136.9GB(?)


ATA/ATAPI-5  
  80 connector cable became mandatory.
    Cable still has 40 pin connector and will work with older interface.

  DMA mode 4 provides for 66MB/s burst tranfers (hence mandatory cable).

  Cable autodetected.  
    UDMA faster UDMA 33 only available with 80 line cable.

  Windows 95 OSR2 or later OSes needed to access the faster DMA.

ATA/ATAPI-6
  UDMA mode 5 100MB/s and up.

  Expansion of the LBA count (BIOS support). 
    Below ATA-6, 28 bit LBA storage or 137GB size barrier.

    Should go up to 48 or 64 bit.
    up to 144 PB - petabyte - quadrillion - 1 thousand million million
      1 * 10^15
 
    Drives < 138 GB still use the 28 bit LBA.

Many of these updates also require improvements in the System BIOS and the 
OS to implement.  


ATA-serial  www.serialata.org

  Standard ATA connector.
    40 connector, 16 bit data path.
    12" (18" borderline) cable limit for good data transfers.
    Additional 40 ground lines needed for faster protocols.
    100MB/s practical limit. Some faster designs available.

  ATA/ATAPI-7 - UDMA Mode 6 - 133MBps. But near limit of drive response.
    And inclusion  Serial ATA.

  ATA-Serial 
    7 Connector  
      4 signal (2 paired lanes), 3 ground

    Serial lane 
      1 send and 1 receive balanced. 
        Allows external noise to be cancelled out.
        No need for shielding or twisted pairs. 
 
    30" length safe. Max 39.37" (1 meter).

    Single device - no master/slave hastles.

    Uses 8B/10B encoding (IBM) which is also used for Gigibit ethernet.
      Form of RLL called RLL 0,4 - never more than 4 sequential 0 or 1s.

      Also never more than 6 or less than 4 0s in a single encoded 10bit
        character. 
       
    Uses 250mV rather than 5V signals.

    Hot swapable

    SATA-150 150MB/s current with 300 to 600 in the next 2 to 4 years.
    SATA-300 300MB/s
    SATA-600 600MB/s 
 
  SATA/ATAPI-8
    Removal of parallel protocol from standard. 

    Improved host protected area.

    Allows for external devices to interface via SATA. 
      Multiport interface ( up to 15 SATA drives)
      4 lanes (paired data lines)


Dual drive configuration.
  The Parallel ATA IDE protocol allows a controller to control 2 drives.
    One must be ided as master and the other as a slave.

  In reality, the controller still controls all access.

  Master numbered 0 and usually maps as drive C: in Microsoft environment.

  Slave numbered 1.

  Jumper or switch on drives allow user to configure master/slave.

  Usually 4 options. 
    Master - single drive.
    Master - dual drive.  - newer designs merge the two master types.
    Slave - dual drive.
    Cable select - cable design allows selection of master.

  Slave drives will often spin up a little later than the master
    to lessen load on power supply.

  With older OSes, Windows 98 and older, OS had to be on primary drive. 


Limits(barriers) and conflicts
  4 limits
    Recording mechanism - drive technology and encoding 
      FM -> MFM -> RLL -> PMRL

  Drive Bios limits 
    With IDE style, improvements synchronized with drive size improvements.

  System (OS) Bios limits.
    System bios independent of OS. 
      Until recently, even OSes able to handle larger drives, had to have
        their boot/initial OS routines in the 1st 1024 cylinders of drive.
 
  OS File system limits.
    Pointer size and data structures for tracking files.    


Limits mismatches
  Although most of the control now done on the interface, some still
  the responsibility of the OS.

  Microsoft and IBM in their initial design chose an BIOS/OS that recognized:
    Bios Int 13h (24 bit CHS) - 58 functions

    1024 cylinders(10 bit), 256 heads(8 bit), 63 sectors of 512 bytes(6 bit) 
    as a maximum possible configuration, so coded the BIOS as such. 

    1024*256*63*512 = 8455716864 or 8.4 GiB or 7.8 GB.

  The standard IDE Bios interface provided for:
    (28 bit) 

    65536 cylinders(16 bit), 16 heads(4 bit), 255 sectors(8 bit) of 512 bytes.
    or  136 902 082 560 -- 2^28 * 512 - 2^20 * 512or  < 128GiB (2^37)  
  
  However when the two interact, only the lower value in each used.
     1024    256     63
    65536     16    255

    1024 cylinders, 16 heads, 63 sectors.

    1024*16*63*512 = 528482304 or 528 MB (decimal) or 504 MiB(binary)


Bios extenders
  Bios extender software allowed for an alternative configuration to 
  be recognized, but it had to be loaded each time the sytem powered up.
    Because the interrupt table is in RAM, interrupts can be redirected.

  In many cases, it was required that the bios software be loaded from a
    drive (or partition) accessable via original bios.  
    
    Specified in the config.sys file read as the OS booted up.

    Installed an alternative Int13H with better chs ratios.
    
  However, some of the early ATA bios used a 12 bit counter for the
  cylinders creating  a 1.97 GiB/2.11 GB boundry.
   
  As various bios extenders or updated bioses became available, new (but
  higher) barriers were encountered. 

  Additionally, other limits occur because of the file pointer sizes coded
  into the operating systems.


Alternative BIOSes.
  In 1994, Phoenix Technologies produced a bios for handling larger drives.

  The bios is copyrighted software.
    However, its actions are not (look and feel).

  4.2 GB - another barrier.
    With the newer bioses, 256 heads were possible but is counted as 
      1 0000 0000b. (9 bits)
   
    However, the OS (DOS, Win31, Win9x, ME) could only recognize 255 (8bit).
   
    CHS bit shifting modified to keep heads under 256 
    But caused the system to recognize only 1/2 of possible 8 GB range. 

  Int 13h rewritten 
    64bit LBA
    
    LBA-assist geometric CHS translation.
      If both the system bios and ATA bios used LBA,
        straight forward interaction and 8GB size available.

    Bit shift geometric CHS translation.
      Translates between chs and lba.


LBA-assist geometric CHS translation.
  If both the system bios and ATA bios used LBA,
    straight forward interaction and 8GB size available.

Bit shift geometric CHS translation.
  Leaves the sector count per track alone.

  But can translate ATA BIOS cylinder/head count (p-chs) to system BIOS
  cyliinder/head count (l-chs).

  8000 c / 16 h -> 1000 c / 128 h

  4.2 GB - another barrier.

Some drive geometries not correctly translated. 
  ATA-2 requires compatibility with Bit shift translation. 
  
  Still limited to 8GB.
 
1996 - Phoenix turned over their BIOS protocol called 
  BIOS Enhanced Disk Drive Specification (EDD) to
  InterNational Committee on Information Technology Standards (INCITS)

  This protocol allows for a LBA count of 2^64 (9.44 ZB)
  Most ATA disks still had a 2^28 count (138GB)

To break the 137GB boundary
  ATA-6 allowing up to 2^64 sectors (LBA).
  
  Current drives > 137GB use a 48 bit LBA. 
  That must also be supported by the OS.


File system limits
  The OS must track the location of files.
    As the drives grew, the tracking system of the OS did not.

  To overcome the size limits on the OS side, 
    Os began to access data from drive in clusters.

    A Cluster is 1 or more sectors read in sequence.

    The Bios would then handle accessing the clusters as a sequence
      of consecutive sectors.

  Cluster size ranged from 1 sector (floppies and 10GB HD) up to 64K blocks
    for large drives.
 
  A stored file takes one or more clusters.
    If file is 1K and cluster is 4K, drive will reserve 4K for file.  

  Some bios extenders allowed for clusters > 64K but caused compatibility 
    issues with other systems. 


File system limits
  Dos/Win3x - Dos 6.22 < 8.4 GB  
    Need Dos 7 or up (Win 95) for > 8.4 GB

  Win 9x/ME - supports > 8.4 GB but FAT 16 limits partitions to 2GB.

  Win 95B/OSR2 - supports > 8.4 GB and Fat 32. Win 95 at 32GB limit.
     Win 98 up to 64GB (with fdisk upgrade).

  Win 2000/XP - supports > 8.4 GB. If fat 32, clusters up to 64K.
    Switch from FAT to NTFS allows large drives of 128GB or more.
 
  OS/2 - boot partitions 3.1GB (or 4.3GB). Driver upgrade allows for 8GB.
    Non-boot portion of drive - rest of a 64GB size.


Extended - EIDE and ATA-IDE
  Advanced versions of IDE

  Originally EIDE and ATA-IDE were competing protocols, but most
  interface cards are designed to accept either protocol.

  Supports 4 drives per interface.

  Provides LBA (Logical block addressing) - an alternative way of 
  tracking sectors. Again to overcome PC design limits.

  Supports drives up to 8 Gig. (or more).


SCSI - Small computer systems Interface
  Combination interface and bus (daisy chained devices)

  Early separate I/O bus. 

  Used in mini-computers, work stations and high end PCs.

  SCSI is also a IDE with each device having its own controller chip.

  SCSI has its own control "language".
 
  With help of control language, SCSI designed to support several types of 
  devices not just hard drives.

    Block commands - hard drives.
    Stream commands - tape drives.
    Graphic commands - printers.
    Medium changer commands - CD-jukeboxes (very large secondary storage)
    Controller commands - Disk Arrays (RAID)

SCSI - Small computer systems Interface
  Reasonably high throughput of data.

  Single interface can support up to 8 (or 16, updated protocol) devices.
    Although "host adapter" to the system is one of the devices.
 
  Allows devices on bus to interact without CPU assistance.
    Since, SCSI is usually a secondary bus, it often does not compete with
      CPU/memory access.
  
  Providing all of the control for the devices, but required alternative 
  drivers to the standard ROM-BIOS interface.

  It is possible for controller to queue several device requests.

  Because SCSI interface has complete control, 
    size limits of the original MFM/RLL/IDE designs did not occur.

  SCSI supports hot swappable devices.

  Until recently, booting from a SCSI device needed a modified system BIOS.

  In general, the actual hard drive and electronics beyond the bus 
    interface are the same for SCSI and ATA.

  And since the bottleneck is still the physical access of the drive.
    For a single drive, ATA is often as quick or quicker than SCSI
      And usually much cheaper.

  However, advantage to SCSI occurs when
    Multiple disks are accessed:  > 4 disks or a raid architecture.

    Use with newer OSes which can more effectively interact with SCSI 
      by optimal queuing of instructions.

    Or drive rpm is fast such as 15000 rpm drives.

  Another early advantage of SCSI was that it was non-specific about 
    hardware being interfaced, scanner, plotter, scientific sensors,etc.

  However,
    Freeware(technically serial SCSI) and USB2 are faster and easier to use.  


Original SCSI evolved from SASI (Shugart Associates)
  Turned over to ANSI (American National Standards Institute)

SCSI 1 - 1986  
  50 pin connector.

  8 bit data bus.

  1MB/s transfer (4 to 5 MB/s).

  8 devices (interface card counts and is device 0) 
   
  Many commands and features were optional
    Creating many non-compatible peripherals. 

  Termination needed.

  Cable length up to 6 M.

  Obsolete.


SCSI 2 - protocol (1994)
  10 MHz operation speed.

  16 devices (interface card counts and is device 0) 

  Allows for  
    8/16/32 byte data bus.

    Although 32 bit was never really implemented by equipment makers. 

  Fast SCSI (8 bit) 10MB/s

  Fast Wide SCSI (16 bit) 20MB/s
 
  Defined a set of industry wide commands as a minimum standard.
    CCS - common command set
  
  Allowed for pipe lining of command requests. 

  Command queuing - device could queue several command requests and 
    could rearrange their order for optimal performance.

    Up to 256 commands.

  Added formal support for a variety of "new" devices, cd-ROM, optical
  drives, etc.

  SE(Single-ended) Cable length 3/1.5M depending on speed.  
 
  HVD(High voltage differential) Cable/signal type allows for 25M.
    Cannot mix cables on a single host adapter daisy chain.    

  Also
    Type A - 50 pin.

    Type P - 68 pin (wide SCSI) for 16bit.

  Because of higher speeds, required active termination (voltage regulation) 

SCSI 3 - multiple protocols. (Starting 1995)
  Broken into separate protocols for hardware, interface, and software.

  Protocols for 
    SCSI Parallel Interface (SPI)
      which has 5 SPI standards. 
    Serial
    Fiber Optic
    Etc.
  
  In several cases, protocols may have multiple names.

  In some circumstances, speeds > 100MB/s
    Macintosh Fire wire P1394 is a serial SCSI-3 protocol.

  Ultra-SCSI is 20MB/s transfer on 8bit data bus.

SCSI - is backward compatible. However, a older/slower device will cause
  the bus to run at slower speed.

Ultra5 (Ultra640) transfers up to 640MB/s (ATA still at 133-150MB/s)
  Although each device may be significantly slower.  
  Because of control language, multiple devices can overlap activities
    with minimal conflicts/collisions.