69
Input/Output Organization: Secondary Storage CE 140 A1/A2 8 August 2003

Input/Output Organization: Secondary Storage

  • Upload
    emmly

  • View
    25

  • Download
    6

Embed Size (px)

DESCRIPTION

Input/Output Organization: Secondary Storage. CE 140 A1/A2 8 August 2003. Side Bar: Binary Prefixes. Before: Since 2^10 = 1024 ≈ 1000 = 1 kilo, 1024 bytes was referred to as 1 KB – OK at first Problem: Confusion 1 MB = 2 20 = 1,048,576 bytes - PowerPoint PPT Presentation

Citation preview

Page 1: Input/Output Organization: Secondary Storage

Input/Output Organization:Secondary Storage

CE 140 A1/A28 August 2003

Page 2: Input/Output Organization: Secondary Storage

Side Bar: Binary Prefixes Before: Since 2^10 = 1024 ≈ 1000 = 1

kilo, 1024 bytes was referred to as 1 KB – OK at first

Problem: Confusion 1 MB = 220 = 1,048,576 bytes 1 MB = 106 = 1,000,000 bytes (storage industry) 1 MB = 1,024,000 bytes (floppy disk) For 1 GB, difference is about 7%

Solution: standardize the prefixes

Page 3: Input/Output Organization: Secondary Storage

Side Bar: Binary Prefixes December 1998: International

Electrotechnical Commission (IEC), organization for worldwide standardization in electrotechnology approved a standard on binary prefixes

IEEE now also uses a similar standard on a trial basis

Page 4: Input/Output Organization: Secondary Storage

Side Bar: Binary PrefixesFactor Name Symbol Origin Derivation

210 kibi Ki kilobinary: (210)1 kilo: (103)1

220 mebi Mi megabinary: (210)2 mega: (103)2

230 gibi Gi gigabinary: (210)3 giga: (103)3

240 tebi Ti terabinary: (210)4 tera: (103)4

250 pebi Pi petabinary: (210)5 peta: (103)5

260 exbi Ei exabinary: (210)6 exa: (103)6

Page 5: Input/Output Organization: Secondary Storage

Side Bar: Binary Prefixes Examples

1 kibibit = 1 Kibit (IEEE 1 Kb) = 210 bit = 1024 bits

1 kilobit = 1 kbit (IEEE 1 KB) = 1010 bit =

1000 bits 1 mebibyte = 1 MiB = 220

byte = 1,048,576 bytes

1 megabyte = 1 MB = 1020 byte =

1,000,000 bytes

Page 6: Input/Output Organization: Secondary Storage

Secondary Storage Primary or main memory cannot

accommodate all programs at once Also, much of main memory is volatile Need for cheap, large, non-volatile

storage secondary storage Examples

Magnetic hard disks, optical disks, floppy disks, tape systems

Page 7: Input/Output Organization: Secondary Storage

Magnetic Hard Disks One more disks mounted on a

common spindle Disks are placed in a rotary drive Disks rotate at uniform angular speed Read/Write head – magnetic yoke/coil

Page 8: Input/Output Organization: Secondary Storage

Magnetic Hard Disk Writing

current pulses applied to magnetic coil Magnetization of film in underneath head

switches direction parallel to applied field Reading

Change in magnetic field in vicinity of head induces voltage/current in coil

Only changes can be monitored

Page 9: Input/Output Organization: Secondary Storage

Magnetic Hard Disks

Source: PC Guide <http://www.pcguide.com/ref/hdd/op/index-c.html>

Page 10: Input/Output Organization: Secondary Storage

Magnetic Hard Disk

Source: Structured Computer Organization by Tanenbaum

Page 11: Input/Output Organization: Secondary Storage

Magnetic Hard Disk If magnetization states are presented by

1’s and 0’s, a string of 1’s or 0’s will only induce voltage at start and end of string

Clock is needed to synchronize information

