64
Chapter: 7 Interfacing Magnetic Storage Drives 1

Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

Chapter: 7

Interfacing Magnetic Storage

Drives

1

Page 2: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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

Page 3: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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

Page 4: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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

Page 5: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

Types of Storage:

• Magnetic

• Optical

Page 6: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

Magnetic: the bits

are written and read

using magnetism.

Optical: the bits

are read

using light.

Page 7: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

Magnetic Storage Devices:

Diskettes

Hard disks

Removable hard disks

Magnetic tape

Page 8: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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

Page 9: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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 &micro-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.

Page 10: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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

Page 11: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

HDD Organization

11

Page 12: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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

Page 13: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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

Page 14: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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.

Page 15: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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

Page 16: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

Nonreturn to Zero-level(NRZ-L)

The signal never returns to zero voltage

16

Page 17: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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

Page 18: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

Nonreturn to Zero Inverted

18

Page 19: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

19

NRZ-L and NRZI format examples

Page 20: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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

Page 21: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

Contd.(Bipolar-AMI(Alternate mark inversion)

21

Page 22: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

Pseudoternary

Binary 1 is represented by absence of line signal

Binary 0 is represented by alternating positive

and negative pulses

22

Page 23: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

23

Page 24: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

24

.

Page 25: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

25

.

.

Page 26: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

contd.

26

Page 27: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

contd.

27

Page 28: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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

Page 29: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

Block Diagram of Floppy Sub-system

29

Page 30: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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.

Page 31: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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.

Page 32: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

contd.

32

Page 33: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

PIN CONFIGURATION

33

Page 34: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

8272 INTERNAL BLOCK DIAGRAM

34

Page 35: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

contd.

35

Page 36: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

contd.

36

Page 37: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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.

Page 38: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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.

Page 39: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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:

Page 40: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

40

PIN DESCRIPTION

Data/Status Reg Select (Ao):

DB0-DB7 :

DMA Request(DRQ):

Page 41: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

41

PIN DESCRIPTION

DMA Acknowledge(DACK ):

Terminal Count(TC):

Index(IDX): Indicates the beginning of a disk track.

Page 42: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

42

PIN DESCRIPTION

Interrupt(INT):

Page 43: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

43

PIN DESCRIPTION

Read Write/SEEK(/RW /SEEK):

LCT/DIR(Low current/Direction):

FR/STP(Fault reset/Step)

Page 44: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

44

PIN DESCRIPTION

HLD(Head Load):

RDY(READY):

WP/TS(Write Protect/Two Side)

Page 45: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

45

PIN DESCRIPTION

FLK/TRK0(Fault/Track0):

Page 46: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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.

Page 47: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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.

Page 48: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

48

8272 REGISTERS - CPU INTERFACE

The relationship between the Status/Data registers and

the signals /RD,/WR and A0 is shown below.

Page 49: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

49

Contd.

Page 50: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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.

Page 51: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

51

Contd.

Page 52: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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.

Page 53: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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.

Page 54: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

54

Contd.

Page 55: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

55

Contd.

Page 56: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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.

Page 57: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

57

8272 COMMAND DESCRIPTIONS

.

i.e. Load head read data from the specified sector

Page 58: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

58

contd.

.

Page 59: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

59

contd.

.

Overwriting of data which is marked as deleted.

For reading sector which is marked as deleted.

Page 60: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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.

Page 61: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

61

contd.

.

Page 62: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

62

contd.

.

Page 63: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

63

contd.

.

Page 64: Interfacing Magnetic Storage Drives - Hamerohahameroha.com/.../06/Interfacing-Magnetic-Storage-Drives.pdfHard drives can have different numbers of platters, depending on their design

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: