0% found this document useful (0 votes)
11 views

Os 3

Uploaded by

Nitya
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)
11 views

Os 3

Uploaded by

Nitya
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/ 28

Module II

Subject: Operating System


Subject Code : PGCSA102

Department of Computer Science & Applications

Ms Mayuree Katara
Assistant Professor
Department of Computer Science & Applications
PGCSA102 Operating System
3 credits (3-0-0)
Module 1: Introduction- OS Concepts – Evolution of OS, OS Structures- Kernel, Shell, General
Structure of MSDOS, Windows 2000, Difference between ANSI C and C++.Introduction and need of
operating system, layered architecture/logical structure of Operating system, Type of OS, operating
system as resource manager and virtual machine, OS services, BIOS, System Calls/Monitor Calls,
Firmware- BIOS, Boot Strap Loader.
Module 2: Process Management- Process & Threads - Process States - Process Control Block. Process
Scheduling - Operations on Processes, Threads, CPU Scheduler - Preemptive and Non Preemptive;
Dispatcher, Scheduling Criteria, Concurrent Processes, Co-operating Processes, Precedence Graph,
Hierarchy of Processes, Critical Section Problem, Two process solution, Synchronization Hardware,
Semaphores - Deadlock- detection, handling, prevention, avoidance, recovery, Starvation, Critical
Regions, Monitors, Inter process communication.
Module 3: Memory Management - Objectives and functions, Simple Resident Monitor Program (No
design), Overlays - Swapping; Schemes - Paging - Simple, Multi-level Paging; Internal and External
Fragmentation; Virtual Memory Concept, Demand Paging - Page Interrupt Fault, Page Replacement
Algorithms; Segmentation - Simple, Multi-level, Segmentation with Paging, Cache Memory.
Module 4: Inter Process Communication: Virtual Memory-Concept, virtual address space, paging
scheme, pure segmentation and segmentation with paging scheme hardware support and implementation
details, memory fragmentation,
Overview of IPC Methods, Pipes, popen, pclose Functions, Coprocesses, FTFOs, System VIPC,
Message Queues, Semaphores, Interprocess Communication
Shared Memory, Client-Server Properties, Stream Pipes, Passing File Descriptors, An Open Server-
Version 1, Client-Server Connection Functions.
Module 5: Information Management- Files and Directories - Directory Structure Directory
Implementation - Linear List - Hash Table. Device Management: Dedicated, Shared and Virtual Devices -
Serial Access Devices, Direct Access Devices, Direct Access Storage Devices Channels and Control
Modules -- Disk Scheduling methods.
Text Books:
1. Operating Systems Concepts – Silberschatz, Galvin, Wiley Publications (2008)
2. Modern Operating Systems - Andrew S. Tenenbaum, Pearson Education Asia / PHI (2005)
3. Operating Systems – William Stallings, Pearson Education Asia (2002)
Reference Books:
1. UNIX System Programming Using C++,by Terrence Chan: Prentice Hall India, 1999.
2. Advanced Programming in UNIX Environment, by W. Richard Stevens: 2nd Ed, Pearson Education,
2005.
Module 5: Information Management- Files and Directories - Directory Structure Directory
Implementation - Linear List - Hash Table. Device Management: Dedicated, Shared and Virtual
Devices - Serial Access Devices, Direct Access Devices, Direct Access Storage Devices Channels
and Control Modules -- Disk Scheduling methods.

5.1 Files and Directories- Directory Structure and Directory Implementation - Linear List -
Hash Table

5.2 Device Management-Dedicated, Shared and Virtual Devices


5.3 Serial Access Devices, Direct Access Devices, Direct Access Storage Devices
5.4 Channels and Control Modules -- Disk Scheduling methods.
5.1 Files and Directories- Directory Structure and Directory Implementation - Linear List -
Hash Table
Files- A computer file is defined as a medium used for saving and managing data in the computer
system. The data stored in the computer system is completely in digital format, although there
can be various types of files that help us to store the data.