Before: clock stored on a separate track Now: clock encoded together with data

Simple example: Manchester encoding

Page 12: Input/Output Organization: Secondary Storage

Manchester encoding

Phase encoding Change in magnetization for each bit Space for each bit must accommodate two

changes in magnetization

0 1 0 1 1 1 0

Page 13: Input/Output Organization: Secondary Storage

Winchester Technology Disks and heads are placed in sealed,

air-filtered enclosures This allows read/write heads to

operate closer to magnetic surface allowing for increased density

All modern drives use Winchester Technology

Page 14: Input/Output Organization: Secondary Storage

Three Parts of a Disk System Disk – disk platters Disk Drive – electromechanical

mechanism, includes rotary drive and read/write heads

Disk Controller – controls disk operation, may or may not be part of the disk enclosure

Page 15: Input/Output Organization: Secondary Storage

Physical Disk Geometry

TRACK

SECTOR

Page 16: Input/Output Organization: Secondary Storage

Physical Disk Geometry Previous figure shows each track has same

number of sectors, the number of sectors in each track is the same as the maximum number of sectors that can be placed in the innermost track

Zoned Bit Recording (ZBR) – varies the number of sectors per track so that each track can be utilized more efficiently

Page 17: Input/Output Organization: Secondary Storage

Physical Disk Geometry Track – concentric divisions of the surface Sector – divisions in the track Cylinder – set of corresponding tracks on all

surfaces; data on same cylinder can be accessed without moving read/write head

Three coordinates to locate data: surface number, track number, sector number

Page 18: Input/Output Organization: Secondary Storage

Physical Disk Geometry CHS Geometry

C – number of cylinders (tracks per surface) H – number of heads (number of surfaces) S – number of sectors per track OK for older disks NOT OK for newer disks

Zoned Bit Recording Defect Mapping Disk controller needs translation mechanism

Page 19: Input/Output Organization: Secondary Storage

Sector Usually stores 512 bytes of data Consists of preamble or sector

header Error-correcting code (ECC)

information at the end Sectors are separated by intersector

gaps

Page 20: Input/Output Organization: Secondary Storage

Magnetic Hard Disks

Source: Structured Computer Organization by Tanenbaum

Page 21: Input/Output Organization: Secondary Storage

Formatting a Disk Unformatted Disk: absolutely no

information Formatting divides disk into tracks

and sectors Unformatted Size > Formatted Size 15% of disk size is taken up by

formatting information

Page 22: Input/Output Organization: Secondary Storage

Access Time Seek Time: time for the arm to be

moved to the right radial position Rotational latency/delay: time for the

desired sector to rotate under the head

Seek Time + Rotational Delay = Disk Access Time

Page 23: Input/Output Organization: Secondary Storage

Hard Disk Example 3.5” disk (usually found in desktop

PCs) 20 data-recording surfaces 15,000 tracks per surface 400 sectors per track 512 bytes per sector Total formatted capacity:

61,440,000,000 bytes = 57.2 GiB = 61.4 GB

Page 24: Input/Output Organization: Secondary Storage

Logical Disk Geometry What’s wrong with previous example:

20 data-recording surfaces = 10 platter? Most disks usually just have around 3 platters!

Because of BIOS limitations, disk controllers intentionally mis-represent their characteristics as a logical disk geometry, to overcome size barriers imposed by BIOS

Also, physical disk geometry is no longer practical with ZBR and defect mapping

Page 25: Input/Output Organization: Secondary Storage

Logical Block Addressing (LBA) Alternative to CHS addressing Overcomes BIOS size limitations Each sector is just numbered from

0,1,2,3,4,… up Disk controller just translates these

LBA addresses to actual physical addresses

Page 26: Input/Output Organization: Secondary Storage

Data Buffer/Cache If bus to which disk is connected is

much faster than the disk, data buffer is needed (this is a standard I/O practice)

