Lecture 4

 

Chapter 3 (continued)

 

 

·        CD-ROM

·        Roots go back to the early 1980’s with LaserVision discs

·        File Structure Issues

·        Strengths

·        High storage capacity

·        Inexpensive price

·        Durability

·        Weaknesses

·        Seeks are very slow

·        Three orders of magnitude slower than hard disk

·        Transfer rates are about an order of magnitude slower than hard disk

·        Physical representation

·        Lasers burn pits onto surface of tracks

·        Smooth parts are called lands

·        Light is scattered when shining on pits and reflected on lands

·        A 1 bit is represented by a transition from a pit to a land and back to a pit

·        Zero bits are represented by the amount of time light shines on a pit

·        Logical representation

·        Cannot represent two 1’s in a row

·        Must have at least two 0’s between any pair of 1’s

·        Must use 14 bits to represent 8 bits

·        Uses a table lookup to get translation

·        Uses Constant Linear Velocity rather than Constant Angular Velocity

·        CLV requires that speed change as arm seeks

·        This further slows the seeks

·        Addressing

·        Addresses are stored on sectors

·        In order to read address the disk must be spinning at the right speed

·        The speed is determined by which address is being read

·        This “catch 22” is solved by a trial and error process

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

·        Each sector holds 2K bytes of data

·        Each sector is addressed by the minute, second and sector of play

·        Structure of a sector

·        12 bytes synch

·        4 bytes sector ID

·        2,048 bytes user data

·        4 bytes error detection

·        8 bytes null

·        276 bytes error correction

·        Storage as a Hierarchy

·        Ram, Direct-access, Serial, Archival

 

·        The File Manager

·        Checks for proper ownership type of access, etc.

·        Maps logical to physical during OPEN request

·        File Allocation Table (FAT) contains cylinder, track and sector of file start as well as file length

·        Translates I/O requests into physical addresses on a device

·        Initiates physical I/O into/from I/O Buffer

 

·        The I/O Processor and Disk Controller

·        Receives commands sent from the CPU

·        Assembles collections of bytes to and from external devices and thus frees up the CPU

·        Sends proper electrical signals to the disk to seek, search, read and write

·        Data is physically read/written on the device one byte at a time.

 

·        The I/O Buffer

·        Contains block of input data until program asks for a record

·        All I/O to disk and tape are performed on a block basis

·        Output hold output data until a block is full or file is closed

 

·        Multiple buffering

·        Enables overlap of CPU processing and I/O

·        How many buffers are enough?

·        Buffer pooling

·        Least Recently Used (LRU) buffer management strategy

·        Move Mode – Data is moved from the buffer to the program

·        Locate Mode – An address is made available to the program for each record read

·        Scatter/Gather I/O

·        Data from a single block can be read/written into different memory locations with a single I/O

·        Chained channel programming is used to control this type of I/O

 

Example:

 

          Search         Index           CC   

          Seek            A(cchh)       CC

          Search ID=  A(cchhr)      CC

          TIC             A(*-8)         CC

          Read           A(Buf1)       DC    50

          Read           A(Buf2)       DC     100

          Read           A(Buf3)       00      30

 

·        File Types

·        Normal Files – e.g. disk, tape

·        Special Files – e.g. printers, graphics devices

·        Sockets – abstractions that serve as endpoints for interprocess communications

 

·        I/O access methods

·        Block I/O

·        Character I/O

·        Network I/O

·        Device Drivers

·        Perform the actual I/O between the I/O buffer and the device

·        Similar to the I/O processor program described earlier

·        Specific to the way a particular device works and is usually implemented by a device manufacturer or user after the operating system has been written

 


Assignment #1

Due:  9/18/97

 

You are asked to write a program that reads a parameter file, named PARM.FIL, containing a specification record and a collection of text records, each containing the name of a sorted (ascending) input file.  The collection of sorted input files is to be merged into a single sorted file named OUT.FIL.  The offset and length of the sort field (character) within each record will be contained in the specification record.  Records in all files will be terminated with a carriage return or line feed character.

 

You should submit your assignment to me via Email with attachments to the single Email message as follows:

 

·        Source code

·        Parameter file

·        Input file 1

·        Input file 2

·            .

·            .

·            .

·        Input file n

·        Output File