0% found this document useful (0 votes)
61 views31 pages

Magnetic Tapes Cd-Rom: Adil Yousif, PHD

Magnetic tapes are sequential access storage devices that are resistant to environmental conditions and easy to transport. Data is stored in tracks on the tape as it winds between two reels. CD-ROMs are read-only optical discs that can store around 600MB of data represented as pits and lands read by a laser. DVD technology improved on CD-ROM with increased capacity up to 17GB through two-sided discs and layers. File systems for CD-ROMs require indexes to allow direct access to files and directories to overcome long seek times from the sequential access nature of the discs.

Uploaded by

Samahir Alkleefa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views31 pages

Magnetic Tapes Cd-Rom: Adil Yousif, PHD

Magnetic tapes are sequential access storage devices that are resistant to environmental conditions and easy to transport. Data is stored in tracks on the tape as it winds between two reels. CD-ROMs are read-only optical discs that can store around 600MB of data represented as pits and lands read by a laser. DVD technology improved on CD-ROM with increased capacity up to 17GB through two-sided discs and layers. File systems for CD-ROMs require indexes to allow direct access to files and directories to overcome long seek times from the sequential access nature of the discs.

Uploaded by

Samahir Alkleefa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

Secondary Storage Devices(2):

Magnetic Tapes
CD-ROM

Adil Yousif , PhD

Lecture 3
Characteristics
No direct access, but very fast sequential access.
Resistant to different environmental conditions.
Easy to transport, store, cheaper than disk.
Before it was widely used to store application data;
nowadays, it’s mostly used for backups or archives.

2
MT Characteristics-2
A sequence of bits are stored on magnetic tape.
For storage, the tape is wound on a reel.
To access the data, the tape is unwound from one
reel to another.
As the tape passes the head, bits of data are read
from or written onto the tape.

3
Reel 1 Reel 2

tape

Read/write head

4
Tracks
Typically data on tape is stored in 9 separate bit
streams, or tracks.
Each track is a sequence of bits.
Recording density = # of bits per inch (bpi).
Typically 800 or 1600 bpi.
30000 bpi or more on some recent devices.

5
MT recording in detail

8 bits = 1 byte

… 0 0 0 0 …
1 1 1 1
1 1 1 1
0 0 0 0
1 1 1 1 ½”
1 1 1 1
0 0 0 0


1
0
1
0
1
0
1
0


parity bit

6
Tape Organization
logical record
2400’

EOT
BOT marker
Data blocks Interblock gap
marker
(for acceleration &
deceleration of tape)
Header block
(describes data blocks)

7
Data Blocks and Records
Each data block is a sequence of contiguous records.
A record is the unit of data that a user’s program
deals with.
The tape drive reads an entire block of records at
once.
Unlike a disk, a tape starts and stops.
When stopped, the read/write head is over an
interblock gap.

8
Example: tape capacity
Given the following tape:
 Recording density = 1600 bpi
 Tape length = 2400 '
 Interblockgap = ½ "
 512 bytes per record
 Blocking factor = 25

How many records can we write on the tape?


(ignoring BOT and EOT markers and the header
block for simplicity)

9
10

Secondary Storage Devices:


CD-ROM
Physical Organization of CD-ROM

Compact Disk – read only memory (write once),


R/W is also available.
Data is encoded and read optically with a laser
Can store around +600MB data
Digital data is represented as a series of Pits and
Lands:
 Pit = a little depression, forming a lower level in the
track
 Land = the flat part between pits, or the upper levels
in the track

11
Organization of data
 Reading a CD is done by shining a laser at the disc and
detecting changing reflections patterns.
 1 = change in height (land to pit or pit to land)
 0 = a “fixed” amount of time between 1’s

LAND PIT LAND PIT LAND


...------+ +-------------+ +---...
|_____| |_______|
..0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 ..

 Note : we cannot have two 1’s in a row!


=> uses Eight to Fourteen Modulation (EFM) encoding table. Usually, a
pattern of 8 bits is translated to/from a pattern of 14 pits and lands.

12
CD-ROM
While the speed of CD-ROM readers is relatively
higher, such as 24X(24 times CD audio speed), the
speed of writing is much slower, as low as 2X.
 Note that the speed of the audio is about 150KB per
second.
The DVD (Digital Video Disc or Digital Versatile
Disc) technology is based on CD technology with
increased storage density.
The DVD technology allows two-side medium,
which may extend the CD-ROM to a storage
capacity of up to 17GB, using special SW and HW
decoder....

13
DVD vs CD-ROM
The main differences between the CD and DVD are summarized in the following table:
Feature DVD CD-ROM
Substrate diameter / thickness (mm) 120 / 1.2 120 / 1.2
Sides 1 or 2 1
Layers per side 1 or 2 1
Capacity (GB) 4.7, 8.54, 9.4, or 17 ~ 0.7
Track pitch (microns) 0.74 1.6
Min pit length (microns) 0.4 - 0.44 0.83
Linear velocity used for scan (m/s) 3.5 - 3.84 1.3
Laser wavelength (nm) 635 or 650 780
Numerical aperture 0.6 0.45
Modulation 8 to 16 EFM (8 to 17)
Error correction code (ECC) RSPCCIRC
Durability and dust/scratch same as that of CD high

14
CD-ROM

 Because of the heritage from CD audio, the data is


stored as a single spiral track on the CD-ROM, contrary
to magnetic hard disk’s discrete track concept.
 Thus, the rotation speed is controlled by CLV-Constant