File systems are a crucial part of any operating system, providing a structured way to store,
organize, and manage data on storage devices such as hard drives, SSDs, and USB drives.
Essentially, a file system acts as a bridge between the operating system and the physical storage
hardware, allowing users and applications to create, read, update, and delete files in an organized
and efficient manner.
What is a File System?
A file system is a method an operating system uses to store, organize, and manage files and
directories on a storage device. Some common types of file systems include:
 FAT (File Allocation Table): An older file system used by older versions of Windows and
other operating systems.
 NTFS (New Technology File System): A modern file system used by Windows. It supports
features such as file and folder permissions, compression, and encryption.
 ext (Extended File System): A file system commonly used on Linux and Unix-based
operating systems.
 HFS (Hierarchical File System): A file system used by macOS.
 APFS (Apple File System): A new file system introduced by Apple for their Macs and iOS
devices.
A file is a collection of related information that is recorded on secondary storage. Or file is a
collection of logically related entities. From the user’s perspective, a file is the smallest allotment
of logical secondary storage.
The name of the file is divided into two parts as shown below:
 Name
 Extension, separated by a period.
Issues Handled By File System
We’ve seen a variety of data structures where the file could be kept. The file system’s job is to
keep the files organized in the best way possible.
A free space is created on the hard drive whenever a file is deleted from it. To reallocate them to
other files, many of these spaces may need to be recovered. Choosing where to store the files on
the hard disc is the main issue with files one block may or may not be used to store a file. It may
be kept in the disk’s non-contiguous blocks. We must keep track of all the blocks where the files
are partially located.
Files Attributes And Their Operations

Attributes Types Operations

Name Doc Create

Type Exe Open

Size Jpg Read

Creation Data Xis Write

Author C Append

Last Modified Java Truncate

protection class Delete

File type Usual extension Function

Read to run machine language


Executable exe, com, bin
program

Compiled, machine language


Object obj, o
not linked

Source code in various


Source Code C, java, pas, asm, a
languages
File type Usual extension Function

Commands to the command


Batch bat, sh
interpreter

Text txt, doc Textual data, documents

Various word processor


Word Processor wp, tex, rrf, doc
formats

Related files grouped into one


Archive arc, zip, tar
compressed file

For containing audio/video


Multimedia mpeg, mov, rm
information

It is the textual data and


Markup xml, html, tex
documents

It contains libraries of
Library lib, a ,so, dll
routines for programmers

It is a format for printing or


Print or View gif, pdf, jpg viewing an ASCII or binary
file.

File Directories
The collection of files is a file directory. The directory contains information about the files,
including attributes, location, and ownership. Much of this information, especially that is
concerned with storage, is managed by the operating system. The directory is itself a file, accessible
by various file management routines.
Below are information contained in a device directory.
 Name
 Type
 Address
 Current length
 Maximum length
 Date last accessed
 Date last updated
 Owner id
 Protection information
The operation performed on the directory are:
 Search for a file
 Create a file
 Delete a file
 List a directory
 Rename a file
 Traverse the file system
Advantages of Maintaining Directories
 Efficiency: A file can be located more quickly.
 Naming: It becomes convenient for users as two users can have same name for different
files or may have different name for same file.
 Grouping: Logical grouping of files can be done by properties e.g. all java programs, all
games etc.
Directory Structures-
Single-Level Directory
In this, a single directory is maintained for all the users.
 Naming Problem: Users cannot have the same name for two files.
 Grouping Problem: Users cannot group files according to their needs.
Two-Level Directory
In this separate directories for each user is maintained.
 Path Name: Due to two levels there is a path name for every file to locate that file.
 Now, we can have the same file name for different users.
 Searching is efficient in this method.

Tree-Structured Directory
The directory is maintained in the form of a tree. Searching is efficient and also there is grouping
capability. We have absolute or relative path name for a file.
File Allocation Methods
There are several types of file allocation methods. These are mentioned below.
 Continuous Allocation
 Linked Allocation(Non-contiguous allocation)
 Indexed Allocation
