You are on page 1of 36

OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

BTCS 401 Operating Systems

PART-A
1. Introduction to Operating system, Role of Operating System as resource manager, function of
kernel and shell, operating system structures, views of an operating system.
2. Process management: CPU scheduling, Scheduling Algorithms, PCB, Process synchronization,
Deadlocks, Prevention, Detection and Recovery .
3. Memory Management: Overlays, Memory management policies, Fragmentation and its types,
Partitioned memory managements:-Paging, Segmentation. Need of Virtual memories, Page
replacement Algorithms, Concept of Thrashing.

PART-B

4. Device Management: I/O system and secondary storage structure, Device management policies,
Role of I/O traffic controller, scheduler .
5. File Management: File System Architecture, Layered Architecture, Physical and Logical File
Systems, Protection and Security.
6. Brief study to multiprocessor and distributed operating systems.
7. Case Studies: LINUX / UNIX Operating System and Windows based operating systems

Suggested Readings/ Books:


1. A Silberschatz and Peter B. Galvin, “Operating System Concepts" Addison” Wesley Publishing
Company
2. Dhamdhere, “Systems Programming & Operating Systems” Tata McGraw Hill
3. Gary Nutt, “Operating Systems Concepts”, Pearson Education Ltd. 3rd Edition
4. Operating System by Madnick Donovan
5. Operating System by Stallings .
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

PART -B
FILE SYSTEMS(CHAPTER 5)
Ques: Discuss various file types ,file attributes and its operations.(10 marks)
File Attributes and operations
A file's attributes vary from one operating system to another but typically consist of these:

1. Name. The symbolic file name is the only information kept in human readable form.
2. Identifier. This unique tag, usually a number, identifies the file within the file system; it is the non-
human-readable name for the file.
3. Type. This information is needed for systems that support different types of files.
4. Location. This information is a pointer to a device and to the location of the file on that device.
5. Size. The current size of the file (in bytes, words, or blocks) and possibly the maximum allowed size
are included in this attribute.
6. Protection. Access-control information determines who can do reading, writing, executing, and so on.
7. Time, date, and user identification. This information may be kept for creation, last modification, and
last use. These data can be useful for protection, security, and usage monitoring.

Operations:
1. Creating a file. Two steps are necessary to create a file. First, space in the file system must be found
for the file. Second, an entry for the new file must be made in the directory.
2. Writing a file. To write a file, we make a system call specifying both the name of the file and the
information to be written to the file. Given the name of the file, the system searches the directory to
find the file's Location.The system must keep a write pointer to the location in the file where the next
write is to take place. The write pointer must be updated whenever a write occurs.
3. Reading a file. To read from a file, we use a system call that specifies the name of the file and where
(in memory) the next block of the file should be put. Again, the directory is searched for the
associated entry, and the system needs to keep a read pointer to the location in the file where the next
read is to take place. Once the read has taken place, the read pointer is updated. Because a process is
usually either reading from or writing to a file, the current operation location can be kept as a per-
process. Both the read and write operations use this same pointer, saving space and reducing system
complexity.
4. Repositioning within a file. The directory is searched for the appropriate entry, and the current-file-
position pointer is repositioned to a given value. Repositioning within a file need not involve any
actual I/0. This file
5. operation is also known as a file seek.
6. Deleting a file. To delete a file, we search the directory for the named file. Having found the
associated directory entry, we release all file space, so that it can be reused by other files, and erase the
directory entry.
7. Truncating a file. The user may want to erase the contents of a file but keep its attributes. Rather than
forcing the user to delete the file and then recreate it, this function allows all attributes to remain
unchanged –except for file length-but lets the file be reset to length zero and its file space released.

File Types
A common technique for implementing file types is to include the type as part of the file name. The name is
split into two parts-a name and an extension, usually separated by a period character . In this way, the user and
the operating system can tell from the name alone what the type of a file is. For example, most operating
systems allow users to specify a file name as a sequence of characters followed by a period and terminated by
an extension of additional characters. File name examples include resume.doc, Server.java, and
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

ReaderThread. c. The system uses the extension to indicate the type of the file and the type of operations that
can be done on that file. Only a file with a .com, .exe, or .bat extension can be executed, for instance. The
.com and .exe files are two forms of binary executable files

FILE TYPES

File Access Methods:


Ques: Discuss various file access methods in detail?(PTU 5 MARKS)

1.Sequential Access
1. Information in the file is processed in order, one record after the other. This mode of access is by
far the most common; for example, editors and compilers usually access files in this fashion.
2. Reads and writes make up the bulk of the operations on a file. A read operation-read next-reads
the next portion of the file and automatically advances a file pointer, which tracks the I/O location.
3. Similarly, the write operation-write next-appends to the end of the file and advances to the end of
the newly written material (the new end of file).
4. Such a file can be reset to the beginning; and on some systems, a program may be able to skip
forward or backward n records for some integer n-perhaps only for n = 1.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

Figure 11.4 - Sequential-access file.


2.Direct Access:
 A file is made up of fixed length that allow programs to read and write records rapidly in no particular
order. The direct-access method is based on a disk model of a file, since disks allow random access to
any file block. For direct access, the file is viewed as a numbered sequence of blocks or records.
 Thus, we may read block 14, then read block 53, and then write block 7.
 There are no restrictions on the order of reading or writing for a direct-access file.
 Direct-access files are of great use for immediate access to large amounts of information.
 Databases are often of this type. When a query concerning a particular subject arrives, we compute
which block contains the answer and then read that block directly to provide the desired information.
 For the direct-access method, the file operations must be modified to include the block number as a
parameter. Thus, we have read n, where n is the block number, rather than read next, and ·write n
rather than write next. An alternative approach is to retain read next and write next, as with sequential
access, and to add an operation position file to n, where n is the block number.
 Then, to effect a read n, we would position to n and then read next.
 The block number provided by the user to the operating system is normally a relative block number. A
relative block number is an index relative to the begining of the file. Thus, the first relative block of the file
is 0, the next is 1, and so on, even though the absolute disk address may be 14703 for the first block and
3192 for the second.

Figure - Simulation of sequential access on a direct-access file.


 Other Access Methods
 An indexed access scheme can be easily built on top of a direct access system. Very large files may require a multi-
