Unit-3 Iinput Output Device Management
Unit-3 Iinput Output Device Management
A computer is a complex system that performs various tasks through the coordination
of different components. Here are the fundamental functional blocks of a typical
computer system:
1. Central Processing Unit (CPU): The CPU is the brain of the computer. It
executes instructions stored in the computer's memory, performs calculations,
and manages data flow within the system.
2. Memory (RAM): Random Access Memory (RAM) is used for temporary data
storage that the CPU can quickly access. It stores data and instructions that are
actively being used by the CPU, providing fast read and write access.
3. Storage: This includes both primary storage (like Hard Disk Drives (HDDs) or
Solid-State Drives (SSDs)) and secondary storage (external drives, optical discs,
etc.). Primary storage is used for long-term data storage, while secondary storage
is often used for backups and additional data.
4. Motherboard: The motherboard is the main circuit board that connects and
facilitates communication between various components, such as the CPU,
memory, storage devices, and peripherals.
5. Input Devices: These are devices that allow users to input data into the
computer, such as keyboards, mice, touchpads, and other pointing devices.
6. Output Devices: These devices display or output information from the computer
to the user, such as monitors, printers, and speakers.
7. Power Supply Unit (PSU): The power supply unit converts electrical power
from an outlet into a form that the computer's components can use.
10. Peripheral Devices: Additional devices that can be connected to the computer,
such as printers, scanners, external drives, and more.
11. System Bus: It is a communication pathway that connects the CPU to other
components on the motherboard, allowing data transfer between them.
I/O Device: The device which are used to give input to the computer is called
input devices.
1. Monitor: It is a device through which we see and operate our software. All icons, text,
and images are displayed here. We see all the outputs on this screen.
2. Printer: It produces hard copies or prints of images, text, or documents on the
computer.
3. Speakers: They yield output in the form of audio and allow users to listen to music,
game sounds, etc. Speakers can be wired and wireless.
4. Projector: It produces output by projecting images and videos on a big screen. When
connected to a computer, the image on the monitor will only be displayed on the screen.
5. Headphones: These devices also produce audio outputs but are only for personal use.
# Input/Output Controller
Input/Output Controller is a component that attaches with each device and is used to accept
input and provide output to these devices. Applications access I/O devices with the help of
these I/O controllers. Thus I/O controller is a peripheral device that enables the main processor
to transfer data between the host system and I/O devices. The I/O controller is a special purpose
processor and are autonomous in nature. Autonomous means that I/O controllers carry out
operations on I/O devices while the main CPU continues to execute programs.. The CPU
controls the activities of an I/O controller by writing into and reading from I/O ports. I/0
controllers have certain registers to store data and control signals. These registers are:
1. The Control register contains that show the functioning of devices i.e. one bit shows
whether the device communicates in half duplex or full duplex mode, another bit shows
party checking and third bit shows the word length of data.
2. The Status register holds bits that show the status of I/O command. These bits indicate
the success, busy or failure status of a command.
3. Input registers contain the input read by the end user.
4. The output registers hold the output written by the host. The program counter holds the
address of next instruction to be executed by the processor.
# Device Driver
Device Driver in computing refers to a special kind of software program or a specific type of
software application that controls a specific hardware device that enables different hardware
devices to communicate with the computer’s Operating System. A device driver communicates
with the computer hardware by computer subsystem or computer bus connected to the
hardware.
Device Drivers are essential for a computer system to work properly because without a device
driver the particular hardware fails to work accordingly, which means it fails in doing the
function/action it was created to do. Most use the term Driver, but some may say Hardware
Driver, which also refers to the Device Driver.
Device Drivers depend upon the Operating System’s instruction to access the device and
perform any particular action. After the action, they also show their reactions by delivering
output or status/message from the hardware device to the Operating system. For example, a
printer driver tells the printer in which format to print after getting instruction from OS,
similarly, A sound card driver is there due to which 1’s and 0’s data of the MP3 file is converted
to audio signals and you enjoy the music. Card reader, controller, modem, network card, sound
card, printer, video card, USB devices, RAM, Speakers, etc need Device Drivers to operate.
The following figure illustrates the interaction between the user, OS, Device driver, and the
devices:
Types of Device Driver:
For almost every device associated with the computer system there exist a Device Driver for
the particular hardware. But it can be broadly classified into two types
This Kernel-mode device driver includes some generic hardware that loads with the operating
system as part of the OS these are BIOS, motherboard, processor, and some other hardware
that are part of kernel software. These include the minimum system requirement device drivers
for each operating system.
o BIOS: BIOS (basic input/output system) is the most basic computer driver in existence.
It is designed to be the first program that boots when a PC turns on. The BIOS is stored
on memory built into the motherboard and is designed to boot the hardware connected
to the PC, including the hard drives, video display output, keyboard and mouse.
o Motherboard Drivers: Motherboard drivers are small programs that are read by either
Windows or Linux and allow for basic computer functions while inside the operating
system. These drivers normally include programs that allow broadband ports, USB
ports and I/O ports for the mouse and keyboard. Depending on the making of the
motherboard, the drivers may also have basic drivers for video and audio support.
o User-mode Device Driver – Other than the devices which are brought by the kernel
for working the system the user also brings some devices for use during the using of a
system that devices need device drivers to function those drivers fall under User mode
device driver. For example, the user needs any plug-and-play action that comes under
this.
Disk storage, also known as disk storage or hard disk storage, refers to the use of magnetic
disks to store digital data persistently. This form of storage is widely used in computers and
other electronic devices due to its relatively low cost, high capacity, and durability. Here's a
brief overview of disk storage:
1. Physical Structure: Disk storage typically consists of one or more rigid disks, made of
metal or glass, coated with a magnetic material. These disks are mounted on a spindle
and enclosed within a protective casing.
2. Read/Write Mechanism: Data is stored on the disk in the form of magnetic patterns.
To read or write data, the disk drive uses a read/write head, which moves across the
disk's surface. When writing data, the head magnetizes tiny regions of the disk to
represent binary information. When reading data, the head detects the magnetic patterns
and converts them back into digital signals.
3. Storage Capacity: Disk storage devices come in various capacities, ranging from a few
gigabytes to several terabytes. The storage capacity depends on factors such as the
number of disks, their rotational speed, data density, and technology advancements.
4. Types of Disk Storage:
• Hard Disk Drives (HDDs): Traditional mechanical disks that use spinning
platters and read/write heads to store and retrieve data. HDDs are known for
their relatively high capacity and affordability.
• Solid State Drives (SSDs): These storage devices use flash memory chips to
store data. SSDs have no moving parts, resulting in faster data access times,
lower power consumption, and greater durability compared to HDDs. However,
SSDs are typically more expensive per gigabyte.
5. Performance: Disk storage performance is influenced by several factors, including:
• Rotational Speed: For HDDs, higher rotational speeds generally result in faster
data access times.
• Data Transfer Rates: This refers to the speed at which data can be read from or
written to the disk.
• Access Times: The time it takes for the read/write head to move to the correct
position on the disk.
• Interface Technology: The interface used to connect the disk storage device to
the computer (e.g., SATA, NVMe) also affects performance.
• Operating System Installation: Disk storage is commonly used to install and run
operating systems like Windows, macOS, and Linux.
• File Storage: It's used to store user files, documents, multimedia content, and
application data.
• Database Management: Disk storage is crucial for storing and retrieving data in
database management systems.
• Application Hosting: Many applications and software programs require disk storage
for installation and data storage.
Despite the emergence of alternative storage technologies such as cloud storage and
solid-state drives, disk storage remains an essential component of modern computing
infrastructure, offering reliable and cost-effective storage solutions for various needs.
A remote file system refers to a system that enables users to access files and
directories stored on a remote server or network-attached storage (NAS) device
over a network. Remote file systems allow users to access their files from any
location with network connectivity, providing flexibility and convenience.
Examples of remote file systems include NFS (Network File System), SMB
(Server Message Block), and FTP (File Transfer Protocol).
File protection in the context of a remote file system involves ensuring the
security and integrity of files during storage, transmission, and access. Here are
some common methods used for file protection in remote file systems:
File management is one of the basic but essential features provided by the operating
system. File management in operating system is nothing but software that manages or handles
the files ( video, audio, docs, pdf, text, etc.) present in computer software. The operating
system’s file system can manage individuals and groups of files present in the computer system.
The operating system’s file system talks to us about the modification time of creation, owner,
location, and state of a file present on the computer system.
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.
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. Files is a collection of co-related information that is recorded in some
format (such as text, pdf, docs, etc.) and is stored on various storage mediums such as flash drives,
hard disk drives (HDD), magnetic tapes, optical disks, and tapes, etc. Files can be read-only or read-
write. Files are simply used as a medium for providing input(s) and getting output(s).
Now, an Operating System is nothing but a software program that acts as an interface between
the hardware, the application software, and the users. The main aim of an operating system is
to manage all the computer resources. So, we can simply say that the operating system gives a
platform to the application software and other system software to perform their task.
# File operation
Create operation: This operation is used to create a file in the file system. It is the most widely
used operation performed on the file system. To create a new file of a particular type the
associated application program calls the file system. This file system allocates space to the file.
As the file system knows the format of directory structure, so entry of this new file is made
into the appropriate directory.
Reading operation: This operation reading the contents from a file. A Reading pointer is
maintained by the OS, pointing to the position up to which the data has been reading.
Writing operation: This operation is used to write the information into a file. A system call
write is issued that specifies the name of the file and the length of the data has to be written to
the file. Whenever the file length is increased by specified value and the file pointer is
repositioned after the last byte written.
Deletion operation: Deleting the file will not only delete all the data stored inside the file it is
also used so that disk space occupied by it is freed. In order to delete the specified file the
directory is searched. When the directory entry is located, all the associated file space and the
directory entry is released.
Truncate operation: Truncating is simply deleting the file except deleting attributes. The file
is not completely deleted although the information stored inside the file gets replaced.
Re-position or Seek operation: The seek system call re-positions the file pointers from the
current position to a specific place in the file i.e. forward or backward depending upon the
user's requirement. This operation is generally performed with those file management systems
that support direct access files.
Append operation: This operation adds data to the end of the file.
Close operation: When the processing of the file is complete, it should be closed so that all
the changes made permanent and all the resources occupied should be released. On closing it
deallocates all the internal descriptors that were created when the file was opened.
Now let us talk about some essential file management functions in operating systems.
• Allows users to modify, create, and delete files on the computer system.
• Operates on and manages a file’s permissions for different users and groups.
• Enables improved visualization by structuring the files like a tree.
• Interface for I/O operations is provided.
• Protects data from hackers and unwanted access.
# File Attributes
1. Name: File name is the name given to the file. A name is usually a string of characters.
2. Identifier: Identifier is a unique number for a file. It identifies files within the file
system. It is not readable to us, unlike file names.
3. Type: Type is another attribute of a file which specifies the type of file such as archive
file (.zip), source code file (.c, .java), .docx file, .txt file, etc.
4. Location: Specifies the location of the file on the device (The directory path). This
attribute is a pointer to a device.
5. Size: Specifies the current size of the file (in Kb, Mb, Gb, etc.) and possibly the
maximum allowed size of the file.
6. Protection: Specifies information about Access control (Permissions about Who can
read, edit, write, and execute the file.) It provides security to sensitive and private
information.
7. Time, date, and user identification: This information tells us about the date and time
on which the file was created, last modified, created and modified by which user, etc.
# Directory Structure And Management
A directory is a container that is used to contain folders and files. It organizes files and folders
in a hierarchical manner.
Following are the logical structures of a directory, each providing a solution to the problem
faced in previous type of directory structure.
1) Single-level directory:
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 violated.
Advantages:
• 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.
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.
Advantages:
• The main advantage is there can be more than two files with same name, and would be
very helpful if there are multiple users.
• A security would be there which would prevent user to access other user’s files.
Disadvantages:
• As there is advantage of security, there is also 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.
This directory structure resembles a real tree upside down, where the root directory is at the
peak. This root contains all the directories for each user. The users can create subdirectories
and even store files in their directory.
A user do not have access to the root directory data and cannot modify it. And, even in this
directory the user do not have access to other user’s directories. The structure of tree directory
is given below which shows how there are files and subdirectories in each user’s directory.
Advantages:
• This directory is more scalable than the other two directory structures explained.
Disadvantages:
• As the user isn’t allowed to access other user’s directory, this prevents the file sharing
among users.
• As the user has the capability to make subdirectories, if the number of subdirectories
increase the searching may become complicated.
• If files do not fit in one, they might have to be fit into other directories.
As we have seen the above three directory structures, where none of them have the capability
to access one file from multiple directories. The file or the subdirectory could be accessed
through the directory it was present in, but not from the other directory.
This problem is solved in acyclic graph directory structure, where a file in one directory can be
accessed from multiple directories. In this way, the files could be shared in between the users.
It is designed in a way that multiple directories point to a particular directory or file with the
help of links.
In the below figure, this explanation can be nicely observed, where a file is shared between
multiple users. If any user makes a change, it would be reflected to both the users.
Advantages:
• Flexibility is increased as file sharing and editing access is there for multiple users.
Disadvantages:
• The user must be very cautious to edit or even deletion of file as the file is accessed by
multiple users.
• If we need to delete the file, then we need to delete all the references of the file inorder
to delete it permanently.