Continuous Allocation
A single continuous set of blocks is allocated to a file at the time of file creation. Thus, this is a
pre-allocation strategy, using variable size portions. The file allocation table needs just a single
entry for each file, showing the starting block and the length of the file. This method is best from
the point of view of the individual sequential file. Multiple blocks can be read in at a time to
improve I/O performance for sequential processing. It is also easy to retrieve a single block. For
example, if a file starts at block b, and the ith block of the file is wanted, its location on secondary
storage is simply b+i-1.
Disadvantages of Continuous Allocation
 External fragmentation will occur, making it difficult to find contiguous blocks of space of
sufficient length. A compaction algorithm will be necessary to free up additional space on
the disk.
 Also, with pre-allocation, it is necessary to declare the size of the file at the time of creation.
Linked Allocation(Non-Contiguous Allocation)
Allocation is on an individual block basis. Each block contains a pointer to the next block in the
chain. Again the file table needs just a single entry for each file, showing the starting block and the
length of the file. Although pre-allocation is possible, it is more common simply to allocate blocks
as needed. Any free block can be added to the chain. The blocks need not be continuous. An
increase in file size is always possible if a free disk block is available. There is no
external fragmentation because only one block at a time is needed but there can be internal
fragmentation but it exists only in the last disk block of the file.

Disadvantage Linked Allocation(Non-contiguous allocation)


 Internal fragmentation exists in the last disk block of the file.
 There is an overhead of maintaining the pointer in every disk block.
 If the pointer of any disk block is lost, the file will be truncated.
 It supports only the sequential access of files.

Indexed Allocation
It addresses many of the problems of contiguous and chained allocation. In this case, the file
allocation table contains a separate one-level index for each file: The index has one entry for each
block allocated to the file. The allocation may be on the basis of fixed-size blocks or variable-
sized blocks. Allocation by blocks eliminates external fragmentation, whereas allocation by
variable-size blocks improves locality. This allocation technique supports both sequential and
direct access to the file and thus is the most popular form of file allocation.
Disk Free Space Management
Just as the space that is allocated to files must be managed, so the space that is not currently
allocated to any file must be managed. To perform any of the file allocation techniques, it is
necessary to know what blocks on the disk are available. Thus we need a disk allocation table in
addition to a file allocation table. The following are the approaches used for free space
management.
 Bit Tables: This method uses a vector containing one bit for each block on the disk. Each
entry for a 0 corresponds to a free block and each 1 corresponds to a block in use.
For example 00011010111100110001
In this vector every bit corresponds to a particular block and 0 implies that that particular
block is free and 1 implies that the block is already occupied. A bit table has the advantage
that it is relatively easy to find one or a contiguous group of free blocks. Thus, a bit table
works well with any of the file allocation methods. Another advantage is that it is as small
as possible.
 Free Block List: In this method, each block is assigned a number sequentially and the list
of the numbers of all free blocks is maintained in a reserved block of the disk.

Advantages of File System


 Organization: A file system allows files to be organized into directories and subdirectories,
making it easier to manage and locate files.
 Data Protection: File systems often include features such as file and folder
permissions, backup and restore, and error detection and correction, to protect data from
loss or corruption.
 Improved Performance: A well-designed file system can improve the performance of
reading and writing data by organizing it efficiently on disk.
Disadvantages of File System
 Compatibility Issues: Different file systems may not be compatible with each other,
making it difficult to transfer data between different operating systems.
 Disk Space Overhead: File systems may use some disk space to store metadata and other
overhead information, reducing the amount of space available for user data.
 Vulnerability: File systems can be vulnerable to data corruption, malware, and other
security threats, which can compromise the stability and security of the system.

Directory Implementation - Linear List - Hash Table


Directory implementation in the operating system can be done using Singly Linked List and
Hash table. The efficiency, reliability, and performance of a file system are greatly affected by
the selection of directory-allocation and directory-management algorithms. There are numerous
ways in which the directories can be implemented. But we need to choose an appropriate
directory implementation algorithm that enhances the performance of the system.
Directory Implementation using Singly Linked List
The implementation of directories using a singly linked list is easy to program but is time-
consuming to execute. Here we implement a directory by using a linear list of filenames with
pointers to the data blocks.