Data buffer can also serve as a cache to disk contents

Page 27: Input/Output Organization: Secondary Storage

Disk Controller Controls operation of disk Interface to the bus OS initiated Read transfer: MM

address, disk address, word count Disk controller: Seek, Read, Write,

Error Checking

Page 28: Input/Output Organization: Secondary Storage

Floppy Disks Used as removable storage The read/write head touches the

magnetic surface higher failure rate

Disk is not continously spinning, only when accessed

Page 29: Input/Output Organization: Secondary Storage

Commercially Available Hard Disks ATA/IDE Disks

Most popular on general-purpose PCs SCSI Disks

For high-performance servers/workstations

RAID For increased redundancy and reliability

Page 30: Input/Output Organization: Secondary Storage

Integrated Drive Electronics (IDE) One of the first type of drives where

the controller is integrated with the drive itself

Term is used to refer to ATA drives which leads to confusion because SCSI drives also have disk controllers integrated with the disk package

Before: controllers were in separate modules and hard disk-specific

Page 31: Input/Output Organization: Secondary Storage

ATA – Advanced Technology Attachment Primary storage interface used in PCs ATA drives are also sometimes

referred to as IDE drives ATA/IDE drives

ATA is the correct term for the interface

Different versions of the ATA standard different speeds

Page 32: Input/Output Organization: Secondary Storage

ATA Size Barrier 28 bits are used to specify a sector 228 = 268,435,456 sectors 512 bytes/sector 137.4 GB or 128

GiB Solution: new ATA standard ATA-6

allows 48 bits to specify a sector 248 = 281,474,976,710,656 sectors 128 PiB or 144 PB

Page 33: Input/Output Organization: Secondary Storage

SCSI Disks SCSI – Small Computer System

Interface Usually used as a storage interface in

high-end machines Generally provides better

performance than ATA disks Higher Cost: 9500 pesos for 18.4 GB

SCSI (10K RPM) versus 5000 pesos for 80 GB ATA (7200 RPM)

Page 34: Input/Output Organization: Secondary Storage

RAID Disk Arrays RAID – Redundant Array of

Independent (previously Inexpensive Disks)

Original idea by Patterson et al - Patterson was same guy who started RISC

“Villain”: SLED – single large expensive disk

Page 35: Input/Output Organization: Secondary Storage

RAID Disk Arrays Rationale: Provide more redundancy

with the use of “cheap” disks Reliability is highly important when

with storage devices Realiability versus Availability Realiablity – is something broken? Availability – is the system still

available to the user?

Page 36: Input/Output Organization: Secondary Storage

RAID Disk Arrays Increasing redundancy will not improve

reliability, it can only improve availability Increased performance: throughput is

increased by having multiple drives/read-write heads accessing data at the same time

Drawback: an array with N devices will have 1/N the reliability of a single device

Page 37: Input/Output Organization: Secondary Storage

RAID Disk Arrays When a single disk fails, lost information

can be recovered from redundant information

DANGER: When another disk failure happens between a time a disk fails and the time it is replaced/repaired (MTTR – mean time to repair – measured in hours)

MTTF (mean time to failure) is measured in years

An array of disks has higher availability than a single disk

Page 38: Input/Output Organization: Secondary Storage

RAID Levels RAID 0

Simply interleaves strips of data over multiple disks No redundancy! – not really a true RAID

RAID 1 Mirrored data Just copy data in backup drive in the event of a

failure RAID 2

Interleaves bytes of data over multiple disks Can use Hamming code Example: 1 byte is divided into 2 nibbles (4 bits), 3

bits of Hamming code are added total 7 bits distributed among 7 drives

Needs disk arms to be synchronized

Page 39: Input/Output Organization: Secondary Storage

RAID Levels RAID 3

Similar to RAID 2 But only 1 parity bit is added to every nibble

RAID 4 Works with strips again Parity is written to 1 drive

