0% found this document useful (0 votes)
124 views39 pages

Ssos - U5

Uploaded by

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

Ssos - U5

Uploaded by

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

BISHOP APPASAMY COLLEGE OF ARTS & SCIENCE ,COIMBATORE

DEPARTMENT OF COMPUTER SCIENCE – BCA


II BCA - FOURTH SEMESTER

SYSTEM SOFTWARE AND OPERATING SYSTEM – 43A

Handled By
Dr.N.SUDHA
ASSOCIATE PROFESSOR
DEPARTMENT OF COMPUTER SCIENCE
SYSTEM SOFTWARE AND OPERATING SYSTEM – 43A

TEXT BOOKS

1. Leland L. Beck , System Software : An Introduction to System


Programming , Pearson , Third Edition.

2. H.M. Deitel , Operating Systems , 2nd Edition , Pearson , 2003.

Course Study :
Consists of 5 Units : Unit 1 & 2 – System Software
Unit 3 to 5 – Operating Systems
Max.Marks : 100 Marks
Internal : 50 Marks
External : 50Marks
UNIT - V
Device and Information Management Disk Performance optimization : Operation of moving head
disk storage – Need for disk scheduling – seek optimization – File and Database Systems : File
System – Functions – organization – allocating and freeing space – File Descriptor – Access
Control Matrix.
DISK SCHEDULING

Disk scheduling is done by operating systems to schedule I/O requests arriving for
the disk. Disk scheduling is also known as I/O scheduling. Multiple I/O requests may arrive by
different processes and only one I/O request can be served at a time by the disk controller.
OPERATION OF MOVING HEAD DISK STORAGE
Data is recorded on a series of magnetic disk or platters. These disks are connected by
a common spindle that spins at very high speed. The data is accessed (ie., either read or written)
by a series of read-write heads, one head per disk surface.

This is a schematic representation of the side view of a moving-head disk. Data is


recorded on a series of magnetic disk or platters. These disks are connected by a common spindle
that spins at very high speed. The data is accessed (ie., either read or written) by a series of read-
write heads, one head per disk surface. A read-write head can access only data immediately
adjacent to it.
Therefore, before data can be accessed, the portion of the disk surface from which the
data is to be read (or the portion on which the data is to be written) must rotate until it is
immediately below (or above) the read-write head. The time it takes for data to rotate from its
current position to a position adjacent to the read-write head is called latency time.
Each of the several read-write heads, while fixed in position, sketches out in circular
track of data on a disk surface. All read-write heads are attached to a single boom or moving arm
assembly. The boom may move in or out. When the boom moves the read-write heads to a new
position, a different set of tracks becomes accessible.
For a particular position of the boom, the set of tracks sketched out by all the read-
write heads forms a vertical cylinder. The process of moving the boom to a new cylinder is called
a seek operation.

Components of a Disk Access


WHY DISK SCHEDULING IS NECESSARY
In multi programmed computing systems , many processes may be generating requests
for reading and writing disk records. These processes sometimes make requests faster than they
can be serviced by the moving head disks , waiting lines or queues build up for each device. Disk
scheduling is necessary in order to serve the users request more efficiently. Disk scheduler
examines the positional relationship among waiting requests. The request queue is then
reordered so that the request will be serviced with minimum mechanical motion.
The two most common types of scheduling discussed in the literature are seek
optimization and rotational or latency optimization. Since seek time tends to be about an order of
magnitude greater than latency times, most scheduling algorithms concentrate on minimizing
seek times for a set of requests. Minimizing latency usually has a little effect on overall system
performance , except under heavy loads.
Therefore the desirable characteristics of disk scheduling policies are
* throughput
* mean response time
* Variance of response times
SEEK OPTIMIZATION
The most popular seek optimization strategies are
• FCFS(First Come First Serve)
• SSTF(Shortest Seek Time First)
• SCAN
• C-SCAN
• N-Step SCAN
• Eschenbach scheme

• FCFS
• SSTF(Shortest Seek Time First)
• Scan Scheduling
• N-step Scan Scheduling
•C-Scan Scheduling
• Eschenbach Scheme

