77
CSIT 301 (Blum) 1 Disk Drives

CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

Embed Size (px)

Citation preview

Page 1: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 1

Disk Drives

Page 2: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 2

Geometry Review

• A platter is divided into concentric circles called tracks.

• The tracks are further divided into arcs called sectors. – A sector holds 512 bytes of data. – There may be additional bytes for servo information. – There may be additional bytes for error detection and

correction. – In zoned bit recording (ZBR) outer tracks have more

sectors than inner tracks.

Page 3: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 3

Data transfer rate is track dependent

• The spindle rotates at a specified angular speed (e.g. 7200 RPM).

• The data transfer rate depends on this speed.

• But since there are more sectors and thus more data at larger radii, the data transfer rate can be track dependent.

Page 4: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 4

Zone Dependent Data Transfer Rate

Page 5: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 5

Interleaving

• When storing a file larger than a sector, it is sometimes faster to store it on non-consecutive sectors– In one-to-one interleaving, the sectors are

placed consecutively around a track. – In two-to-one interleaving, every other sector is

written to – …

Page 6: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 6

Interleaving (cont.)

Page 7: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 7

Interleaving (cont.)

• The purpose of interleaving is to make the disk drive more efficient. The disk drive can access only one sector at a time, and the disk is constantly spinning beneath the head.

• This means that by the time the drive is ready to access the next sector, the disk may have already spun beyond it.

• It depends how fast the controller is. Modern controllers are very fast and 1-to-1 interleaving is the norm.

Page 8: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 8

What’s the delay?

• Modern controllers are so fast there is effectively no delay between writing one sector and the next and thus interleaving is not necessary.

• But if writing requires switching to a different platter (same cylinder) there is a small delay.

• And if the writing requires placing data on more than one track/cylinder, there is a more substantial delay in repositioning the head so as to write to the next track.

Page 9: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 9

Cylinder and Head Skew

• The sector numbering is staggered to account for delay.

• There is staggering from platter to platter within the cylinder. This is known as head skew.

• There is staggering from track to track on a given platter. This is known as cylinder skew.

Page 10: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 10

Cylinder and Head Skewing

Staggering on a given platter (cylinder skew) and staggering from platter-to-platter (head skew).

Page 11: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 11

Three-Step Process to Use Hard Disk

• To prepare a hard disk for use, there are three steps: – Low-level (or physical) formatting – Partitioning– High-level (or logical) formatting

Page 12: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 12

Low-Level Formatting• For hard drives, low-level formatting is done by the

manufacturer. • It establishes the tracks, sectors and so on. • It writes the servo information onto the disk. • Any information on a disk is lost if it is low-level

formatted. • There are pseudo-low-level formatting utilities that

one can run which effectively write 0’s to all of the sectors and replace bad sectors with spares. – This is distinct from true low-level formatting which

establishes the sectors.

Page 13: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 13

Partitioning• Partitioning separates the disk into logical pieces. • The standard motivations for partitioning are:

– To have multiple operating systems on the same disk (e.g. a “dual boot system”)

– To improve disk efficiency, to minimize “slack” and so on.

– To separate system files from user files (from virtual memory).

Page 14: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 14

Drive Letters and Partitions

• Drive letters A and B are reserved for floppies. (It was standard for early PCs to have two floppy disk drives.)

• The computer begins assigning hard drive partitions drive letters starting with C.

• All primary drives are assigned letters first. • Next letters are assigned to logical volumes

within the extended partition.

Page 15: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 15

Partitions• A drive must have at least one partition. • A drive can have at most four partitions.

– These are known as the primary partitions. • One of these is designated as “active” and under

normal circumstances one boots from the active drive.

– One can achieve the effect of having more than four partitions on one hard drive by designating one as an extended partition (instead of a primary partition). The extended partition can then be divided into logical partitions or logical volumes.

Page 16: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 16

Primary versus Logical• “Boot-ability”: A primary partition is bootable and

can be set as the active partition. – Typical schemes reserve primary partitions to act as

potential active partitions. That is, if the space is to be used for non-operating-system files, the space will be set up as a logical volume instead of a primary partition.

• Drive Letter Assignment: All primary partitions are assigned drives before any logical partition is assigned a drive letter. – Adding (not replacing) a hard drive can result in a

reordering of one’s drives if one has logical partitions.

Page 17: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

Control Panel/Administrative Tools/Computer Management/Disk Management