tiered indexing scheme, i.e. indexes of indexes.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

Figure 11.6 - Example of index and relative files.

Allocation Methods
Ques :-Discuss various file allocation methods(PTU 10 Marks)
There are three major methods of storing files on disks: contiguous, linked, and indexed.

1. Contiguous Allocation
 It requires that each file occupy a set of contiguous blocks on disk. Disk addresses define a linear
ordering on the disk.
 Contiguous allocation of a file is defined by the disk address and length (in block units) of the first
block. If the file is n blocks long and starts at location b, then it occupies blocks b, b + 1, b + 2, ... , b + n
- 1. The directory entry for each file indicates the address of the starting block and the length of the
area allocated for this file
 Accessing a file that has been allocated contiguously is easy. For sequential access, the file system
remembers the disk address of the last block referenced and, when necessary, reads the next block. For
direct access to block i of a file that starts at block b, we can immediately access block b + i. Thus, both
sequential and direct access can be supported by contiguous allocation.
 Contiguous allocation has some problems, however. One difficulty is finding space for a new file. First
fit and best fit are the most common strategies used to select a free hole from the set of available
holes. Simulations have shown that both first fit and best fit are more efficient than worst fit in terms of
both time and storage utilization. Neither first fit nor best fit is clearly best in terms of storage
utilization
Disadvantages:
 All these algorithms suffer from the problem of external fragmentation. As files are allocated and
deleted, the free disk space is broken into pieces. External fragmentation exists whenever free space is
broken into chunks. It becomes a problem when the largest contiguous chunk is insufficient for a
request; storage is fragmented into a number of holes, none of which is large enough to store the data

One strategy for preventing loss of significant amounts of disk space to external fragmentation is to copy an entire file
system onto another disk or tape. The original disk is then freed completely, creating one large contiguous free space. This
is called compaction.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

2. Linked Allocation

1. It solves all problems of contiguous allocation.


2. With linked allocation, each file is a linked list of disk blocks; the disk blocks may be scattered anywhere on the
disk.
3. The directory contains a pointer to the first and last blocks of the file. For example, a file of five blocks might
start at block 9 and continue at block 16, then block 1, then block 10, and finally block 25 (Figure 11.6). Each
block contains a pointer to the next block.
4. If each block is 512 bytes in size, and a disk address (the pointer) requires 4 bytes, then the user sees blocks of
508 bytes.
5. To create a new file, we simply create a new entry in the directory. With linked allocation, each directory entry
has a pointer to the first disk block of the file. This pointer is initialized to nil (the end-of-list pointer value) to
signify an empty file. The size field is also set to 0. A write to the file causes the free-space management system
to filed a free block, and this new block is written to and is linked to the end of the file. To read a file, we simply
read blocks by following the pointers from block to block.

Advantages
There is no external fragmentation with linked allocation, and any free block on the free-space list can be used to satisfy a
request. The size of a file need not be declared when that file is created. A file can continue to grow as long as free blocks
are available. Consequently, it is never necessary to compact disk space.
Disadvantages

1. Linked allocation does have disadvantages, however. The major problem is that it can be used effectively only
for sequential-access files. To filed the ith block of a file, we must start at the begining of that file and follow the
pointers until we get to the ith block. Each access to a pointer requires a disk read, and some require a disk seek.
Consequently, it is inefficient to support a direct-access capability for linked-allocation files.
2. Another disadvantage is the space required for the pointers. If a pointer requires 4 bytes out of a 512-byte
block, then 0.78 percent of the disk is being used for pointers, rather than for information. Each file requires
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

slightly more space than it would otherwise.


Figure - Linked allocation of disk space.

 The File Allocation Table, FAT,  used by DOS is a variation of linked allocation, where all the links are
stored in a separate table at the beginning of the disk. The benefit of this approach is that the FAT table
can be cached in memory, greatly improving random access speeds.

Figure - File-allocation table.

3. Indexed Allocation
 Indexed Allocation combines all of the indexes for accessing each file into a
common block ( for that file ), as opposed to spreading them all over the disk or
storing them in a FAT table.
 Each file has its own index block, which is an array of disk-block addresses. The i th
entry in the index block points to the ith block of the file. The directory contains the
address of the index block (Figure ).
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

 To find and read the ith block, we use the pointer in the ith index-block entry. This
scheme is similar to the paging scheme.
 When the file is created, all pointers in the index block are set to nil. When the ith
block is first written, a block is obtained from the free-space management and its
address is put in the ith index-block entry.
 Advantage:-Indexed allocation supports direct access, without suffering from
external fragmentation, because any free block on the disk can satisfy a request for
more space. Disadvantage-The pointer overhead of the index block is generally
greater than the pointer overhead of linked allocation.

Figure 12.8 - Indexed allocation of disk space.

Directory Structure
11.3.1 Storage Structure
 A disk can be used in its entirety for a file system.
 Alternatively a physical disk can be broken up into multiple partitions, slices, or mini-disks, each of which
becomes a virtual disk and can have its own filesystem. ( or be used for raw storage, swap space, etc. )
 Or, multiple physical disks can be combined into one volume, i.e. a larger virtual disk, with its own
filesystem spanning the physical disks.

Figure 11.7 - A typical file-system organization.


OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

11.3.2 Directory Overview


 Directory operations to be supported include:
o Search for a file
o Create a file - add to the directory
o Delete a file - erase from the directory
o List a directory - possibly ordered in different ways.
o Rename a file - may change sorting order
o Traverse the file system.
11.3.3. Single-Level Directory

Simple to implement, but each file must have a unique name. A single-level directory has significant limitations, however, when
the number of files increases or when the system has more than one user. Since all files are in the same directory, they must have
unique names. If two users call their data file test, then the unique-name rule is violated.

 
Figure 11.9 - Single-level directory.
11.3.4 Two-Level Directory

In the two-level directory structure, each user has his own UFD(Unique File Directory) The UFDs have similar
structures, but each lists only the files of a single user. When a user job starts or a user logs in, the system's Master
File Directory(MFD)is searched The MFD is indexed by user name or account number, and each entry points to
the UFD for that user . When a user refers to a particular file, only his own UFD is searched.
Thus, different users may have files with the same name, as long as all the file names within each UFD are unique.
To create a file for a user, the operating system searches only that user's UFD to ascertain whether another file of
that name exists. To delete a file, the operating system confines its search to the local UFD; thus, it cannot
accidentally delete another user's file that has the same name.

 Each user gets their own directory space.


 File names only need to be unique within a given user's directory.
 A master file directory is used to keep track of each users directory, and must be maintained when