Directory Implementation Using Singly Linked List


 To create a new file the entire list has to be checked such that the new directory does not
exist previously.
 The new directory then can be added to the end of the list or at the beginning of the list.
 In order to delete a file, we first search the directory with the name of the file to be deleted.
After searching we can delete that file by releasing the space allocated to it.
 To reuse the directory entry we can mark that entry as unused or we can append it to the list
of free directories.
 To delete a file linked list is the best choice as it takes less time.
Disadvantage
The main disadvantage of using a linked list is that when the user needs to find a file the user
has to do a linear search. In today’s world directory information is used quite frequently and
linked list implementation results in slow access to a file. So the operating system maintains a
cache to store the most recently used directory information.
Directory Implementation using Hash Table
An alternative data structure that can be used for directory implementation is a hash table. It
overcomes the major drawbacks of directory implementation using a linked list. In this method,
we use a hash table along with the linked list. Here the linked list stores the directory entries,
but a hash data structure is used in combination with the linked list.
In the hash table for each pair in the directory key-value pair is generated. The hash function
on the file name determines the key and this key points to the corresponding file stored in the
directory. This method efficiently decreases the directory search time as the entire list will not
be searched on every operation. Using the keys the hash table entries are checked and when the
file is found it is fetched.

Directory Implementation Using Hash Table


Disadvantage:
The major drawback of using the hash table is that generally, it has a fixed size and its
dependency on size. But this method is usually faster than linear search through an entire
directory using a linked list.
5.2 Device Management-Dedicated, Shared and Virtual Devices
Device Management-Device Administration within An operating system controls every piece of
hardware and virtual device on a PC or computer. Input/output devices are assigned to processes
by the device management system based on their importance. Depending on the situation, these
devices may also be temporarily or permanently reallocated.

Usually, systems are hardware or physical devices like computers, laptops, servers, cell phones,
etc. Additionally, they might be virtual, like virtual switches or machines. A program may require
a variety of computer resources (devices) to go through to the end. It is the operating system’s
responsibility to allocate resources wisely. The operating system is alone in charge of determining
if the resource is available. It deals not only with device allocation but also with deallocation, which
means that a device or resource must be removed from a process once its use is over.
Functions of Device Management
 Keeps track of all devices and the program that is responsible for performing this is called
the I/O controller.
 Monitoring the status of each device such as storage drivers, printers, and other peripheral
devices.
 Enforcing preset policies and making a decision on which process gets the device when and
for how long.
 Allocates and deallocates the device efficiently.
Types of Device Management
There are three main types of devices:
 Boot Device: It stores information in a fixed-size block, each one with its own address.
Example, disks.
 Character Device: It delivers or accepts a stream of characters. the individual characters
are not addressable. For example, printers, keyboards etc.
 Network Device: It is for transmitting data packets.
Features of Device Management in Operating System
 The operating system is responsible in managing device communication through their
respective drivers.
 The operating system keeps track of all devices by using a program known as an input-
output controller.
 It decides which process to assign to CPU and for how long.
 O.S. is responsible in fulfilling the request of devices to access the process.
 It connects the devices to various programs in an efficient way without error.
 Deallocate devices when they are not in use.
Types of Devices
1. Dedicated Device
Certain devices are assigned to only one task at a time in device management until that task releases
them. Plotters, printers, tape drives, and other similar devices require this kind of allocation method
because sharing them with numerous users at the same time will be inconvenient. The drawback
of these devices is the inefficiency that results from assigning the device to a single user throughout
the entirety of the task execution process, even in cases when the device is not utilized exclusively.
2. Shared Device
There are numerous processes that these devices could be assigned to. Disk-DASD could be shared
concurrently by many processes by interleaving their requests. All issues must be resolved by pre-
established policies, and the Device Manager closely monitors the interleaving.
3. Virtual Device
Virtual devices are dedicated devices that have been converted into shared devices, making them
a hybrid of the two types of devices. For instance, a spooling programme that routes all print
requests to a disc can turn a printer into a sharing device. A print job is routed to the disc and not
delivered straight to the printer until it is ready with all the necessary formatting and sequencing,
at which time it is sent to the printers. The method can increase usability and performance by
turning a single printer into a number of virtual printers.
What are the Various Techniques for Accessing a Device?
 Polling: In this instance, a CPU keeps an eye on the status of the device to share data. Busy-