CSIT 301 (Blum) 17

Page 18: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 18

Parts of a Primary Partition

• A primary partition will contain some combination of the following three things:– System partition: the files need to start the

operating system– Boot partition: the operating system files – General purpose partition: any other files

(programs and data)

Page 19: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 19

Master Boot Record• The first thing read from the hard drive when a

computer starts is the Master Boot record (MBR). – It is located at cylinder 0, head 0, and sector 1.

• The MBR consists of: – Master Partition Table

• This table is limited in size and only has information about the primary partitions (not any logical volumes) and which primary partition is active

– Master Boot Code• A small program to start the boot process

Page 20: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 20

Volume Boot Sector

• Each partition has a volume boot sector (or partition boot sector) which contains information about: – The size of the partition – Volume Boot Code:

• The Master Boot Code calls the Volume Boot Code of the active partition. The Volume Boot Code starts loading the operating system.

– Location of the File Allocation Table (FAT)

Page 21: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 21

Boot sector virus

• The master boot code and the volume boot code are the first software code executed after the BIOS (firmware) has started the computer when it is powered up.

• This very low-lying code is susceptible to viruses known as boot sector infectors.

Page 22: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 22

High-level formatting

• After one partitions a disk, the next level of preparing it to be used is to high-level (or logical) formatting.

• Logical formatting provides– Partition boot sector– System ID byte (identifies partition)– Information for the filesystem– Data on bad sectors – Lose data (maybe)

Page 23: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

Formatting a drive

CSIT 301 (Blum) 23

Page 24: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

SSD-HDD Comparison

CSIT 301 (Blum) 24

Page 25: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

SSD-HDD Comparison (2)

CSIT 301 (Blum) 25

Page 26: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

SSD-HDD Comparison (3)

CSIT 301 (Blum) 26

Page 27: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

SSD-HDD Comparison (4)

CSIT 301 (Blum) 27

Page 28: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

TRIM

CSIT 301 (Blum) 28

Page 29: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 29

Chipset

• Recall that the chipset divides the motherboard traffic into two main categories based on speed.

• The Northbridge (a.k.a. Memory Bridge or Memory Hub or Host Bridge) handles the faster traffic.

• The Southbridge (a.k.a. I/O Bridge or I/O Hub) handles the slower traffic.

Page 30: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 30

Page 31: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 31

Page 32: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 32

PCI-X

• The PCI bus connects to the Southbridge.

• But as devices required more speed than the PCI standard allowed, a faster version, PCI-X (Peripheral Component Interconnect eXtended) was developed by IBM, HP, and Compaq.

• Whereas PCI allows up to 532 MB per second, PCI-X allows up to 1.06 GB per second.

• PCI-X is backward-compatible, – You can install a PCI-X card in a PCI slot (it will operate at the

slower PCI speed).

Page 33: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 33

Page 34: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 34

AGP• Another faster variation on PCI developed

specifically for displays is AGP, Accelerated Graphics Port. – Came out in 1997– It works with the Northbridge instead of the Southbridge.– It has a special slot (usually brown in color) – Various throughputs: 266 MB/s (1X), 533 MB/s (2X);

and 1.07 GB/s (4X). – Supports pipelining – transmitting many instructions

together instead of one at a time.

• Being replaced by PCI Express.

Page 35: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 35

AGP slot

Page 36: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 36

Page 37: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 37

PCI Express

• PCI Express, PCI-E or PCIe • Introduced by Intel in 2004. • Built to be fast like AGP (faster actually) but general

purpose like PCI.• It has point-to-point rather than a (shared) bus structure.

And has full-duplex serial connections called lanes –up to 32 lanes.

• In PCIe 1.1 each lane carries 250 MB/s (per direction). • PCIe 2.0 supports 500MB/s and PCIe 3.0 supports 1GB/s

PER LANE.

Extended ≠ Express

Page 38: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 38

Page 39: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 39

Page 40: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 40

In addition to power, hard-drives will have a data connection — either the older PATA (Parallel Advanced Technology Attachment) or the newer SATA (Serial Advanced Technology Attachment)

Page 41: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 41

System Resources• System Resources are the logical/software way to

access various devices. It is a level above the hardware but intimately connected to it – as it helps the processor to locate and interface with the hardware.

• Data is transmitted between the processor and devices using various shared communication channels (the buses). Thus an addressing scheme is required to determine where data is coming from or where it is going, which device is seeking the attention of the processor, and so on.

