38
Lecture 5 Secondary Storage and System Software III

Lecture 5 Secondary Storage and System Software III

Embed Size (px)

Citation preview

Page 1: Lecture 5 Secondary Storage and System Software III

Lecture 5Secondary Storage and System Software III

Page 2: Lecture 5 Secondary Storage and System Software III

Previous Lecture Previous Lecture

Page 3: Lecture 5 Secondary Storage and System Software III

Lecture 5

Secondary Storage and System Software II

Description of Tape Systems Organization of Data on Nine-Track

Tapes Estimating Tape Length Requirements Estimating Data Transmission Times Disk versus Tape

Page 4: Lecture 5 Secondary Storage and System Software III

Today Lecture Today Lecture

Page 5: Lecture 5 Secondary Storage and System Software III

Overview CD-ROM (Compact Disk, Read-

Only Memory) A Journey of a Byte Buffer Management

Page 6: Lecture 5 Secondary Storage and System Software III

Section 3.4

Introduction to CD-ROM

Page 7: Lecture 5 Secondary Storage and System Software III

Introduction to CD-ROM I

A single disc can hold more than 600 megabytes of data (~ 400 books of the textbook’s size)

CD-ROM is read only it is a publishing medium rather than a data

storage and retrieval like magnetic disks.

Page 8: Lecture 5 Secondary Storage and System Software III

Introduction to CD-ROM II CD-ROM Strengths

High storage capacity, inexpensive price, durability.

CD-ROM Weaknesses extremely slow seek performance (between

1/2 a second to a second) → Intelligent File Structures are critical.

20 second on RAM ≈ 58 days on Disk

≈ 2.5 years on CD

Page 9: Lecture 5 Secondary Storage and System Software III

Section 3.5

Physical Organization of CD-ROM

Page 10: Lecture 5 Secondary Storage and System Software III

Physical Organization of CD-ROM I

CD-ROM is a descendent of CD Audios. Listening to music is sequential and does not require

fast random access to data.

Reading Pits and LandsReading Pits and Lands CD-ROMs are stamped from a glass master disk

which has a coating that is changed by the laser beam.

When the coating is developed, the areas hit by the laser beam turn into pitspits along the track followed by the beam.

The smooth unchanged areas between the pits are called landslands.

Page 11: Lecture 5 Secondary Storage and System Software III

Physical Organization of CD-ROM II

When we read the stamped copy of the disc, We focus a beam of laser light on the track

as it moves under the optical pickup. The pits scatter the light, but the lands

reflect most of it back to the pickup. This alternating pattern of high- and low-

intensity reflected light is the signal used to reconstruct the original digital information.

Page 12: Lecture 5 Secondary Storage and System Software III

Physical Organization of CD-ROM III

1’s are represented by the transition from pit to land and back again.

0’s are represented by the amount of time between transitions.

The longer between transitions, the more 0’s we have.

Page 13: Lecture 5 Secondary Storage and System Software III

Physical Organization of CD-ROM IV

Given this scheme, it is not possible to have 2 adjacent 1’s: 1’s are always separated by 0s.

As a matter of fact, because of physical limitations, there must be at least two 0s between any pair of 1s.

Raw patterns of 1’s and 0’s have to be translated to get the 8-bit patterns of 1’s and 0’s that form the bytes of the original data.

Page 14: Lecture 5 Secondary Storage and System Software III

Physical Organization of CD-ROM V

EFM encoding (Eight to Fourteen Modulations) turns the original 8 bits of data into 14

expanded bits that can be represented in the pits and lands on the disk.

Since 0’s are represented by the length of time between transition, the disk must be rotated at a precise and constant speed. This affects the CD-ROM drive’s ability to

seek quickly.

Page 15: Lecture 5 Secondary Storage and System Software III

EFM Table

Dec. Bin. EFM

0 00000000 01001000100000

1 00000001 10000100000000

2 00000010 10010000100000

3 00000011 10001000100000

4 00000100 01000100000000

5 00000101 00000100010000

6 00000110 00010000100000

7 00000111 00100100000000

Page 16: Lecture 5 Secondary Storage and System Software III

CLV instead of CAV I

Data on a CD-ROM is stored in a single, spiral track. This allows the data to be packed as

tightly as possible since all the sectors have the same size (whether in the center or at the edge).

In the “regular arrangement”, the data is packed more densely in the center than in the edge Space is lost in the edge.

Page 17: Lecture 5 Secondary Storage and System Software III

CLV & CAV

Page 18: Lecture 5 Secondary Storage and System Software III

CLV instead of CAV II

Since reading the data requires that it passes under the optical pick-up device at a constant rate, the disc has to spin more slowly when

reading the outer edges than when reading towards the center.

Page 19: Lecture 5 Secondary Storage and System Software III

CLV instead of CAV III

The CLV format is responsible, in large part, for the poor seeking performance of CD-ROM Drives There is no straightforward way to jump to

a location. Part of the problem is the need to change