Linear velocity. The rotational speed at the center is
highest, slowing down towards the outer edge. Because,
the recording density is the same every where.
 Note that with CLV, the linear speed of the spiral
passing under the R/W head remains constant.
 CLV is the culprit for the poor seek time in CD-ROMs
 The advantage of CLV is that the disk is utilized at its
best capacity, as the recording density is the same every
where.
15
CD-ROM
Note that: Since 0's are represented by the length
of time between transitions, we must travel at
constant linear velocity (CLV)on the tracks.
Sectors are organized along a spiral
Sectors have same linear length
Advantage: takes advantage of all storage space
available.
Disadvantage: has to change rotational speed when
seeking (slower towards the outside)

16
File Structures for CD-ROM

One of the problems faced in using CDs for data


storage is acceptance of a common file system, with
the following desired design goals:
Support for hierarchical directory structure, with access
of one or two seeks…
 Support for generic file names (as in “file*.c”), during
directory access
If implement UNIX file system on CD-ROM, it will
be a catastrophe! The seek time per access is from
500 msec to 1 sec.

17
File Structures for CD-ROM
In this case, one seek may be necessary per
subdirectory. For example
/usr/home/mydir/ceng351/exam1
will require five seeks to locate the file exam1
only…
Solution
 One approach place the entire directory structure in
one file, such that it allows building a left child right
sibling structure to be able to access any file.
For a small file structure file, the entire
directory structure can be kept in the memory
all the time, which allows method to work.
18
File Structures for CD-ROM
The second approach is to create an index to the
file locations by hashing the full path names of
each file.
This method will not work for generic file or
directory searches.
A third method may utilize both above methods,
one can keep the advantage of Unix like one file per
directory scheme, at the same time allows building
indexes for the subdirectories.

19
File Structures for CD-ROM
A forth method, assume directories as files as well
and use a special index that organizes the
directories and the files into a hierarchy where a
simple parental index indicates the relationship
between all entries.
Rec Number File or dir name Parent
0 Root
1 Subdir1 0
2 Subdir11 1
3 Subdir12 1
4 File11 1
5 File 0
6 Subdir2 0

20
Representation of individual files on CD-
ROM

B+ Tree type data structures are appropriate for


organizing the files on CD-ROMs.
Build once read many times allows attempting
to achieve100% utilization of blocks or buckets.
Packing the internal nodes so that all of them can
be maintained in the memory during the data
fetches is important.
Secondary indexes can be formed so that the
records are pined to the indexes on a CD-ROM, as
the file will never be reorganized…

21
Representation of individual files on CD-
ROM

This may force the files on the source disks and


their copies on the CD-ROM to be differently
organized, because of the efficiency concerns.
It is possible to use hashing on the CD-ROM,
except that the overflow should either not exist or
minimized. This becomes possible when the
addressing space is kept large.
Remember that the files to be put on a CD-ROM
are final, so the hashing function can be chosen to
perform the best, i.e. with no collisions.

22
23

A journey of a Byte
and
Buffer Management
A journey of a byte

Suppose in our program we wrote:


outfile << c;
This causes a call to the file manager (a part
of O.S. responsible for I/O operations)
The O/S (File manager) makes sure that the
byte is written to the disk.
Pieces of software/hardware involved in I/O:
 Application Program
 Operating System/ file manager
 I/O Processor
 Disk Controller

24
Application program
 Requests the I/O operation
Operating system / file manager
 Keeps tables for all opened files
 Brings appropriate sector to buffer.
 Writes byte to buffer
 Gives instruction to I/O processor to write data from this
buffer into correct place in disk.
 Note: the buffer is an exact image of a cluster in disk.
I/O Processor
 a separate chip; runs independently of CPU
 Find a time when drive is available to receive data and put dat
in proper format for the disk
 Sends data to disk controller
Disk controller
 A separate chip; instructs the drive to move R/W head
 Sends the byte to th surface when the proper sector comes
under R/W head.

25
Buffer Management

Buffering means working with large chunks of


data in main memory so the number of
accesses to secondary storage is reduced.
System I/O buffers are beyond the control of
application programs and are manipulated by
the OS.
Note that the application program may
implement its own “buffer” – i.e. a place in
memory (variable, object) that accumulates
large chunks of data to be later written to disk
as one chunk.
26
System I/O Buffer

Data transferred
by blocks

Secondary
Storage Buffer Program

Data transferred by
records

Temporary storage in MM
for one block of data

27
Buffer Bottlenecks

Consider the following program segment:


while (1) {
infile >> ch;
if (infile.fail()) break;
outfile << ch;
}
What happens if the OS used only one I/O
buffer?
Þ Buffer bottleneck
Most OS have an input buffer and an output
buffer.
28
Buffering Strategies

Double Buffering: Two buffers can be used


to allow processing and I/O to overlap.
Suppose that a program is only writing to a disk.
 CPU wants to fill a buffer at the same time that I/O
is being performed.
 If two buffers are used and I/O-CPU overlapping is
permitted, CPU can be filling one buffer while the
other buffer is being transmitted to disk.
 When both tasks are finished, the roles of the buffers
can be exchanged.
The actual management is done by the OS.
29
Other Buffering Strategies
Multiple Buffering: instead of two buffers any
number of buffers can be used to allow processing
and I/O to overlap.
Buffer pooling:
 There is a pool of buffers.
 When a request for a sector is received, OS first looks to
see that sector is in some buffer.
 If not there, it brings the sector to some free buffer. If no
free buffer exists, it must choose an occupied buffer.

30
Questions

You might also like