Page 42: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 42

System Resources (Cont.)

• I/O Addresses: processor talks to device

• IRQ: device tells processor it requires attention

• DMA: device interacts with memory without bothering processor

• Memory Addresses: portion of memory allocated for device instructions

Page 43: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

Device Manager – Once place to look at System Resources

CSIT 301 (Blum) 43

Page 44: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 44

Resource Conflicts

• Addresses must be unique if they are to be used to distinguish various devices.

• If two devices claim the same resource, there is said to be a conflict.

• Certain well established devices use a set IRQ. • Plug-n-Play (PnP) has eliminated a lot of

conflicts since the system assigns its own resources to the devices.

Page 45: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 45

No conflicts

Page 46: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

Advanced System Information – Another place to look at resources

CSIT 301 (Blum) 46

Page 47: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

Forced hardware

CSIT 301 (Blum) 47

Page 48: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 48

I/O addresses

• Every PC device has an Input/Output (I/O) Address or port address.

– Standard devices have standard I/O addresses.

– These I/O addresses and the memory locations they represent are like mail boxes for devices. Data for a device is sent to that devices I/O Address (mailbox).

– It is also a way to control devices, certain addresses correspond to specific actions of the device.

• This scheme of associating memory locations with devices is known as memory-mapped I/O.

Page 49: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 49

Keyboard’s I/O address range

Page 50: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 50

A different view of the Device Manager

Page 51: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 51

Resources by type view (I/O)

Page 52: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 52

Requesting an interrupt

• Devices cannot get the immediate attention of the processor. Instead the device makes an interrupt request.

• The processor only allows itself to be interrupted at certain times.

• All devices interrupt the processor in the same way, the processor must then trace back to find out which device requested the interrupt.

Page 53: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 53

IRQ• Devices that interrupt the processor are assigned

an IRQ (Interrupt Request Line).

• Typically a device has a set IRQ or finds an available IRQ, occasionally two devices want the same IRQ and a conflict arises. Older versus newer IRQ

• Older IRQ allowed only up to 16 addresses IRQ lines. The newer version uses IOAPIC – I/O Advanced Programmable Interrupt Controller – and allow for more IRQ lines.

Page 54: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 54

IRQs in Device Manager

Page 55: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 55

DMA

• Normally a device interacts with memory (reads or writes data) via the processor.

• A Direct Memory Access (DMA) channel allows a device to interact with memory without going through the processor. This speeds up data transfers.

• There are usually fewer conflicts over DMA than over IRQ.

Page 56: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 56

Floppy Resource with DMA

Page 57: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 57

Resources by type view (DMA)

Page 58: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

DMA Use

• The DMA System Resource is about devices that need a DMA controller as opposed to having their own circuitry for managing memory access.

• More devices use DMA than it looks like.

CSIT 301 (Blum) 58

Page 59: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

Transfer Mode• The transfer mode describes the way in which the

data moves from the hard disk through the interface (IDE/ATA) and to the memory.

• For example, it tells how fast data is transferred or what device is in charge of the transfer.

• There are two basic categories– PIO (Programmed I/O) Mode

• The processor micro-manages data transfer

– DMA (Direct Memory Access) Mode• The processor delegates data transfer

Page 60: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

Programmed I/O (PIO) Modes

• In the PIO category, the processor controls the data transfer.

• There are various PIO modes which differ mainly by speed.

• Through the early to mid-90s PIO was the standard way to transfer data to the hard disk.

• The original ATA standards document defined the first three modes.

• With ATA-2, two faster modes were introduced.

Page 61: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

Standard PIO Modes

3.3 MB/s = 3.3 106 bytes / second

= (2 bytes / 600 10-9 s)

Two bytes are transferred every 600 nanoseconds.

Page 62: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

External rates• The PIO rates on the previous slide are external rates

meaning that they reflect the rate that data in the hard disk’s buffer/cache can be transferred.

• Recall that access times to locate and read from a random sector are of the order of milliseconds.– Reading a sector (512 bytes) in 20 ms would correspond to

a rate of 25 KB/s.

• If one were not buffering and transferring consecutive data, the PIO mode rates would be sufficient.

• But we do transfer buffered data and the PIO transfer rates are considered prohibitively slow by today’s standards.

Page 63: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

PIO is too, too slow• PIO is slow in two ways:

– One does not achieve the same data transfer rates as with Ultra DMA, which is the standard transfer mode used for IDE/ATA today.