users are added to or removed from the system.
 A separate directory is generally needed for system ( executable ) files.
 Systems may or may not allow users to access other directories besides their own
o If access to other directories is allowed, then provision must be made to specify the
directory being accessed.
o If access is denied, then special consideration must be made for users to run programs located in
system directories. A search path is the list of directories in which to search for executable
programs, and can be set uniquely for each user.

Figure 11.10 - Two-level directory structure.


11.3.5 Tree-Structured Directories
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

A directory (or subdirectory) contains a set of files or subdirectories. A directory is simply another file, but it is
treated in a special way. All directories have the same internal format. One bit in each directory entry defines the
entry as a file (0) or as a subdirectory (1). Special system calls are used to create and delete directories.

 An obvious extension to the two-tiered directory structure, and the one with which we are all most
familiar.
 Each user / process has the concept of a current directory from which all ( relative ) searches take
place.
 Files may be accessed using either absolute pathnames ( relative to the root of the tree ) or relative
pathnames ( relative to the current directory. )
 Directories are stored the same as any other file in the system, except there is a bit that identifies
them as directories, and they have some special structure that the OS understands.
 One question for consideration is whether or not to allow the removal of directories that are not
empty - Windows requires that directories be emptied first, and UNIX provides an option for
deleting entire sub-trees.

Figure 11.11 - Tree-structured directory structure.


OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

File Systems Layered Structure:


(Logical files and Physical file system)
Ques: Discuss the layered structure of file systems? Also discuss FCB?(10 marks PTU)

Disks provide the bulk of secondary storage on which a file system is maintained. They have two
characteristics that make them a convenient medium for storing multiple files:
1. A disk can be rewritten in place; it is possible to read a block from the disk, modify the block, and
write it back into the sance place.
2. A disk can access directly any block of information it contains. Thus, it is simple to access any file
either sequentially or randomly, and switching from one file to another requires only moving the read-
write heads and waiting for the disk to rotate.

Figure 12.1 - Layered file system.

1.Blocks-To improve I/0 efficiency, I/0 transfers between memory and disk are performed in units of blocks.
Each block has one or more sectors. Depending on the disk drive, sector size varies from 32 bytes to 4,096
bytes; the usual size is 512 bytes.

2.Defining Data structures: (Data structure used in paging is “page table” which translate logical address to
physical address).
File system provide efficient and convenient access to the disk by allowing data to be stored, located, and
retrieved easily. A file system poses two quite different design problems. The first problem is defining how the
file system should look to the user. This task involves defining a file and its attributes, the operations
allowed on a file, and the directory structure for organizing files. The second problem is creating
algorithms and data structures to map the logical file system onto the physical secondary-storage
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

devices. The file system itself is generally composed of many different levels. The structure shown in Figure is
an example of a layered design.

3.I/O control -The lowest level, the I/O control, consists of device drivers and interrupt handlers to transfer
information between the main memory and the disk system.
A device driver can be thought of as a translator. Its input consists of high-level commands such as "retrieve
block 123." Its output consists of low level, hardware specific instructions that are used by the hardware
controller, which interfaces the I/0 device to the rest of the system. The device driver usually writes specific bit
patterns to special locations in the I/0 controller's memory to tell the controller which device location to act on
and what actions to take.

3. Basic file systems --The Basic file systems needs only to issue generic commands to the appropriate
device driver to read and write physical blocks on the disk. Each physical block is identified by its
numeric disk address (for example, drive 1, cylinder 73, track 2, sector 10). This layer also manages
the memory buffers and caches that hold various file-system, directory, and data blocks.
4. File-organization module can translate logical block addresses to physical block addresses for the basic
file system to transfer. Each file's logical blocks are numbered from 0 (or 1) through N. Since the physical
blocks containing the data usually do not match the logical numbers(because logical address and physical
addresses are not same), a translation is needed to locate each block. (eg. Paging).
The file-organization module also includes the free-space manager, which tracks unallocated blocks and
provides these blocks to the file-organization module when requested.
5. Logical File systems manages metadata information. Metadata includes all of the file-system structure
except the actual data (or contents of the files). The logical file system manages the directory structure via
file-control blocks.(FCB).
.
File-System Implementation(FCB)
 File systems store several important data structures on the disk:
o A boot-control block, ( per volume ) a.k.a. the boot block in UNIX or the partition boot sector in
Windows contains information about how to boot the system off of this disk. This will generally be
the first sector of the volume if there is a bootable system loaded on that volume, or the block will
be left vacant otherwise.
o A volume control block, ( per volume ) a.k.a. the master file table in UNIX or the superblock in
Windows, which contains information such as the partition table, number of blocks on each
filesystem, and pointers to free blocks and free FCB blocks.
o A directory structure ( per file system ), containing file names and pointers to corresponding FCBs.
UNIX uses inode numbers, and NTFS uses a master file table.
o The File Control Block, FCB, ( per file ) containing details about ownership, size, permissions,
dates, etc. UNIX stores this information in inodes, and NTFS in the master file table as a relational
database structure.

Figure 12.2 - A typical file-control block.

Virtual File Systems


Virtual File Systems, VFS, provide a common interface to multiple different file system types. In addition, it
provides for a unique identifier ( vnode ) for files across the entire space, including across all filesystems of
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

different types. ( UNIX inodes are unique only across a single filesystem, and certainly do not carry across
networked file systems. )
The VFS in Linux is based upon four key object types:
 The inode object, representing an individual file
 The file object, representing an open file.
 The superblock object, representing a filesystem.
 The dentry object, representing a directory entry.
Linux VFS provides a set of common functionalities for each filesystem, using function pointers accessed
through a table. The same functionality is accessed through the same table position for all filesystem types,
though the actual functions pointed to by the pointers may be filesystem-specific. See /usr/include/linux/fs.h
for full details. Common operations provided include open( ), read( ), write( ), and mmap( ).