RAID 5 Parity information is distributed among the

different disks Reduces bottleneck on parity drive in RAID 4

Page 40: Input/Output Organization: Secondary Storage

RAID Disk Arrays

Source: Structured Computer Organization by Tanenbaum

Page 41: Input/Output Organization: Secondary Storage

Optical Disks Data is stored using the application of

light (optical) First Generation: LaserVision from

Philips used for movies (laser discs) Next: Philips and Sony came up with

the CD (Compact Disc) used for audio CDs: 120 mm across, 1.2 mm thick,

with a 15-mm hole, supposed to last 100 years

Page 42: Input/Output Organization: Secondary Storage

Cross-Section of Optical Disk

Label

Pit Land Polycarbonate Plastic

Aluminum Acrylic

Page 43: Input/Output Organization: Secondary Storage

Transition from Pit to Land

Reflection NoReflection

Reflection

PitLand

SourceDetector

Page 44: Input/Output Organization: Secondary Storage

CD Technology

Source: Structured Computer Organization by Tanenbaum

Page 45: Input/Output Organization: Secondary Storage

CD Technology For audio to play at uniform rate, pits

and lands must stream by at a constant linear velocity

Slower angular velocity at the outside compared to the inside tracks

Page 46: Input/Output Organization: Secondary Storage

CD Data Layout Data is stored in blocks called sectors Different sector formats Mode 1 format

1 byte/symbol is encoded using 14 bits (6 bits used as Hamming code for error correction)

1 frame = 42 consecutive symbols (588 bits) Each frame holds 192 data bits (24 bytes),

remaining 396 bits used for error correction 1 sector = 98 frames 16-byte header/preamble 2048 bytes of stored data in 1 sector 288 bytes for error-correction for the sector

Page 47: Input/Output Organization: Secondary Storage

CD Data Reliability Three separate error-correcting

schemes Within a symbol/byte Within a frame Within a CD-ROM sector

It takes 98 frames of 588 bits (7203 bytes) to carry a single 2048-byte payload 28% Efficiency

Page 48: Input/Output Organization: Secondary Storage

CD-ROM Capacity and Speed Single-Speed (1X) 75 sectors/sec

150 KiB/s 650 MiB of data for ordinary disk

Page 49: Input/Output Organization: Secondary Storage

CD-ROM

Source: Structured Computer Organization by Tanenbaum

Page 50: Input/Output Organization: Secondary Storage

AT Attachment Packet Interface ATAPI allows CD-ROM and tape

devices to share the ATA bus with ordinary disk drives

Page 51: Input/Output Organization: Secondary Storage

CD-Recordables Layer of dye is added Initial state: dye is transparent, light

reflects off gold surface Final state after being hit by beam:

spot heats up, breaking bonds, and makes the spot opaque

Reflectivity of pits and lands are simulated

Page 52: Input/Output Organization: Secondary Storage

CD-Recordables

Source: Structured Computer Organization by Tanenbaum

Page 53: Input/Output Organization: Secondary Storage

CD-Recording Issues Each track must be written

continuously without stopping Hard disk must deliver data

continously Buffer underrun error occurs if the

stream of data to the CD runs dry

Page 54: Input/Output Organization: Secondary Storage

Buffer Underrun Protection Eliminates buffer underrun errors by

pausing writing process (turning off the laser) when buffer becomes empty

Page 55: Input/Output Organization: Secondary Storage

CD-Rewritables Instead of a dye, an alloy of silver,

indium, antimony and tellurium is used

Depending on how energy is applied, it goes into an amorphous state or into a crystalline state

When in an amorphous state, alloy does not reflect

Again, simulates pits and lands

Page 56: Input/Output Organization: Secondary Storage

DVD Technology Digital Versatile (or previously Video)

Disk Same general design as CDs but with

Smaller pits (0.4 micron versus 0.8 microns for CDs)