– Because the processor controls the details of the transfer in PIO, the processor is distracted from performing other tasks.

• Despite its slowness, PIO is still around because:– PIO is simple (built into the BIOS so it does not require

drivers). – Backward compatibility – Can be used as a backup when something goes wrong with

DMA.

Page 64: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

DMA

• The alternative to PIO is DMA, Direct Memory Access.

• In DMA, a device transfers information to or from the memory directly rather than in a processor-controlled fashion.

• DMA has been around awhile but it was not always well supported early on. But speed requirements have made it preferred over PIO.

Page 65: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

Various Modes

• As with PIO, DMA has various modes differing mainly by speed.

• DMA modes split into two categories:– Single-word modes which send one word (two

bytes) at a time – Multiple-word modes which send several words

in rapid succession (rather like the idea of bursting that accounts for improved memory speeds).

Page 66: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided
Page 67: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

Assume it’s multiword

• The single-word DMA modes are too slow, today it is understood that DMA is multiword DMA and the term is rarely mentioned and usually implied.

• In fact, the single-word DMA modes were dropped from the standards with ATA-2.

• Ultra DMA is multiword.

Page 68: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

First Party

“The party of the first part shall be known in this contract as the party of the first part”

Page 69: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

First Party vs. Third Party

• In Third-Party DMA there is a third device, the DMA controller mediating the transfer between the hard disk and memory. – Third party DMA is slow and old fashioned.

• In First-Party DMA, a.k.a. bus mastering, the middle man is eliminated. The hard drive controls the transfer of data between itself and memory. – The device (hard drive in this case) takes control of

(masters) the bus along which the information is sent.

Page 70: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

http://en.wikipedia.org/wiki/Direct_memory_access

• “More precisely, a PCI component requests bus ownership from the PCI bus controller (usually the southbridge in a modern PC design), which will arbitrate if several devices request bus ownership simultaneously, since there can only be one bus master at one time.”

CSIT 301 (Blum) 70

Page 71: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

Ultra DMA

• DMA only became the norm with the introduction of Ultra DMA. – It just wasn’t well supported before.

• DMA gained the advantage over PIO when Ultra DMA/33 doubled the interface transfer rate.– Support for it also improved.

• Ultra DMA became an industry standard.

Page 72: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

Ultra DMA uses DDR and CRC

• One feature that made Ultra DMA “ultra” was that it transferred data on both the positive and negative edges of the clock.– Same idea as in DDR (Double Data Rate) memory

• As Ultra DMA pushed the limit on transfer rate, it made the occurrence of errors somewhat more likely. Thus it introduced a CRC (Cyclic Redundancy Check) as part of the standard. – Recall CRC is error detection. If an error occurs in

transmission the data is retransmitted.

Page 73: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

Ultra DMA transfer rates

DMA finally beats PIO Mode 4’s 16.7 MB/s with the added bonus of freeing up the processor.

The modes are usually named after their maximum transfer rate and the interface they use: Ultra ATA/100 instead of Ultra DMA/Mode 5.

Page 74: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

New cable needed• The faster speeds did require a change in the cable

used to connect the drive. The 80-conductor ATA/EDE cable.

• Color Code– Blue: connects to the host (motherboard or controller).

– Gray: connects to the slave drive (if there is one)

– Black: connects to the master drive

Page 75: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

80 wires and 40 pins?? (pre SATA)• Signals are varying currents. • Currents produce magnetic fields, varying currents

produce varying magnetic fields. • Varying magnetic fields produce currents. • Oops, the current in wire 1 begins to change the

current in wire 2. • There is interference (a.k.a. cross talk)• The extra wires shield the signal-carrying wires

from each other.

Page 76: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

Block Mode

• Certain BIOSs allow for a Block Mode setting. Block Mode allows 16 or 32 sectors (512 bytes each) to be handled using a single interrupt (even if the processor is not running the show it needs to know something has happened).

Page 77: CSIT 301 (Blum)1 Disk Drives. CSIT 301 (Blum)2 Geometry Review A platter is divided into concentric circles called tracks. The tracks are further divided

CSIT 301 (Blum) 77

References• PC Hardware in a Nutshell (Thompson and

Thompson)• http://www.pcguide.com • All-in-One A+ Certification, Meyers and Jernigan• http://www.webopedia.com • http://www.serialata.org • http://en.wikipedia.org/wiki/Solid-state_drive