Disk arm movement is circular as in C-SCAN, but with several important exceptions.
Every cylinder is serviced for exactly one full track of information whether or not there is a
request for that cylinder. Requests are reordered for service within a cylinder to take advantage of
rotational position, but if two requests overlap sector positions within a cylinder, only one is
serviced for the current sweep of the disk arm.
This strategy is designed for handling heavy loads. This is the only scheme which not
only attempts to optimize seek time but also rotational delay.
Disk Scheduling Algorithms
FILE AND DATA BASE SYSTEMS
File is a named collection of data which resides on secondary storage device such as
tape or disk.
The various files manipulation are
Create , Open , Close
Destroy , Copy , Rename , List
Individual data items in the file may be manipulated by operations like
read,
write
Update
Insert
Delete
There for files may be characterized by
Volatility
Activity
Size
FILE SYSTEM
File system generally contains
Access method – Concerned with the manner in which the data stored in the
file is accessed.
File Management – Concerned with providing the mechanism for the files to
be stored , referenced, shared and secured.
Auxiliary storage management - Concerned with allocating space for the
files on a secondary storage device.
File Integrity mechanism – Concerned with guaranteeing that the information
the file is not corrupted. When file integrity is assured the information suppose to be in the file
should be there.
The file systems is primarily concern with managing the secondary storage
space particularly disk storage.
The file system may be organized as
- Root directory
- User Directories
- User files
FILE SYSTEM FUNCTIONS

-User should be able to create, modify and delete files.


- User should be able to share each others files controlled manner in order to build
upon each others work.
- The mechanism for sharing file should provide various type of controlled access
such read, write ,execute.
- User should be able to structure their files in a manner most appropriate for each
applications
- User should be able to order the transfer of information between files
- Back up and recovery capabilities must be provided to prevent accidental loss
- User should be able to refer their files by symbolic names rather then using
physical device name.
- The file system may also provide encryption and decryption capabilities to keep
the file secured.
- The file system should provide an user friendly interface.
FILE ORGANISATION
File organization refer to the order in which the records of a file are arranged in a
secondary storage. The different type of organization are
• Sequential
• Direct
• Indexed sequential
• Partitioned
There fore the term volume is used to the recording medium for each particular
auxiliary storage medium device. The volume used on a tape drive is a real of magnetic tape,
the volume used in a disk drive is disk
ALLOCATING AND FREEING SPACE

The problem of allocating and freeing space on disks is somewhat experienced in


primary storage allocation under variable partitioned multiprogramming. If desired to keep files
in adjacent areas of the disk , then such areas need to be collected. But files are allocated and
freed for the space on the disk to become increasingly fragmented.
One technique for alleviating this is to perform periodic compaction or garbage
collection. Files may be rearranged to occupy the adjacent areas on the disk and free spaces to be
collected in the other end as a single block. A system may reorganize the files if they not referred
for a long time.
Designing a file system requires knowledge of user community including the number
of users, the average number and size of the files per user. Users searching for a file use file scan
options to locate the next record or the previous record. These scans should result in minimal
seek activity when possible. In paged systems the smallest amount of information transferred
between secondary and primary storage is page, so that it makes sense to allocate secondary
storage blocks of the page size.
Types of allocation
• Contiguous allocation
• Non-contiguous allocation
- Sector oriented linked allocation
- Block allocation
• Contiguous allocation
Each file occupies a set of contiguous blocks on disk. When file is created, a disk is
search to find free memory having enough size to store a file, once the free memory found then
memories allocated. Each directory entry contains File name , Starting address of the first
block, Length in block.
Advantages
✓ It supports fast sequential and direct access.
✓ It provides a good performance.
✓ The number of disk seek required is minimal.
✓ Simple to implement, there are two things required.
1. starting block number
2. length of the file.
Disadvantages
✓ Find free spaces for new file, its time consuming.
✓ If size of the existing file increase that it may not be possible to
✓accommodate such a data.
✓ External fragmentation is possible