Figure - Schematic view of a virtual file system.


OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

DEVICE MANAGEMENT(CHAPTER 4)
Secondary Storage Structure
Ques: What is the difference between seek time and Rotational latency.(PTU 2 MARKS).

Overview of Mass-Storage Structure


10.1.1 Magnetic Disks
 Traditional magnetic disks have the following basic structure:
o One or more platters  in the form of disks covered with magnetic media. Hard disk platters
are made of rigid metal, while "floppy" disks are made of more flexible plastic.
o Each platter has two working surfaces. Older hard disk drives would sometimes not use the
very top or bottom surface of a stack of platters, as these surfaces were more susceptible to
potential damage.
o Each working surface is divided into a number of concentric rings called tracks. The
collection of all tracks that are the same distance from the edge of the platter, ( i.e. all tracks
immediately above one another in the following diagram ) is called a cylinder.
o Each track is further divided into sectors, traditionally containing 512 bytes of data each,
although some modern disks occasionally use larger sector sizes. ( Sectors also include a
header and a trailer, including checksum information among other things. Larger sector sizes
reduce the fraction of the disk consumed by headers and trailers, but increase internal
fragmentation and the amount of disk that must be marked bad in the case of errors. )
o The data on a hard drive is read by read-write heads. The standard configuration ( shown
below ) uses one head per surface, each on a separate arm, and controlled by a common arm
assembly which moves all heads simultaneously from one cylinder to another. ( Other
configurations, including independent read-write heads, may speed up disk access, but
involve serious technical difficulties. )
o The storage capacity of a traditional disk drive is equal to the number of heads ( i.e. the
number of working surfaces ), times the number of tracks per surface, times the number of
sectors per track, times the number of bytes per sector. A particular physical block of data is
specified by providing the head-sector-cylinder number at which it is located.

Figure 10.1 - Moving-head disk mechanism.


 In operation the disk rotates at high speed, such as 7200 rpm ( 120 revolutions per second. ) The rate
at which data can be transferred from the disk to the computer is composed of several steps:
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