waiting is a drawback, but simplicity is a plus. In this scenario, when an input/output
operation is needed, the computer simply keeps track of the I/O device’s status until it’s
ready, at which time it is accessed. Stated differently, the computer waits for the device to
be ready.
 Interrupt-Driven I/O: Notifying the associated driver of the device’s availability is the
device controller’s job. One interrupt for each keyboard input results in slower data copying
and movement for character devices, but the advantages include more effective use of CPU
cycles. A block of bytes is created from a serial bit stream by a device controller. It also
does error correction if needed. It consists of two primary parts: a data buffer that an
operating system can read or write to, and device registers for communication with the CPU.
 DMA(Direct Memory Access) : Data motions are carried out by using a second controller.
This approach has the benefit of not requiring the CPU to duplicate data, but it also has the
drawback of preventing a process from accessing data that is in transit.
 Double Buffering: This mode of access has two buffers. One fills up while the other is
utilised, and vice versa. In order to hide the line-by-line scanning from the viewer, this
technique is frequently employed in animation and graphics.
Device Drivers
Operating system is responsible for managing device communication through their respective
drivers. As we know that the operating system will have many devices like the mouse, printer, and
scanner and operating system is responsible for managing these devices and establishing the
communication between these devices with the computer through their respective drivers. So
operating system uses its respective drivers each and every device will have its own driver. Without
the use of their respective driver, that device cannot make communication with other systems.
Device Tracking
Operating system keeps track of all devices by using a program known as input output controller.
Apart from allowing the system to make the communication between these drivers operating
system is also responsible in keeping track all these devices which are connected with the system.
If any device request any process which is under execution by the CPU then the operating system
has to send a signal to the CPU to immediately release that process and moves to the next process
from the main memory so that the process which is asked by the device fulfills the request of this
device. That’s why operating system has to continuously keep on checking the status of all the
devices and for doing that operating system uses a specialized program which is known
as Input/Output controller.
Process Assignment
Operating system decides which process to assign to CPU and for how long. So operating system
is responsible in assigning the processes to the CPU and it is also responsible in selecting
appropriate process from the main memory and setting up the time for that process like how long
that process needs to get executed inside the CPU. Operating system is responsible in fulfilling the
request of devices to access the process. If the printer requests for the process which is now getting
executed by the CPU then it is the responsibility of the operating system to fulfill that request. So
what operating system will do is it will tell the CPU that you need to immediately release that
process which the device printer is asking for and assign it to the printer.
Connection
Operating system connects the devices to various programs in efficient way without error. So we
use software to access these drivers because we cannot directly access to keyboard, mouse, printers,
scanners, etc. We have to access these devices with the help of software. Operating system helps
us in establishing an efficient connection with these devices with the help of various software
applications without any error.
Device Allocation
Device allocation refers to the process of assigning specific devices to processes or users. It ensures
that each process or user has exclusive access to the required devices or shares them efficiently
without interference.
Device Deallocation
Operating system deallocates devices when they are no longer in use. When these drivers or devices
are in use, they will be using certain space in the memory so it is the responsibility of the operating
system to continuously keep checking which device is in use and which device is not in use so that
it can release that device if we are no longer using that device.

5.3 Serial Access Devices, Direct Access Devices, Direct Access Storage Devices

A serial access storage device can be characterized as one that relies on strictly physical sequential

positioning and accessing of information. A Magnetic Tape Unit (MTU) is the most common example of

a serial access storage device. It is based on same principle as the audio tape desk or tape cassette. A

typical serial access device is depicted in Figure 1

Information is usually stored as groups of bytes, called records, rather than single bytes. A record

can be of arbitrary length, e.g., from 1 to 32,768 bytes long. Each record can be identified by its
physical position on the tape; the first record is 1, the second is 2, and so on. In order to help

establish groupings of records on a tape, there is a special record type called a tape mark.

Typical characteristics of tape units are:

Density- 1600 bytes per inch(19,200 bytes per foot)


Speed- 200 inches per second (16 2/3 feet per second)
Length- 2400 feet long(i.e., capacity is about 46,000,000 bytes)
Maximum access = 2 minutes
Random (average) access = 1 minute
Serial access (at one record read the next) ~ 4ms
The Inter-record Gap(IRG is necessary due to the physical limitations of starting and stopping a
tape. To minimize gap waste, block records are used. Blocking is placing multiple logical records
into one physical record(a block). Blocks are typically 800 to 8000 bytes long.
There are three major advantages to blocking:
1. Each I/O operations reads or writes multiple logical records at a time.
2. There is less wasted space
3. Smaller tape space is covered when reading many records
There are also three major disadvantages:
1. Software overhead and routines are required to do the blocking, deblocking, and record
keeping.
2. Buffer space is wasted.
3. There is more likelihood of tape errors since long records are being read.
COMPLETELY DIRECT ACCESS DEVICES
A completely direct access device is one in which the access time Tij is a constant. Magnetic core
memory, semiconductor memory, read-only wired memories, and diode matrix memories are all
examples of completely direct access memories.
DIRECT ACCESS STORAGE DEVICES

A direct-access storage device (DASD) is another name for secondary storage devices that store data in
discrete locations with a unique address, such as hard disk drives, optical drives and most magnetic storage
devices.

1. Magnetic disks: A magnetic disk is a storage device that uses a magnetization process to write, rewrite
and access data. It is covered with a magnetic coating and stores data in the form of tracks, spots and
sectors. Hard disks, zip disks and floppy disks are common examples of magnetic disks.
i. Floppy Disk: A floppy disk is a flexible disk with a magnetic coating on it, and it is packaged inside
a protective plastic envelope. These are among the oldest portable storage devices that could store
up to 1.44 MB of data, but now they are not used due to very little memory storage.
ii. Hard Disk Drive (HDD): Hard disk drive comprises a series of circular disks
called platters arranged one over the other almost ½ inches apart around a spindle. Disks are made
of non-magnetic material like aluminium alloy and coated with 10-20 nm magnetic material. The
standard diameter of these disks is 14 inches, and they rotate with speeds varying from 4200 rpm
(rotations per minute) for personal computers to 15000 rpm for servers.
Data is stored by magnetizing or demagnetizing the magnetic coating. A magnetic reader arm is
used to read data from and write data to the disks. A typical modern HDD has a capacity in terabytes
(TB).

2. Optical Disk: An optical disk is any computer disk that uses optical storage techniques and technology
to read and write data. It is a computer storage disk that stores data digitally and uses laser beams to read
and write data

i. CD Drive: CD stands for Compact Disk. CDs are circular disks that use optical rays, usually lasers,
to read and write data. They are very cheap as you can get 700 MB of storage space for less than a
dollar. CDs are inserted in CD drives built into the CPU cabinet. They are portable as you can eject
the drive, remove the CD and carry it with you. There are three types of CDs:
o CD-ROM (Compact Disk - Read Only Memory): The manufacturer recorded the data on
these CDs. Proprietary Software, audio or video are released on CD-ROMs.
o CD-R (Compact Disk - Recordable): The user can write data once on the CD-R. It cannot
be deleted or modified later.
o CD-RW (Compact Disk - Rewritable): Data can repeatedly be written and deleted on
these optical disks.
ii. DVD Drive: DVD stands for digital video display. DVD is an optical device that can store 15 times
the data held by CDs. They are usually used to store rich multimedia files that need high storage
capacity. DVDs also come in three varieties - read-only, recordable and rewritable.
iii. Blu Ray Disk: Blu Ray Disk (BD) is an optical storage media that stores high definition (HD) video
and other multimedia files. BD uses a shorter wavelength laser than CD/DVD, enabling the writing
arm to focus more tightly on the disk and pack in more data. BDs can store up to 128 GB of data.

3. Memory Storage Devices: A memory device contains trillions of interconnected memory cells that store
data. When switched on or off, these cells hold millions of transistors representing 1s and 0s in binary code,
allowing a computer to read and write information. It includes USB drives, flash memory devices, SD and
memory cards, which you'll recognize as the storage medium used in digital cameras.

i. Flash Drive: A flash drive is a small, ultra-portable storage device. USB flash drives were essential
for easily moving files from one device to another. Flash drives connect to computers and other
devices via a built-in USB Type-Aor USB-C plug, making one a USB device and cable
combination.
Flash drives are often referred to as pen drives, thumb drives, or jump drives. The terms USB
drive and solid-state drive (SSD) are also sometimes used, but most of the time, those refer to larger,
not-so-mobile USB-based storage devices like external hard drives.
These days, a USB flash drive can hold up to 2 TB of storage. They're more expensive per gigabyte
than an external hard drive, but they have prevailed as a simple, convenient solution for storing and
transferring smaller files.
Pen drive has the following advantages in computer organization, such as:
o Transfer Files: A pen drive is a device plugged into a USB port of the system that is used
to transfer files, documents, and photos to a PC and vice versa.
o Portability: The lightweight nature and smaller size of a pen drive make it possible to carry
it from place to place, making data transportation an easier task.
o Backup Storage:Most of the pen drives now come with the feature of having password
encryption, important information related to family, medical records, and photos can be
stored on them as a backup.
o Transport Data: Professionals or Students can now easily transport large data files and
video, audio lectures on a pen drive and access them from anywhere. Independent PC
technicians can store work-related utility tools, various programs, and files on a high-speed
64 GB pen drive and move from one site to another.
ii. Memory card: A memory cardor memory cartridge is an electronic data storage device used for
storing digital information, typically using flash memory. These are commonly used in portable
electronic devices, such as digital cameras, mobile phones, laptop computers, tablets, PDAs,
portable media players, video game consoles, synthesizers, electronic keyboards and digital pianos,
and allow adding memory to such devices without compromising ergonomy, as the card is usually
contained within the device rather than protruding like USB flash drives.
5.4 Channels and Control Modules -- Disk Scheduling methods-
On a typical multiprogramming system, there will usually be multiple disk access requests at any
point of time. So those requests must be scheduled to achieve good efficiency. Disk scheduling is
similar to process scheduling. Some of the disk scheduling algorithms are described below.

First Come First Serve

This algorithm performs requests in the same order asked by the system. Let’s take an example
where the queue has the following requests with cylinder numbers as follows:

98, 183, 37, 122, 14, 124, 65, 67

Assume the head is initially at cylinder 56. The head moves in the given order in the queue
i.e., 56→98→183→…→67.
Shortest Seek Time First (SSTF)

Here the position which is closest to the current head position is chosen first. Consider the
previous example where disk queue looks like,

98, 183, 37, 122, 14, 124, 65, 67

Assume the head is initially at cylinder 56. The next closest cylinder to 56 is 65, and then the
next nearest one is 67, then 37, 14, so on.

SCAN algorithm

This algorithm is also called the elevator algorithm because of it’s behavior. Here, first the head
moves in a direction (say backward) and covers all the requests in the path. Then it moves in the
opposite direction and covers the remaining requests in the path. This behavior is similar to that
of an elevator. Let’s take the previous example,

98, 183, 37, 122, 14, 124, 65, 67


Assume the head is initially at cylinder 56. The head moves in backward direction and
accesses 37 and 14. Then it goes in the opposite direction and accesses the cylinders as they come
in the path.

You might also like