Example showing contiguous allocation


•Non-contiguous allocation
-Sector oriented linked allocation
- Block allocation
-Sector Oriented Linked Allocation
In this method, each file is linked list of disk blocks .
Each block contains
pointer to next block.
Each directory entry contains
File name
Starting block no.
Ending block no.
When new file is created a new directory entry is created an initially and it contains
null Value.
A write operation to the required free blocks to be added to the file at the end of link
list.
To read a file all blocks are read by the pointer from 1 block to another.
A view of the linked list
Example 9, 16, 1, 10, 25
Advantages
It does not suffer from external fragmentation
Disadvantages
File access is time consuming because it required to search link list
to reach at same block.
Direct access is not supported.
Memory space required for the pointers.
Reliability is compromised if the pointers are lost or damaged.
-Block Allocation
One scheme used to manage secondary storage more efficiently and reduce execution time
overhead is called block allocation. There are several common ways of implementing block
allocation systems block chaining , indexed block chaining and block oriented file mapping.
Block chaining
User Directory

File Location
In Block chaining entries in the user directory points to the first block of each file. The
fixed-length blocks comprising a file contains two portions a data block and a pointer to the next
block. The smallest unit of allocation is a fixed sized block that ordinarily consists of many
sectors. It is common to make the block size one full track on a disk. Locating a particular
record requires searching the block until the appropriate record is found.
Index block chaining
Link allocation method can not support direct access to solve this problem index allocation is
used.
It store all pointer together in the index table.
It bring all the pointer together in to one location called the index block.
Each file contain its own index block, the entry in the index block points to block no of the file.
Directory entry contains
File name
Index block
When the first block is return a free block is allocated and its address is shown in the entry of the
index block.
Advantages
No external fragmentation.
Support Direct access.
Support sequential access
Number of disk seeks is minimal.
Disadvantages
It suffer from wastage spaces.
Maximum allowable file size depends on size of an index block.
Block Oriented File Mapping
In block oriented file mapping instead of using pointers , the system uses block
numbers. A file map contains one entry for each block on the desk. Entries in the user directory
points to the first entry in the file map for each file. Each entry in the file map contains the block
number of the next block in that file. Thus all the blocks in the file may be located by following
the entries in the file map. The entry in the file map that corresponds to the last entry of a
particular file is set to a sentinel value NIL to indicate that the last block of the file has been
reached.
Some of the entries in the file map are set to free to indicate that the block is available for
allocation. The system may either search the file map linearly to locate a free block. An
advantage of the scheme is that physical adjacencies on the desk are reflected in the file map.
FILE DESCRIPTOR
A file descriptor or file control block is a control block containing information the systems needs
to manage a file. It is highly system depend structure. A file descriptor includes
symbolic file name
location of file in secondary storage
file organization
device type
access control
data type
disposition
creation data and time
destroy date
date and time last modified
access activity counts
The file descriptor is maintained in the secondary storage.
They are primary storage when the file is operated.
ACCESS CONTROL MATRIX
One way to control access to files is to create a two-dimensional access control matrix listing all
the users and all the files in the system. The entry Aij is 1 is I user ii is allowed access to file j :
otherwise Aij = 0. In an installation with a large number of users and a large number of files, this
matrix would be very large –and very sparse. Allowing one user
Access to another user’s files is the exception rather that the rule. To make such a matrix concept
useful, it would be necessary to use codes to indicate various kinds of access such as readonly,
writeonly, executeonly, readwrite,etc.

ACCESS CONTROL BY USER CLASSES

A technique that requires considerably less space is to control access to various user classes. A
common classification scheme is
Owner – Normally, this is the user who created the file.
1. Specified User - The owner specifies that another individual may use the file.
2. Group or Project – Users are often members of a group working on a particular project. In
this case the various members of the group may all be granted access to each other’s project-
related files.
3. Public- Most systems allow a file to be designated as public so that it may be accessed by any
member of the system’s user community. Public access normally allows users to read or execute
a file, but not to write it.

You might also like