o The positioning time, a.k.a. the seek time or  random access time is the time required to
move the heads from one cylinder to another, and for the heads to settle down after the move.
This is typically the slowest step in the process and the predominant bottleneck to overall
transfer rates.
o The rotational latency is the amount of time required for the desired sector to rotate around
and come under the read-write head.This can range anywhere from zero to one full
revolution, and on the average will equal one-half revolution. This is another physical step
and is usually the second slowest step behind seek time. ( For a disk rotating at 7200 rpm, the
average rotational latency would be 1/2 revolution / 120 revolutions per second, or just over
4 milliseconds, a long time by computer standards.
o The transfer rate, which is the time required to move the data electronically from the disk to
the computer. ( Some authors may also use the term transfer rate to refer to the overall
transfer rate, including seek time and rotational latency as well as the electronic data transfer
rate. )

Disk Arm Scheduling Policies


Or
Device Management Policies
Q: Discuss the various device management policies.(PTU 5 MARKS)

 As mentioned earlier, disk transfer speeds are limited primarily by seek times and rotational latency. When
multiple requests are to be processed there is also some inherent delay in waiting for other requests to be
processed.
 Bandwidth is measured by the amount of data transferred divided by the total amount of time from the first
request being made to the last transfer being completed, ( for a series of disk requests. )
 Both bandwidth and access time can be improved by processing requests in a good order.
 Disk requests include the disk address, memory address, number of sectors to transfer, and whether the request
is for reading or writing.
10.4.1 FCFS Scheduling
 First-Come First-Serve is simple and intrinsically fair, but not very efficient. Consider in the following
sequence the wild swing from cylinder 122 to 14 and then back to 124:

Figure 10.4 - FCFS disk scheduling.


10.4.2 SSTF Scheduling
 Shortest Seek Time First scheduling is more efficient, but may lead to starvation if a constant stream
of requests arrives for the same general area of the disk.
 SSTF reduces the total head movement to 236 cylinders, down from 640 required for the same set of
requests under FCFS. Note, however that the distance could be reduced still further to 208 by starting
with 37 and then 14 first before processing the rest of the requests.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

Figure 10.5 - SSTF disk scheduling.

10.4.3 SCAN Scheduling


 The SCAN algorithm, a.k.a. the elevator algorithm moves back and forth from one end of the disk to the
other, similarly to an elevator processing requests in a tall building.

Figure 10.6 - SCAN disk scheduling.


 Under the SCAN algorithm, If a request arrives just ahead of the moving head then it will be processed
right away, but if it arrives just after the head has passed, then it will have to wait for the head to pass
going the other way on the return trip. This leads to a fairly wide variation in access times which can be
improved upon.
 Consider, for example, when the head reaches the high end of the disk: Requests with high cylinder
numbers just missed the passing head, which means they are all fairly recent requests, whereas
requests with low numbers may have been waiting for a much longer time. Making the return scan
from high to low then ends up accessing recent requests first and making older requests wait that
much longer.
10.4.4 C-SCAN Scheduling
 The Circular-SCAN algorithm improves upon SCAN by treating all requests in a circular queue fashion -
Once the head reaches the end of the disk, it returns to the other end without processing any requests,
and then starts again from the beginning of the disk:
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

Figure 10.7 - C-SCAN disk scheduling.


12.4.5 LOOK Scheduling
 LOOK scheduling improves upon SCAN by looking ahead at the queue of pending requests, and not
moving the heads any farther towards the end of the disk than is necessary. The following diagram
illustrates the circular form of LOOK:

Figure 10.8 - C-LOOK disk scheduling.

I/O TRAFFIC CONTROLLER


Ques: Discuss the working of I/O Traffic controller in detail.(PTU 10 MARKS)

I/O DEVICES
I/O HARDWARE:
1. A device communicates with a computer system by sending signals over a cable or even through the
air. The device communicates with the machine via a connection point, or port .example, a serial
port.
2. If devices use a common set of wires, the connection is called a bus. A bus is a set of wires and a
rigidly defined protocol that specifies a set of messages that can be sent on the wires.
3. In terms of the electronics, the messages are conveyed by patterns of electrical voltages applied to the
wires with defined timings. When device A has a cable that plugs into device B, and device B has a
cable that plugs into device C, and device C plugs into a port on the computer, this arrangement is
called a daisy chain. A daisy chain usually operates as a bus.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

A typical PC bus structure appears in Figure 13.1. This figure shows a PCI bus (the common PC system bus)
that connects the processor-memory subsystem to the fast devices and an expansion bus that connects
relatively slow devices, such as the keyboard and serial and USB ports.
In the upper-right portion of the figure, four disks are connected together on a SCSI bus plugged into a SCSI
controller. Other common buses used to interconnect main parts of a computer include PCI-X with throughput
up to 4.3 GB and PCI-Express (PCie), with throughput to 16 GB and Hyper Transport with throughput up
to 20 GB.

 The PCI(Peripheral component Interconnect) bus connects high-speed high-bandwidth devices to


the memory subsystem ( and the CPU. )
 The expansion bus connects slower low-bandwidth devices, which typically deliver data one
character at a time ( with buffering. )
 The SCSI(Small computer system Interface) bus connects a number of SCSI devices to a common
SCSI controller.
 A daisy-chain bus, ( not shown) is when a string of devices is connected to each other like beads on a
chain, and only one of the devices is directly connected to the host.
A Controller is a collection of electronics that can operate a port, a bus,or a device. A serial-port controller is
a simple device controller. It is a single
chip (or portion of a chip) in the computer that controls the signals on the wires of a serial port.

 One way of communicating with devices is through registers associated with each port. Registers
may be one to four bytes in size, and may typically include ( a subset of ) the following four:
1. The data-in register is read by the host to get input from the device.
2. The data-out register is written by the host to send output.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

3. The status register has bits read by the host to ascertain the status of the device, such as
idle, ready for input, busy, error, transaction complete, etc.
4. The control register has bits written by the host to issue commands or to change settings of
the device such as parity checking, word length, or full- versus half-duplex operation.
 Figure shows some of the most common I/O port address ranges.

Interrupts

 Interrupts allow devices to notify the CPU when they have data to transfer or when an operation is
complete, allowing the CPU to perform other duties when no I/O transfers need its immediate
attention.
 The CPU has an interrupt-request line that is sensed after every instruction.
 A device's controller raises an interrupt by asserting a signal on the interrupt request line.
 The CPU then performs a state save, and transfers control to the interrupt handler routine at a fixed
address in memory. ( The CPU catches the interrupt and dispatches the interrupt handler. )
 The interrupt handler determines the cause of the interrupt, performs the necessary processing,
performs a state restore, and executes a return from interrupt instruction to return control to the
CPU. ( The interrupt handler clears the interrupt by servicing the device. )

( Note that the state restored does not need to be the same state as the one that was saved when the interrupt
went off.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

PROTECTION AND ITS MECHANISMS IN OPERATING SYSTEM


Ques :1 Discuss various goals of Protection.(PTU 5 Marks)
Ques 2: Discuss various Protection mechanisms to protect software resources.(PTU 5 Marks)
Ques 3: Differentiate ACL and capability list.

Principles of Protection
 The principle of least privilege dictates that programs, users, and systems be given just enough
privileges to perform their tasks.
 This ensures that failures do the least amount of harm and allow the least of harm to be done.
 For example, if a program needs special privileges to perform a task, it is better to make it a SGID
program with group ownership of "network" or "backup" or some other pseudo group, rather than
SUID with root ownership. This limits the amount of damage that can occur if something goes wrong.
 Typically each user is given their own account, and has only enough privilege to modify their own
files.
 The root account should not be used for normal day to day activities - The System Administrator
should also have an ordinary account, and reserve use of the root account for only those tasks which
need the root privileges

Goals of Protection
 Obviously to prevent malicious misuse of the system by users or programs.
 To ensure that each shared resource is used only in accordance with system policies, which may be
set either by system designers or by system administrators.
 To ensure that errant programs cause the minimal amount of damage possible.
 Note that protection systems only provide the mechanisms for enforcing policies and ensuring
reliable systems. It is up to administrators and users to implement those mechanisms effectively.

Mechanisms of protection:
1.Domain and Objects.
2.Access Matrix
3.Access Control List(ACL)
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

4.Capability List

1.Domain of Protection
 A computer can be viewed as a collection of processes and objects ( both HW & SW ).
 The need to know principle states that a process should only have access to those objects it needs to
accomplish its task, and furthermore only in the modes for which it needs access and only during the
time frame when it needs access.
 The modes available for a particular object may depend upon its type.

Domain Structure
 A protection domain specifies the resources that a process may access.
 Each domain defines a set of objects and the types of operations that may be invoked on each
object.
 An access right is the ability to execute an operation on an object.
 A domain is defined as a set of < object, { access right set } > pairs, as shown below. Note that
some domains may be disjoint while others overlap.

Figure 14.1 - System with three protection domains.


 The association between a process and a domain may be static or dynamic.
o If the association is static, then the need-to-know principle requires a way of
changing the contents of the domain dynamically.
o If the association is dynamic, then there needs to be a mechanism for domain
switching.
 Domains may be realized in different fashions - as users, or as processes, or as procedures.
E.g. if each user corresponds to a domain, then that domain defines the access of that user,
and changing domains involves changing user ID.
2. Access Matrix
 The model of protection that we have been discussing can be viewed as an access matrix, in which
columns represent different system resources and rows represent different protection domains.
Entries within the matrix indicate what access that domain has to that resource.

Figure 14.3 - Access matrix.


 Domain switching can be easily supported under this model, simply by providing "switch" access to
other domains:
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

Figure 14.4 - Access matrix of Figure 14.3 with domains as objects.


 The ability to copy rights is denoted by an asterisk, indicating that processes in that domain have the
right to copy that access within the same column, i.e. for the same object. There are two important
variations:
o If the asterisk is removed from the original access right, then the right is transferred, rather
than being copied. This may be termed a transfer right as opposed to a copy right.
o If only the right and not the asterisk is copied, then the access right is added to the new
domain, but it may not be propagated further. That is the new domain does not also receive
the right to copy the access. This may be termed a limited copy right, as shown in Figure
14.5 below:

Figure 14.5 - Access matrix with copy rights.


 The owner right adds the privilege of adding new rights or removing existing ones:
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

Figure 14.6 - Access matrix with owner rights.


 Copy and owner rights only allow the modification of rights within a column. The addition of control
rights, which only apply to domain objects, allow a process operating in one domain to affect the
rights available in other domains. For example in the table below, a process operating in domain D2
has the right to control any of the rights in domain D4.

Figure 14.7 - Modified access matrix of Figure 14.4

3. In Access Control List (ACL) each object has a list of (action, user-list) tuple.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

Access Matrix

For example, in the above diagram File1 & File2 would have following ACL:
File1: (         (read, {user1}),      (write, {user2})       )
File2: (     (read, {user1}),      (write, {})          )

4. On the other hand,  in  the capability list system which is a counter-part of ACL system, a user is
associated with a list of (action, object-list) tuple.
For example, for user1, capability list would be :
User1: (       (read, {file1,file2}),            (write, {})           )
User2: (       (read, { }),             (write, {file1} )          )

Implementation of Access Matrix

1. Global Table
 The simplest approach is one big global table with < domain, object, rights > entries.
 Unfortunately this table is very large ( even if sparse ) and so cannot be kept in memory
( without invoking virtual memory techniques. )
 There is also no good way to specify groupings - If everyone has access to some resource,
then it still needs a separate entry for every domain.
2. Access Lists for Objects
 Each column of the table can be kept as a list of the access rights for that particular object,
discarding blank entries.
 For efficiency a separate list of default access rights can also be kept, and checked first.
3. Capability Lists for Domains
 In a similar fashion, each row of the table can be kept as a list of the capabilities of that
domain.
 Capability lists are associated with each domain, but not directly accessible by the domain or
any user process.
 Capability lists are themselves protected resources, distinguished from other data in one of
two ways:
o A tag, possibly hardware implemented, distinguishing this special type of data.
( other types may be floats, pointers, booleans, etc. )
o The address space for a program may be split into multiple segments, at least one of
which is inaccessible by the program itself, and used by the operating system for
maintaining the process's access right capability list.
14.6 Access Control

 Role-Based Access Control, RBAC, assigns privileges to users, programs, or roles as appropriate,


where "privileges" refer to the right to call certain system calls, or to use certain parameters with
those calls.
 Users are assigned roles or can take roles based on passwords to the roles. In this way a user can
take a role that enables a privilege, allowing the user to run a program to accomplish a specific
task, as depicted in Figure 14.8. This implementation of privileges decreases the security risk
associated with superusers and setuid programs.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

Figure 14.8 - Role-based access control

SECURITY MECHANISMS IN OPERATING SYSTEM


Security refers to providing a protection system to computer system resources such as CPU, memory, disk,
software programs and most importantly data/information stored in the computer system. If a computer
program is run by an unauthorized user, then he/she may cause severe damage to computer or data stored
in it. So a computer system must be protected against unauthorized access, malicious access to system
memory, viruses, worms etc. We're going to discuss following topics in this chapter.

 Authentication
 One Time passwords
 Program Threats
 System Threats
 Computer Security Classifications
Authentication
Authentication refers to identifying each user of the system and associating the executing programs with
those users. It is the responsibility of the Operating System to create a protection system which ensures that
a user who is running a particular program is authentic. Operating Systems generally
identifies/authenticates users using following three ways −
 Username / Password − User need to enter a registered username and password with Operating
system to login into the system.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

 User card/key − User need to punch card in card slot, or enter key generated by key generator in
option provided by operating system to login into the system.
 User attribute - fingerprint/ eye retina pattern/ signature − User need to pass his/her attribute
via designated input device used by operating system to login into the system.

One Time passwords


One-time passwords provide additional security along with normal authentication. In One-Time Password
system, a unique password is required every time user tries to login into the system. Once a one-time
password is used, then it cannot be used again. One-time password are implemented in various ways.
 Random numbers − Users are provided cards having numbers printed along with corresponding
alphabets. System asks for numbers corresponding to few alphabets randomly chosen.
 Secret key − User are provided a hardware device which can create a secret id mapped with user id.
System asks for such secret id which is to be generated every time prior to login.
 Network password − Some commercial applications send one-time passwords to user on registered
mobile/ email which is required to be entered prior to login.

Program Threats
Operating system's processes and kernel do the designated task as instructed. If a user program made these
process do malicious tasks, then it is known as Program Threats. One of the common example of program
threat is a program installed in a computer which can store and send user credentials via network to some
hacker. Following is the list of some well-known program threats.
 Trojan Horse − Such program traps user login credentials and stores them to send to malicious user
who can later on login to computer and can access system resources.
 Trap Door − If a program which is designed to work as required, have a security hole in its code and
perform illegal action without knowledge of user then it is called to have a trap door.
 Virus − Virus as name suggest can replicate themselves on computer system. They are highly
dangerous and can modify/delete user files, crash systems. A virus is generatlly a small code
embedded in a program. As user accesses the program, the virus starts getting embedded in other
files/ programs and can make system unusable for user

System Threats
System threats refers to misuse of system services and network connections to put user in trouble. System
threats can be used to launch program threats on a complete network called as program attack. System
threats creates such an environment that operating system resources/ user files are misused. Following is
the list of some well-known system threats.
 Worm − Worm is a process which can choked down a system performance by using system
resources to extreme levels. A Worm process generates its multiple copies where each copy uses
system resources, prevents all other processes to get required resources. Worms processes can
even shut down an entire network.
 Port Scanning − Port scanning is a mechanism or means by which a hacker can detects system
vulnerabilities (Vulnerability is a cyber-security term that refers to a flaw in a system that can
leave it open to attack)to make an attack on the system.
 Denial of Service − Denial of service attacks normally prevents user to make legitimate use of the
system. For example, a user may not be able to use internet if denial of service attacks browser's
content settings.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

Linux File System vs Windows File System(CHAPTER 7)


Q: 1 Compare the file structure of window based OS and Linux operating systems.(PTU 5 Marks)
Q2.Discuss the main components of linux operating systems.(PTU 2 MARKS)

Linux’s file system has quite a few differences from the Windows file system. You won’t find any drive letters or
backslashes, but you will find an alien-looking layout where files can have the same name, differing only in capitalization.
This isn’t an exhaustive list. It is intended for new Linux users who aren’t aware of all the differences between Linux and
Windows. There are many more differences that apply.

1.Directory Structure
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

You won’t find any Windows, Program Files, or Users folders if you start browsing around the file system on your Linux
computer. (Although the /home/ directory is very similar to the Users folder.)
The Linux directory structure doesn’t just use different names for folders, it uses an entirely different layout. For example,
on Windows, an application might store all its files in C:\Program Files\Application. On Linux, its files would be split
between multiple locations – its binaries in /usr/bin, its libraries in /usr/lib, and its configuration files in /etc/.

2.Case Sensitivity
On Windows, you can’t have a file named file and another file named FILE in the same folder. The Windows file system
isn’t case sensitive, so it treats these names as the same file.
On Linux, the file system is case sensitive. This means that you could have files named file, File, and FILE in the same
folder. Each file would have different contents – Linux treats capitalized letters and lower-case letters as different
characters.

3.Backslashes vs. Forward Slashes


Windows uses backslashes, just as DOS did. For example, the path to a user’s directory on Windows is:
C:\Users\Name

On Linux, the path to a user’s home directory is:


/home/name
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

You will also notice that URLs in your web browser – even on Windows – use forward slashes. For example, it’s
https://www.howtogeek.com/article, not http:\\www.howtogeek.com\article.

4.No Drive Letters – It’s All Under /


Windows exposes partitions and devices at drive letters. Whether you have multiple hard drives, multiple partitions on
the same hard drive, or removable devices connected, each file system is available under its own drive letter.

Linux doesn’t have drive letters. Instead, it makes other file systems accessible at arbitrary directories. (Windows can do
this too, but this isn’t how it works out of the box.)
On Linux, everything is under / – the root directory. There are no files above the root directory, as there are files outside
of C: on Windows. When you connect a device to your computer, it will become available under /media/. The contents of
the directory display the contents of the mounted partition.

If you have multiple hard drives or hard drive partitions, you could mount them anywhere you like on your file system.
For example, you could place your home directories on a separate partition by mounting another partition at /home.
However, you could mount a partition anywhere you like – you could even mount it at /myBackupDrive.

5.Everything is a File
Just as every mounted file system is a directory under / (the root directory), everything on Linux is a file. For example,
your first hard drive is represented by /dev/sda, your CD drive is available at /dev/cdrom, while your mouse is
represented by /dev/mouse.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

6.You Can Delete or Modify Open Files


On Linux and other UNIX-like operating systems, applications don’t lock exclusive access to files as often as they do on
Windows. For example, let’s say you’re watching a video file in VLC on Windows. The credits are playing and you’re done
watching it, so you try to delete it. You’ll see an error message- – you need to stop watching the file in VLC before you can
delete it, rename it, or do anything else to it.

On Linux, you could generally delete or modify the video file as it was playing.

7. In Unix,file structure is UFS(Unix File Systems).In Windows we have FAT(File Allocation Table),FAT32 and
NTFS(New Technology File Systems) file systems.
Windows 10 kernel uses Windows NT file systems..

Linux is one of popular version of UNIX operating System. It is open source as its source code is freely
available. It is free to use. Linux was designed considering UNIX compatibility. Its functionality list is quite
similar to that of UNIX.

Components of Linux System


Ques : Discuss the main components of linux operating systems.(PTU 2 MARKS)
Linux Operating System has primarily three components
 Kernel − Kernel is the core part of Linux. It is responsible for all major activities of this operating
system. It consists of various modules and it interacts directly with the underlying hardware. Kernel
provides the required abstraction to hide low level hardware details to system or application
programs.
 System Library − System libraries are special functions or programs using which application
programs or system utilities accesses Kernel's features. These libraries implement most of the
functionalities of the operating system and do not requires kernel module's code access rights.
 System Utility − System Utility programs are responsible to do specialized, individual level tasks.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

Kernel Mode vs User Mode


Kernel component code executes in a special privileged mode called kernel mode with full access to all
resources of the computer.
User programs and other system programs works in User Mode which has no access to system hardware
and kernel code. User programs/ utilities use System libraries to access Kernel functions to get system's low
level tasks.

Basic Features
Following are some of the important features of Linux Operating System.
 Portable − Portability means software can works on different types of hardware in same way. Linux
kernel and application programs supports their installation on any kind of hardware platform.
 Open Source − Linux source code is freely available and it is community based development project.
Multiple teams work in collaboration to enhance the capability of Linux operating system and it is
continuously evolving.
 Multi-User − Linux is a multiuser system means multiple users can access system resources like
memory/ ram/ application programs at same time.
 Multiprogramming − Linux is a multiprogramming system means multiple applications can run at
same time.
 Hierarchical File System − Linux provides a standard file structure in which system files/ user files
are arranged.
 Shell − Linux provides a special interpreter program which can be used to execute commands of the
operating system. It can be used to do various types of operations, call application programs. etc.
 Security − Linux provides user security using authentication features like password protection/
controlled access to specific files/ encryption of data.

Architecture
The following illustration shows the architecture of a Linux system −
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

The architecture of a Linux System consists of the following layers −


 Hardware layer − Hardware consists of all peripheral devices (RAM/ HDD/ CPU etc).
 Kernel − It is the core component of Operating System, interacts directly with hardware, provides
low level services to upper layer components.
 Shell − An interface to kernel, hiding complexity of kernel's functions from users. The shell takes
commands from the user and executes kernel's functions.
 Utilities − Utility programs that provide the user most of the functionalities of an operating systems.

CHAPTER 6
Distributed Systems vs Network based Operating Systems
Ques: Discuss the difference between distributed and Network based operating systems.

Distributed Systems
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

A Distributed System is a collection of loosely coupled processors interconnected by a communication


network. From the point of view of a specific processor in a distributed system, the rest of the processors and
their respective resources are remote, whereas its own resources are local. The processors in a distributed
system may vary in size and function. They may include small microprocessors, workstations, minicomputers,
and large general-purpose cornputer systems. These processors are referred to by a number of names, such as
sites, nodes, computers, machines, and hosts, depending on the context in which they are mentioned. We
mainly use site to indicate the location of a machine and host to refer to a specific system at a site. Generally,
one host at one site, the server, has a resource that another host at another site, the client (or user), would like
to use. A general structure of a distributed system is shown in Figure 16.1.

There are four major reasons for building distributed systems: resource sharing, computation speedup,
reliability, and communication

16.1.1 Resource Sharing


If a number of different sites (with different capabilities) are connected to one another, then a user at one site
may be able to use the resources available at another. For example, a user at site A may be using a laser printer
located at site B. Meanwhile, a user at B may access a file that resides at A. In general, in a distributed system
provides mechanisms for sharing files at remote sites, processing information in a distributed database,
printing files at remote sites, using remote specialized hardware devices (such as a high-speed array processor),
and performing other operations.

16.1.2 Computation Speedup


If a particular computation can be partitioned into subcomputations that can run concurrently, then a distributed
system allows us to distribute the subcomputations among the various sites; the subcomputations can be
run concurrently and thus provide In addition, if a particular site is currently overloaded with jobs, some of
them can be moved to other, lightly loaded sites. This movement of jobs is called Automated load sharing.

16.1.3 Reliability
If one site fails in a distributed system, the remammg sites can continue operating, giving the system better
reliability. If the system is composed of multiple large autonomous installations (that is, general-purpose
computers), the failure of one of them should not affect the rest. If, however, the system is composed of small
machines, each of which is responsible for some crucialsystem function (such as character I/0 or the file
system), then a single failure may halt the operation of the whole system. In general, with enough redundancy
(in both hardware and data), the system can continue operation, even if some of its sites have failed.

16.1.4 Communication
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

 When several sites are connected to one another by a communication network, users at the various
sites have the opportunity to exchange information. At a low level, are passed between systems, much
as messages are passed between processes in the single-computer message system .Given message
passing, all the higher-level functionality found in standalone systems can be expanded to encompass
the distributed system. Such functions include file transfer, login, mail, and remote procedure calls
(RPCs).
 The advantage of a distributed system is that these functions can be carried out over great distances.
Two people at geographically distant sites can collaborate on a project, for example. By transferring
the files of the project, logging in to each other's remote systems to run programs, and exchanging
mail to coordinate the work, users minimize the limitations inherent in long distance work .

Network based Operating Systems


Network Operating Systems
A operating provides an environment in which users, who are aware of the multiplicity of machines, can access
remote resources by either logging in to the appropriate remote machine or transferring data from the remote
machine to their own machines.It includes:

Remote Login
An important function of a network operating system is to allow users to log in remotely. The Internet provides
the telnet facility for this purpose.

Remote File Transfer(FTP)


1. Another major function of a network operating system is to provide a mechanism for remote file transfer
from one machine to another. In such an enviromnent, each computer maintains its own local file system. If
a user at one site wants to access a file located on another computer , then the file must be copied explicitly
from the computer.The Internet provides a mechanism for such a transfer with the file transfer protocol
(FTP) program.
2. The program then asks the user for a login name and a password. Once the correct information has been
received, the user must connect to the subdirectory.
 get-Transfer a file from the remote machine to the local machine.
 put-Transfer from the local machine to the remote machine.
 ls or dir-List files in the current directory on the remote machine.
 cd -Change the current directory on the remote machine.

Mainly there are two types of network operating systems named as peer-to-peer and client / server.

 Peer-to-peer network operating systems allow users to share resources and files located on their
computers and to access shared resources found on other computers. In a peer-to-peer network, all
computers are considered equal; they all have the same privileges to use the resources available on the
network. Peer-to-peer networks are designed primarily for small to medium local area networks. Windows
for Workgroups is an example of the program that can function as peer-to-peer network operating systems.

 Client/server network operating systems allow the network to centralize functions and applications in
one or more dedicated file servers. The file servers become the heart of the system, providing access to
resources and providing security. The workstations (clients) have access to the resources available on the
file servers. The network operating system allows multiple users to simultaneously share the same
resources irrespective of physical location.

Sr. No. Network Operating System Distributed Operating System


OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

1 A network operating system is made up of A distributed operating system is an


software and associated protocols that ordinary centralized operating system
allow a set of computer network to be used but runs on multiple independent CPUs.
together.

2 Environment users are aware of Environment users are not aware of


multiplicity of machines. multiplicity of machines.

3 Control over file placement is done It can be done automatically by the


manually by the user. system itself.

4 Performance is badly affected if certain part It is more reliable or fault tolerant i.e
of the hardware starts malfunctioning. distributed operating system performs
even if certain part of the hardware
starts malfunctioning.

5 Remote resources are accessed by either Users access remote resources in the
logging into the desired remote machine or same manner as they access local
transferring data from the remote machine resources.
to user's own machines.

Multiprocessor Operating System 
 Multiprocessor Operating System refers to the use of two or more central processing units (CPU)
within a single computer system. These multiple CPUs are in a close communication sharing the
computer bus, memory and other peripheral devices. These systems are referred as tightly coupled
systems.
These types of systems are used when very high speed is required to process a large volume of data.
These systems are generally used in environment like satellite control, weather forecasting
etc.The basic organization of multiprocessing system is shown in fig.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7

 Multiprocessing system is based on the symmetric multiprocessing model, in which each


processor runs an identical copy of operating system and these copies communicate with
each other.
 In this system processor is assigned a specific task. A master processor controls the system.
This scheme defines a master-slave relationship. These systems can save money in
compare to single processor systems because the processors can share peripherals, power
supplies and other devices. The main advantage of multiprocessor system is to get more
work done in a shorter period of time. Moreover, multiprocessor systems prove more
reliable in the situations of failure of one processor. In this situation, the system with
multiprocessor will not halt the system; it will only slow it down.

Multiprocessing operating system or the parallel system support the use of more than one processor in close
communication.
The advantages of the multiprocessing system are:
1. Increased Throughput − By increasing the number of processors, more work can be completed in a
unit time.
2. Cost Saving − Parallel system shares the memory, buses, peripherals etc. Multiprocessor system
thus saves money as compared to multiple single systems. Also, if a number of programs are to
operate on the same data, it is cheaper to store that data on one single disk and shared by all
processors instead of using many copies of the same data.
3. Increased Reliability − In this system, as the workload is distributed among several processors
which results in increased reliability. If one processor fails then its failure may slightly slow down
the speed of the system but system will work smoothly

You might also like