rotational speed.

Page 20: Lecture 5 Secondary Storage and System Software III

CLV instead of CAV IV

To read the address info that is stored on the disc along with the user’s data, we need to be moving the data under the

optical pick up at the correct speed. But to know how to adjust the speed,

we need to be able to read the address info so we know where we are.

How do we break this loop? By guessing and through trial and error

→ Slows down performance.

Page 21: Lecture 5 Secondary Storage and System Software III

Addressing I

Different from the “regular” disk method.

Each second of playing time on a CD is divided into 75 sectors.

Each sector holds 2 Kilobytes of data. Each CD-ROM contains at least one

hour of playing time.

Page 22: Lecture 5 Secondary Storage and System Software III

Addressing II

The disc is capable of holding at least 60 min * 60 sec/min * 75 sector/sec * 2 Kilobytes/sector = 540, 000 KBytes

Often, it is actually possible to store over 600, 000 KBytes.

Sectors are addressed by min:sec:sector e.g., 16:22:34

Page 23: Lecture 5 Secondary Storage and System Software III

Section 3.6

CD-ROM Strengths & Weaknesses

Page 24: Lecture 5 Secondary Storage and System Software III

CD-ROM Strengths & Weaknesses

Seek PerformanceSeek Performance:: very bad Data Transfer RateData Transfer Rate:: Not Terrible/Not Great Storage CapacityStorage Capacity: Great

Benefit: enables us to build indexes and other support structures that can help overcome some of the limitations associated with CD-ROM’s poor performance.

Read-Only AccessRead-Only Access:: There can’t be any changes → File organization can be optimized.

No need for interactioninteraction with the user (which requires a quick response)

Page 25: Lecture 5 Secondary Storage and System Software III

Section 3.8

A Journey of A Byte

Page 26: Lecture 5 Secondary Storage and System Software III

A Journey of A ByteWhat happens when the program statement: write(textfile, ch, 1) is executed ?

Part that takes place in memory:Part that takes place in memory: Statement calls the Operating System (OS)

which overseas the operation File manager (Part of the OS that deals with I/O)

Checks whether the operation is permitted Locates the physical location where the byte

will be stored (Drive, Cylinder, Track & Sector) Finds out whether the sector to locate the ‘P’

is already in memory (if not, call the I/O Buffer)

Puts ‘P’ in the I/O Buffer Keep the sector in memory to see if more

bytes will be going to the same sector in the file

Page 27: Lecture 5 Secondary Storage and System Software III

A Journey of A ByteWhat happens when the program statement: write(textfile, ch, 1) is executed ?

Part that takes place outside of Part that takes place outside of memory:memory:

I/O ProcessorI/O Processor:: Wait for an external data path to become available (CPU is faster than data-paths → Delays)

Disk ControllerDisk Controller:: I/O Processor asks the disk controller if

the disk drive is available for writing Disk Controller instructs the disk drive to

move its read/write head to the right track and sector.

Disk spins to right location and byte is written

Page 28: Lecture 5 Secondary Storage and System Software III

FM: Program data → Buffer

Page 29: Lecture 5 Secondary Storage and System Software III

FM: Buffer → I/O → Disk Controller

Page 30: Lecture 5 Secondary Storage and System Software III

Section 3.9

Buffer Management

Page 31: Lecture 5 Secondary Storage and System Software III

Buffer Management

What happens to data travelling between a program’s data area and secondary storage?

The use of BuffersThe use of Buffers Buffering involves working with a large

chunk of data in memory so the number of accesses to secondary storage can be reduced.

Page 32: Lecture 5 Secondary Storage and System Software III

Buffer Bottlenecks I

Assume that the system has a single buffer and is performing both input and output on one character at a time, alternatively.

In this case, the sector containing the character to be read is constantly over-written by the sector containing the spot where the character will be written, and vice-versa.

In such a case, the system needs more than 1 buffer: at least, one for input and the other one for output.

Page 33: Lecture 5 Secondary Storage and System Software III

Buffer Bottlenecks II

Moving data to or from disk is very slow and programs may become I/O Bound Find better strategies to avoid this

problem.

Page 34: Lecture 5 Secondary Storage and System Software III

Buffering Strategies

Multiple Buffering Double Buffering Buffer Pooling LRU (Least-Recently-Used)

Move Mode and Locate Mode Program’s data area and system buffers Moving data from one place to another in

memory “Move Mode” “Locate Mode”

FM performs I/O directly between Program and HD

FM provides Program with the location pointers Scatter/Gather I/O

Page 35: Lecture 5 Secondary Storage and System Software III

Double Buffering

Page 36: Lecture 5 Secondary Storage and System Software III

Next Lecture Next Lecture

Page 37: Lecture 5 Secondary Storage and System Software III

Fundamental File Structure Concepts

Stream Files Field Structures Reading a Stream of Fields Record Structures Record Structures that use a length

indicator

Page 38: Lecture 5 Secondary Storage and System Software III

Questions?