Chapter: 7
Interfacing Magnetic Storage
Drives
1
Outline
2
Introduction to Magnetic Disks
Reading/writing on magnetic Surfaces
Disk structure: track, sector, ..
Data encoding techniques
Floppy Disk Controller 8272
Interfacing Hard Disk Drives
Introduction
Storage Media - the physical components or
materials on which data is stored.
the hardware components that write data to, and
read it from, storage media.
3
Introduction
Computer memories are divided into two types.
Main or working memories including RAM's, ROM's and other semiconductor devices which are directly addressable by the CPU, and mass storage devices.
Mass storage memories generally are not directly addressable by the CPU, have a slower access method, are non-volatile and often removable off-line and have a much lower cost per bit.
4
Types of Storage:
• Magnetic
• Optical
Magnetic: the bits
are written and read
using magnetism.
Optical: the bits
are read
using light.
Magnetic Storage Devices:
Diskettes
Hard disks
Removable hard disks
Magnetic tape
Definition
A hard disk drive is a
sealed unit that a PC uses
for nonvolatile data
storage.
A hard disk drive contains
rigid, disk-shaped platters,
usually constructed of
aluminum or glass
8
HD Geometry
Platters: The shiny rigid disks. Multiple platters
increase storage without equivalent increase in cost.
Heads: The read/write heads of a hard drive. Disk
assembly must be sealed µ-filtered.
Tracks: Lanes centered around platters.
Sectors / Clusters: Each track was divided into
sectors. Several sectors form a cluster.
Cylinders: A grouping of the same tracks vertically
through the stack of platters.
Drive Operation
The basic physical construction of a hard disk drive consists of spinning
disks with heads that move over the disks and store data in tracks and
sectors.
The heads read and write data in concentric rings called tracks, which
are divided up into segments called sectors, which normally store 512
bytes each.
10
HDD Organization
11
Drive Operation
One side of a platter is called
a “head”.
Hard drives can have different
numbers of platters,
depending on their design and
storage capacity.
On the heads, you will see
concentric rings (tracks) and
pieces of rings (sectors) just
like on the floppy disks.
6/4/2015
12
Drive Operation
Many hard drives today use a technology
called “zone bit recording”
Which enables the hard drive to have
more sectors on the outer tracks, where
there is more room than on the inner tracks.
This allows more room for storage
13
Original
Zone Bit
14
Hard Disk Basics
There are two ways to measure the performance of a hard disk:
Data rate – The data rate is the number of bytes per second that the drive can deliver to the CPU. Rates between 5 and 40 megabytes per second are common.
Seek time – The seek time is the amount of time between when the CPU requests a file and when the first byte of the file is sent to the CPU. Times between 10 and 20 milliseconds are common.
Data Encoding
Data Encoding refers the various techniques of
impressing data (0,1) or information on an
electrical, electromagnetic or optical signal that
would propagate through the physical medium
making up the communication link between the
two devices.
There are many ways of encoding the data .
The simplest would be to represent each 1 with a
pulse leaving the signal low for each 0.
15
Nonreturn to Zero-level(NRZ-L)
The signal never returns to zero voltage
16
Nonreturn to Zero Inverted
No return to zero inverted on ones
Data encoded as presence or absence of signal
transition at beginning of bit time
Transition(low to high or high to low) denotes a binary
1
No transition denotes binary 0
17
Nonreturn to Zero Inverted
18
19
NRZ-L and NRZI format examples
Multilevel Binary
Use more than two levels
Bipolar-AMI(Alternate mark inversion)
Zero represented by no line signal
One represented by positive or negative
pulse
20
Contd.(Bipolar-AMI(Alternate mark inversion)
21
Pseudoternary
Binary 1 is represented by absence of line signal
Binary 0 is represented by alternating positive
and negative pulses
22
23
24
.
25
.
.
contd.
26
contd.
27
Floppy
A floppy disk is a data storage medium that is composed of a disk of thin, flexible ("floppy") magnetic storage medium encased in a square or rectangular plastic shell.
Invented by IBM, floppy disks in 8-inch (200 mm), 5¼-inch (133.35 mm), and 3½-inch (90 mm) formats enjoyed many years as a popular and ubiquitous form of data storage and exchange, from the mid-1970s to the late 1990s.
They have now been largely superseded by USB flash drives
6/4/2015
28
8-inch, 5¼-inch, and 3½-inch
floppy disks
Block Diagram of Floppy Sub-system
29
30
The Floppy Disk Sub-system
The Floppy Disk Controller (FDC) is the heart of
the Diskette system & connects each drive to the
system.
The FDC controls all communications & data
transfers between the system bus & the floppy
drives(s).
The FDC architecturally resides on the ISA bus.
FDC interface consists of an 8-bit bi-
directional data bus, control signals, and
several registers.
31
Floppy Disk Controller 8272
The floppy disk controller chip 8272 is a device
that incorporates into it the circuit and control
functions needed to interface a floppy disk drive
with a processor.
The 8272 is a LSI Floppy Disk Controller (FDC) Chip,
which contains the circuitry and control functions for
interfacing a processor to 4 Floppy Disk Drives.
It is capable of supporting either IBM 3740 single
density format (FM), or IBM System 34 Double
Density format (MFM) including double sided
recording.
contd.
32
PIN CONFIGURATION
33
8272 INTERNAL BLOCK DIAGRAM
34
contd.
35
contd.
36
37
DESCRIPTION
The FDC will operate in either DMA or Non-
DMA mode.
In the Non-DMA mode, the FDC generates
interrupts to the processor for every transfer of
a data byte between the CPU and 8272.
Hand-shaking signals are provided in the 8272
which make DMA operation easy to incorporate
with the aid of an external DMA controller chip,
such as the 8237.
38
DESCRIPTION
In the DMA mode, the processor need only to
load a command into the FDC and all data
transfers occur under control of the 8272 and
DMA controller.
39
PIN DESCRIPTION
RST : This is an input line driven by the CPU to Places FDC
in idle state and Reset the input lines of FDD to "0" (low) .
Read:
Write:
Chip Select:
40
PIN DESCRIPTION
Data/Status Reg Select (Ao):
DB0-DB7 :
DMA Request(DRQ):
41
PIN DESCRIPTION
DMA Acknowledge(DACK ):
Terminal Count(TC):
Index(IDX): Indicates the beginning of a disk track.
42
PIN DESCRIPTION
Interrupt(INT):
43
PIN DESCRIPTION
Read Write/SEEK(/RW /SEEK):
LCT/DIR(Low current/Direction):
FR/STP(Fault reset/Step)
44
PIN DESCRIPTION
HLD(Head Load):
RDY(READY):
WP/TS(Write Protect/Two Side)
45
PIN DESCRIPTION
FLK/TRK0(Fault/Track0):
46
8272 REGISTERS - CPU INTERFACE
The 8272 contains two registers which may be
accessed by the main system processor,
Status Register and
Data Register.
The 8-bit Main Status Register contains the status
information of the FDC, and may be accessed at any
time.
The status register can only be read and contains
status information of the FDC and is used to facilitate
the transfer of data between the processor and the
8272.
47
8272 REGISTERS - CPU INTERFACE
.
Data bytes are read out of, or written into,
the Data Register in order to program or
obtain the results after execution of a
command.
48
8272 REGISTERS - CPU INTERFACE
The relationship between the Status/Data registers and
the signals /RD,/WR and A0 is shown below.
49
Contd.
50
Commands of 8272
The 8272 is capable of executing 15 different
commands.
Each command is initiated by a multi-byte
transfer from the processor, and the result after
execution of the command may also be a multi-
byte transfer back to the processor.
Because of this multi-byte interchange of
information between the 8272 and the processor,
it is convenient to consider each command as
consisting of three phases.
51
Contd.
52
Contd.
During Command or Result Phases the Main
Status Register must be read by the processor
before each byte of information is written into or
read from the Data Register.
Bits D6 and D7 in the Main Status Register must
be in a 0 and 1 state respectively, before each
byte of the command word may be written into
the 8272.
53
Contd.
On the other hand, during the Result Phase, D6
and D7 in the Main Status Register must both be
1's. (D6=1 and D7=1) before reading each
byte from the Data Register.
Note, this reading of the Main Status Register
before each byte transfer to the 8272 is
required only in the command and result phases,
and NOT during the Execution Phase.
54
Contd.
55
Contd.
56
POLLING FEATURE OF THE 8272
After the specify command has been sent to the
8272, the Drive Select Lines DS0 and DS1 will
automatically go into a polling mode.
In between commands (and between step pulses
in the SEEK command) the 8272 polls all four
FDDs looking for a change in the Ready Line
from any of the drives.
If the Ready line changes state (usually due to a
door opening or closing) then the 8272 will
generate an interrupt.
57
8272 COMMAND DESCRIPTIONS
.
i.e. Load head read data from the specified sector
58
contd.
.
59
contd.
.
Overwriting of data which is marked as deleted.
For reading sector which is marked as deleted.
60
contd.
.
This command is similar to READ DATA command except that the entire data field is
read continuously from each of the sectors of a track.
61
contd.
.
62
contd.
.
63
contd.
.
64
Interfacing 8272 with 8086
The general interconnection of 8272 with 8086 in the DMA mode
(as it is mostly used)are presented in the block diagram in fig below: