UNIT 3 OS
UNIT 3 OS
Types of Device
There are three main types of devices:
1. Block Device: It stores information in fixed-size block, each one with its own
address. Example, disks.
2. Character Device: It delivers or accepts a stream of characters. the individual
characters are not addressable. For example, printers, keyboards etc.
3. Network Device: It is for transmitting data packets.
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 the operating system is responsible for managing these devices and
establishing the communication between these devices with the computer through their
respective drivers. So the operating system uses its respective drivers and each 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, the operating system is also responsible in keeping track of all these devices which
are connected with the system. If any device requests 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 move 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 the 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 the CPU and for how long. So the
operating system is responsible in assigning the processes to the CPU and it is also
responsible in selecting appropriate processes 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 for 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 the 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 an efficient way without error.
So we use software to access these drivers because we cannot directly access the keyboard,
mouse, printers, scanners, etc. We have to access these devices with the help of software.
Operating systems help 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 a 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.
File Management
Files serve as containers for information, embodying documents, programs, multimedia, and
much more. Efficient file management encompasses a range of crucial tasks, such as creating,
deleting, and renaming files, as well as organizing them within a hierarchical structure.
Whether you’re a casual computer user or a seasoned IT professional, understanding the
principles and mechanisms of file management is essential for maximizing productivity and
ensuring the integrity and availability of your digital files. We will see and discuss different
types of file management in operating system.
What is File Management in OS?
File management in an operating system refers to the set of processes and techniques
involved in creating, organizing, accessing, manipulating, and controlling files stored on
storage devices such as hard drives, solid-state drives, or network storage. It encompasses a
range of tasks and functionalities that ensure efficient handling of files, including their
creation, deletion, naming, classification, and protection.
File management serves as the intermediary layer between applications and the underlying
storage hardware, providing a logical and organized structure for storing and retrieving data.
It involves managing file metadata, which includes attributes such as file name, file size,
creation date, access permissions, ownership, and file type.
Objectives of File Management in Operating System
The main objectives of file management in an operating system (OS) are:
File organization: To provide a logical and efficient way of organizing files and
folders, so that they can be easily located and accessed by users.
Data security: To protect files from unauthorized access, accidental deletion, or
modification and provide a mechanism for data recovery.
Data sharing: To enable multiple users to access and edit the same file
simultaneously or share files with other devices on a network.
File backup: To create copies of important files to prevent data loss in case of
hardware failure or other issues.
File compression: To reduce the size of files to save disk space or to make them
easier to transfer over the internet.
File encryption: To protect files from unauthorized access by encrypting them with
a password or other security measures.
File retrieval: To provide an efficient way of searching and retrieving files based
on keywords, file attributes, or other parameters.
Space management: To manage the storage space efficiently by allocating and
deallocating space as required by the files and folders.
File versioning: To maintain multiple versions of a file, so that previous versions
can be accessed and compared if needed.
File Auditing: To provide a mechanism to trace the files and folder access and
modification history.
Properties of File Management System
File management in an operating system involves the organization, manipulation, and
management of files on a computer’s storage devices. Some key properties of file
management include:
File organization: The way in which files are stored, organized, and accessed on a
storage device. This can include things like file naming conventions, directory
structures, and file metadata.
File access: The ways in which files can be opened, read, written, and closed. This
can include things like permissions and access controls, which determine who can
read and write to a file.
File backup and recovery: The ability to create copies of files for safekeeping,
and to restore them in the event of data loss.
File compression and encryption: The ability to compress and encrypt files to
save space and protect data.
File indexing and search: The ability to search for files based on certain criteria,
such as keywords in the file name or contents, and quickly locate and open them.
File sharing: The ability for multiple users to access and collaborate on the same
files, either locally or over a network.
Functions of File Management in Operating System
The file management function of the operating system includes:
File creation: Creating new files and folders for storing data.
File organization: Organizing files and folders in a logical and efficient manner,
such as grouping related files together in a common folder.
File backup: Creating copies of important files to prevent data loss in case of
hardware failure or other issues.
File search: Finding files quickly and easily by searching for keywords or file
attributes such as date created or file size.
File compression: Reducing the size of files to save disk space or to make them
easier to transfer over the internet.
File encryption: Protect files from unauthorized access by encrypting them with a
password or other security measures.
File sharing: Allowing multiple users to access and edit the same file
simultaneously or share files with other devices on a network.
File deletion: Removing files or folders from the storage device to free up space.
File recovery: Restoring files that have been accidentally deleted or lost due to
system crashes or other issues.
File permissions: Setting access controls for files and folders to determine who can
read, write, or execute them.
Types of File Management in Operating System
There are several types of file management in operating systems, including:
These are some of the commonly used types of file management systems in operating
systems, each with its own strengths and characteristics, catering to different requirements
and use cases.
Advantages of File Management in OS
The advantages of file management in operating system are as follows:
File
Description System Calls / APIs
Operation
File Reduce file sizes to save gzip, zip, tar (Linux systems),
Compression storage space. Compress-Archive (Windows)
2.Direct Access –
Another method is direct access method also known as relative access method. A fixed-
length logical record that allows the program to read and write record rapidly. in no particular
order. The direct access is based on the disk model of a file since disk allows random access
to any file block. For direct access, the file is viewed as a numbered sequence of block or
record. Thus, we may read block 14 then block 59, and then we can write block 17. There is
no restriction on the order of reading and writing for a direct access file.
A block number provided by the user to the operating system is normally a relative block
number, the first relative block of the file is 0 and then 1 and so on.
The single-level directory is the simplest directory structure. In it, all files are contained in
the same directory which makes it easy to support and understand.
A single level directory has a significant limitation, however, when the number of files
increases or when the system has more than one user. Since all the files are in the same
directory, they must have a unique name. If two users call their dataset test, then the unique
name rule is violated.
Advantages:
Since it is a single directory, so its implementation is very easy.
If the files are smaller in size, searching will become faster.
The operations like file creation, searching, deletion, updating are very easy in
such a directory structure.
Logical Organization: Directory structures help to logically organize files and
directories in a hierarchical structure. This provides an easy way to navigate and
manage files, making it easier for users to access the data they need.
Increased Efficiency: Directory structures can increase the efficiency of the file
system by reducing the time required to search for files. This is because directory
structures are optimized for fast file access, allowing users to quickly locate the
file they need.
Improved Security: Directory structures can provide better security for files by
allowing access to be restricted at the directory level. This helps to prevent
unauthorized access to sensitive data and ensures that important files are
protected.
Facilitates Backup and Recovery: Directory structures make it easier to backup
and recover files in the event of a system failure or data loss. By storing related
files in the same directory, it is easier to locate and backup all the files that need to
be protected.
Scalability: Directory structures are scalable, making it easy to add new
directories and files as needed. This helps to accommodate growth in the system
and makes it easier to manage large amounts of data.
Disadvantages:
There may chance of name collision because two files can have the same name.
Searching will become time taking if the directory is large.
This can not group the same type of files together.
2) Two-level directory:
As we have seen, a single level directory often leads to confusion of files names among
different users. The solution to this problem is to create a separate directory for each user.
In the two-level directory structure, each user has their own user files directory (UFD). The
UFDs have similar structures, but each lists only the files of a single user. System’s master
file directory (MFD) is searched whenever a new user id is created.
Disadvantages:
As there is an advantage of security, there is also a disadvantage that the user
cannot share the file with the other users.
Unlike the advantage users can create their own files, users don’t have the ability
to create subdirectories.
Scalability is not possible because one use can’t group the same types of files
together.
Remote file sharing (RFS) is a type of distributed file system technology. It was developed in
1980 by AT&T. Later, it was delivered with UNIX System version V (five) release 3
(SVR3). It enables file and/or data access to multiple remote users over the Internet or a
network connection. It is also known as a general process of providing remote user access to
locally stored files and/or data.
It was relied on the STREAMS Transport Provider Interface feature of the operating system.
To implement remote file system we use client-server model. It was one of the basic
application of Remote File System.
Client-Server Model in RFS :
RFS allows a computer to support one or more file systems from one or more remote
machines. In this case, the machine containing the files is server and the machine wanting
access to the files is the client. The server specifies which file can be accessed by a particular
client(s). Files are usually specified on a partition level.
A server can serve multiple clients, and a client can access multiple servers, depending on the
implementation details of a given client-server facility. Once it is mounted, file operation
requests are sent on the behalf of the user to the server, via network.
For example, a user sends a file open request to the server along with its ID. The server then
check file access to determine if the user has rights to access the file requested mode. This
request is either allowed or denied. If it is allowed, a file is returned to the client application,
and the application then may perform read, write and other operations on file.
After the required operation is performed, the client closes the files.
File protection
Introduction
File protection in an operating system is the process of securing files from unauthorized
access, alteration, or deletion. It is critical for data security and ensures that sensitive
information remains confidential and secure. Operating systems provide various mechanisms
and techniques such as file permissions, encryption, access control lists, auditing, and
physical file security to protect files. Proper file protection involves user authentication,
authorization, access control, encryption, and auditing. Ongoing updates and patches are also
necessary to prevent security breaches. File protection in an operating system is essential to
maintain data security and minimize the risk of data breaches and other security incidents.
What is File protection?
File protection in an operating system refers to the various mechanisms and techniques used
to secure files from unauthorized access, alteration, or deletion. It involves controlling access
to files, ensuring their security and confidentiality, and preventing data breaches and other
security incidents.
Operating systems provide several file protection features, including file permissions,
encryption, access control lists, auditing, and physical file security. These measures allow
administrators to manage access to files, determine who can access them, what actions can be
performed on them, and how they are stored and backed up. Proper file protection requires
ongoing updates and patches to fix vulnerabilities and prevent security breaches. It is crucial
for data security in the digital age where cyber threats are prevalent. By implementing file
protection measures, organizations can safeguard their files, maintain data confidentiality,
and minimize the risk of data breaches and other security incidents.
Type of File protection
File protection is an essential component of modern operating systems, ensuring that files are
secured from unauthorized access, alteration, or deletion. In this context, there are several
types of file protection mechanisms used in operating systems to provide robust data security.
File Permissions − File permissions are a basic form of file protection that controls
access to files by setting permissions for users and groups. File permissions allow the
system administrator to assign specific access rights to users and groups, which can
include read, write, and execute privileges. These access rights can be assigned at the
file or directory level, allowing users and groups to access specific files or directories
as needed. File permissions can be modified by the system administrator at any time
to adjust access privileges, which helps to prevent unauthorized access.
Encryption − Encryption is the process of converting plain text into ciphertext to
protect files from unauthorized access. Encrypted files can only be accessed by
authorized users who have the correct encryption key to decrypt them. Encryption is
widely used to secure sensitive data such as financial information, personal data, and
other confidential information. In an operating system, encryption can be applied to
individual files or entire directories, providing an extra layer of protection against
unauthorized access.
Access Control Lists (ACLs) − Access control lists (ACLs) are lists of permissions
attached to files and directories that define which users or groups have access to them
and what actions they can perform on them. ACLs can be more granular than file
permissions, allowing the system administrator to specify exactly which users or
groups can access specific files or directories. ACLs can also be used to grant or deny
specific permissions, such as read, write, or execute privileges, to individual users or
groups.
Auditing and Logging − Auditing and logging are mechanisms used to track and
monitor file access, changes, and deletions. It involves creating a record of all file
access and changes, including who accessed the file, what actions were performed,
and when they were performed. Auditing and logging can help to detect and prevent
unauthorized access and can also provide an audit trail for compliance purposes.
Physical File Security − Physical file security involves protecting files from physical
damage or theft. It includes measures such as file storage and access control, backup
and recovery, and physical security best practices. Physical file security is essential
for ensuring the integrity and availability of critical data, as well as compliance with
regulatory requirements.
Overall, these types of file protection mechanisms are essential for ensuring data security and
minimizing the risk of data breaches and other security incidents in an operating system. The
choice of file protection mechanisms will depend on the specific requirements of the
organization, as well as the sensitivity and volume of the data being protected. However, a
combination of these file protection mechanisms can provide comprehensive protection
against various types of threats and vulnerabilities.
Advantages of File protection
File protection is an important aspect of modern operating systems that ensures data security
and integrity by preventing unauthorized access, alteration, or deletion of files. There are
several advantages of file protection mechanisms in an operating system, including −
Data Security − File protection mechanisms such as encryption, access control lists,
and file permissions provide robust data security by preventing unauthorized access to
files. These mechanisms ensure that only authorized users can access files, which
helps to prevent data breaches and other security incidents. Data security is critical for
organizations that handle sensitive data such as personal data, financial information,
and intellectual property.
Compliance − File protection mechanisms are essential for compliance with
regulatory requirements such as GDPR, HIPAA, and PCI-DSS. These regulations
require organizations to implement appropriate security measures to protect sensitive
data from unauthorized access, alteration, or deletion. Failure to comply with these
regulations can result in significant financial penalties and reputational damage.
Business Continuity − File protection mechanisms are essential for ensuring business
continuity by preventing data loss due to accidental or malicious deletion, corruption,
or other types of damage. File protection mechanisms such as backup and recovery,
auditing, and logging can help to recover data quickly in the event of a data loss
incident, ensuring that business operations can resume as quickly as possible.
Increased Productivity − File protection mechanisms can help to increase
productivity by ensuring that files are available to authorized users when they need
them. By preventing unauthorized access, alteration, or deletion of files, file
protection mechanisms help to minimize the risk of downtime and data loss incidents
that can impact productivity.
Enhanced Collaboration − File protection mechanisms can help to enhance
collaboration by allowing authorized users to access and share files securely. Access
control lists, file permissions, and encryption can help to ensure that files are only
accessed by authorized users, which helps to prevent conflicts and misunderstandings
that can arise when multiple users access the same file.
Reputation − File protection mechanisms can enhance an organizations reputation by
demonstrating a commitment to data security and compliance. By implementing
robust file protection mechanisms, organizations can build trust with their customers,
partners, and stakeholders, which can have a positive impact on their reputation and
bottom line.
Overall, these advantages of file protection mechanisms highlight the importance of data
security and the need for organizations to implement appropriate measures to protect their
sensitive data. File protection mechanisms can help to prevent data breaches and other
security incidents, ensure compliance with regulatory requirements, and ensure business
continuity in the event of a data loss incident. By implementing a comprehensive file
protection strategy, organizations can enhance productivity, collaboration, and reputation,
while minimizing the risk of data loss and other security incidents.
Disadvantages of File protection
There are also some potential disadvantages of file protection in an operating system,
including −
Overhead − Some file protection mechanisms such as encryption, access control lists,
and auditing can add overhead to system performance. This can impact system
resources and slow down file access and processing times.
Complexity − File protection mechanisms can be complex and require specialized
knowledge to implement and manage. This can lead to errors and misconfigurations
that compromise data security.
Compatibility Issues − Some file protection mechanisms may not be compatible with
all types of files or applications, leading to compatibility issues and limitations in file
usage.
Cost − Implementing robust file protection mechanisms can be expensive, especially
for small organizations with limited budgets. This can make it difficult to achieve full
data protection.
User Frustration − Stringent file protection mechanisms such as complex passwords,
frequent authentication requirements, and restricted access can frustrate users and
impact productivity.