Tighter spiral (0.74 microns between tracks versus 1.6 microns for CDs)

Red laser (at 0.65 microns versus 0.78 microns for CDs)

Page 57: Input/Output Organization: Secondary Storage

DVD Technology Minimum capacity: 4.7 GiB (at least seven

times capacity of most CD-ROMs) 4.7 GB can accommodate

133 minutes of full-screen, full-motion video at high-res (720x480)

Eight soundtracks 32 subtitles

But still some applications (and movies) need more capacity!

Page 58: Input/Output Organization: Secondary Storage

DVD Formats DVD-5: Single-sided, single-layer (4.7 GB) DVD-9: Single-sided, dual-layer (8.5 GB) DVD-10: Double-sided, single-layer (9.4

GB) DVD-18: Double-sided, dual-layer (17 GB) SS-DL supporters: Philips and Sony DS-SL supporters: Toshiba and Time Warner Compromise: All combinations will be

offered, and let the market decide which standards will survive.

Page 59: Input/Output Organization: Secondary Storage

DVD Technology

Source: Structured Computer Organization by Tanenbaum

Page 60: Input/Output Organization: Secondary Storage

DVD Video and DVD-ROM First DVD standards to hit the market DVD-ROM is essentially the same as

DVD Video with support for filesystems

Page 61: Input/Output Organization: Secondary Storage

DVD-Recordables Competing standards supported by

two groups of manufacturers DVD+R and DVD+RW DVD-R, DVD-RW and DVD-RAM

Page 62: Input/Output Organization: Secondary Storage

DVD+R and DVD+RW Supported by Philips, Sony, Hewlett-

Packard, Dell, Ricoh, Yamaha DVD+R – recordable DVD+RW – rewritable Can be read in most DVD-ROM drives

Page 63: Input/Output Organization: Secondary Storage

DVD-R, DVD-RW and DVD-RAM Supported by Panasonic, Toshiba,

Apple, Hitachi, NEC, Pioneer, Samsung, Sharp, DVD Forum

DVD-R – recordable DVD-RW – rewritable Can be read in most DVD-ROM drives DVD-RAM – rewritable, cannot be read

by non DVD-RAM drives, housed in special cartridge

Page 64: Input/Output Organization: Secondary Storage

Magnetic Tape Systems Employs similar principle used in

magnetic disk-recording Usually used for backups Different types

DLT – digital linear tape Travan DAT – digital audio tape / DDS – digital

data storage LTO – linear tape open

Page 65: Input/Output Organization: Secondary Storage

Trends in Storage Technologies Increasing disk capacities through

increased areal density Areal Density = Bits/Inch = Bits

(Tracks/Inch) x (Bits/Track-Inch) 2000: 20 GB/platter 2001: 40 GB/platter 2002: 60 GB/platter 2003: 80 GB/platter Increased capacities at decreasing

cost/megabyte

Page 66: Input/Output Organization: Secondary Storage

The IBM Microdrive

Source: http://www.pocketpcmag.com/Jan01/storage.stm

1 GB Capacity CF Form Factor

Page 67: Input/Output Organization: Secondary Storage

Solid State Disks Alternative to magnetic and optical

disks Employs solid state semiconductor

devices (e.g. RAM) and a power source (if needed) to make storage nonvolatile

Faster performance – random access, no rotating disk

Increased physical resilience

Page 68: Input/Output Organization: Secondary Storage

Solid State Disks For high performance, random-access

applications, e.g. Mail and news servers, relational DBs, etc.

Cons: Expensive! (One of the cheapest: 3$/MB) Needs power source/backup for

nonvolatility Less storage density than magnetic disks

Page 69: Input/Output Organization: Secondary Storage

Solid State Disks Flash drives – another form of SSDs

Uses flash memory Not just for USB Flash Drives Now also available in 2.5” and 3.5” form-

factors suitable for notebook and desktop PCs, respectively