0% found this document useful (0 votes)
2K views19 pages

Unit 3 & 4 Os

This document provides information about input/output (I/O) device management in operating systems. It discusses how device drivers interface between operating systems and physical devices like keyboards, printers, and network adapters. It also describes different types of directory structures for organizing files, including single-level, two-level, and tree/hierarchical directories, and discusses their advantages and disadvantages. The document is from an operating systems class covering I/O device management and file management topics.

Uploaded by

AKG YOUTUBE
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)
2K views19 pages

Unit 3 & 4 Os

This document provides information about input/output (I/O) device management in operating systems. It discusses how device drivers interface between operating systems and physical devices like keyboards, printers, and network adapters. It also describes different types of directory structures for organizing files, including single-level, two-level, and tree/hierarchical directories, and discusses their advantages and disadvantages. The document is from an operating systems class covering I/O device management and file management topics.

Uploaded by

AKG YOUTUBE
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/ 19

BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.

in

CLASS: BCA4thSem/BSC IT 2nd Sem


BATCH:

SUBJECT: OPERATING SYSTEMS

Notes as per IKGPTU Syllabus

NAME OF FACULTY: --AARIF KHAN

FACULTY OF COMPUTER & IT, SBS COLLEGE. LUDHIANA

SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in

UNIT-III

I/O DEVICE MANAGEMENT


One of the important jobs of an Operating System is to manage various I/O
devices including mouse, keyboards, touch pad, disk drives, display adapters,
USB devices, Bit-mapped screen, LED, Analog-to-digital converter, On/off
switch, network connections, audio I/O, printers etc.
An I/O system is required to take an application I/O request and send it to the
physical device, then take whatever response comes back from the device and
send it to the application

Device Controllers
Device drivers are software modules that can be plugged into an OS to handle a
particular device. Operating System takes help from device drivers to handle all
I/O devices.
The Device Controller works like an interface between a device and a device
driver. I/O units (Keyboard, mouse, printer, etc.) typically consist of a
mechanical component and an electronic component where electronic
component is called the device controller.
There is always a device controller and a device driver for each device to
communicate with the Operating Systems. A device controller may be able to
handle multiple devices. As an interface its main task is to convert serial bit
stream to block of bytes, perform error correction as necessary.
Any device connected to the computer is connected by a plug and socket, and
the socket is connected to a device controller. Following is a model for

SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in

connecting the CPU, memory, controllers, and I/O devices where CPU and
device controllers all use a common bus for communication.
What is a device driver?
A device driver is a special kind of software program that controls a specific
hardware device attached to a computer. Device drivers are essential for a
computer to work properly.

These programs may be compact, but they provide the all-important means for a
computer to interact with hardware, for everything from mouse, keyboard and
display -- user input/output -- to working with networks, storage and graphics.

How do device drivers work?


Device drivers generally run at a high level of privilege within the operating
system (OS) runtime environment. Some device drivers, in fact, may be linked
directly to the operating system kernel, a portion of an OS such
as Windows, Linux or macOS that remains memory resident and handles
execution for all other code including device drivers. Device drivers relay
requests for device access and actions from the operating system and its active
applications to their respective hardware devices. They also deliver outputs or
status/messages from the hardware devices to the operating system and thus to
applications.

Purpose of device drivers


Device drivers are necessary to permit a computer to interface and interact with
specific devices. They define the messages and mechanisms whereby the
computer -- the OS and applications -- can access the device or make requests
for the device to fulfill. They also handle device responses and messages for
delivery to the computer.

SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in

Disk storage (also sometimes called drive storage) is a general category of


storage mechanisms where data is recorded by various electronic, magnetic,
optical, or mechanical changes to a surface layer of one or more rotating disks.
A disk drive is a device implementing such a storage mechanism. Notable
types are the hard disk drive (HDD) containing a non-removable disk,
the floppy disk drive (FDD) and its removable floppy disk, and various optical
disc drives (ODD) and associated optical disc media.

File Management in Operating System


Overview

File management is one of the basic but important features provided by the
operating system. File management in operating system is nothing but software
that handles or manages the files (binary, text, pdf, docs, audio, video, etc.)
present in computer software. The file system in the operating system is capable
of managing individual as well as groups of files present in the computer
system. The file system in operating system tells us about the location, owner,
time of creation and modification, type, and state of a file present on the
computer system.

What is Directory?
On a computer, a directory is used to store, arrange, and segregate files and
folders. It is similar to a telephone directory in that it just contains lists of
names, phone numbers, and addresses rather than the real papers. It uses a
hierarchical structure to organize files and directories. On many computers,
directories are referred to as drawers or folders, much like a workbench or a
standard filing cabinet in an office. You may, for instance, create a directory for
images and another for all of your documents. You could easily access the type
of file you wanted to see by saving particular file types in a folder.

SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in

Types of Directory Structures:-


 Single level directory
 Two-level directory
 Tree structure or hierarchical directory

Single level directory

It is the simplest directory structure. In a single-level directory, there is only one


directory in the system, meaning there is only one folder, and all the files are
stored in that single directory. There is no way to segregate important files from
non-important files.

Implementation of a single-level directory is the simplest. However, there are


various disadvantages of it.
The pictorial representation of a single-level directory is given below. There is
only one directory (root directory), and all the files are stored in the same

SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in

directory. Here f1, f2, f3, f4, f5 represent the five different files. Practically it
can be thought of as a structure where all the files are stored in the same folder.
Advantages of single-level directory
 The main advantage of a single-level directory is that it is very simple to
implement.
 Since all the files are present in the same directory, in case the number of
files is less, then searching for a particular file is faster and easier.
 Simple operations like file creation, search, deletion, and updating are
possible with a single-level directory structure.
 The single-level directory is easier to understand in practical life.
Disadvantages of single-level directory
 In case we want to organize the files in some groups, it is not possible to
do so since we cannot create subdirectories.
 Two file names cannot be the same. In case two files are given the same
name, the previous one is overridden.
 If the number of files is very large, searching a particular file is very
inefficient.
 Segregation of important and unimportant files is not possible.
 The single-level directory is not useful for multi-user systems.

Two-level directory
We saw how the single-level directory proves to be inefficient if multiple users
are accessing the system. If two different users wanted to create a file with the
same name (say report.doc), it was not allowed in a single level directory.
In a two-level directory structure, there is a master node that has a separate
directory for each user. Each user can store the files in that directory. It can be
practically thought of as a folder that contains many folders, each for a
particular user, and now each user can store files in the allocated directory just
like a single level directory.
The pictorial representation of a two-level directory is shown below. For every
user, there is a separate directory. At the next level, every directory stores the
files just like a single-level directory. Although not very efficient, the two-level
directory is better than a single-level directory structure.

SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in

Advantages of two-level directory


 Searching is very easy.
 There can be two files with the same name in two different user
directories. Since they are not in the same directory, the same name can be
used.
 Grouping is easier.
 A user cannot enter another user’s directory without permission.
 Implementation is easy.
Disadvantages of two-level directory
 One user cannot share a file with another user.
 Even though it allows multiple users, still a user cannot keep two same
type files in a user directory.
 It does not allow users to create subdirectories.

Tree-structured directory or Hierarchical directory


This type of directory is used in our PCs. The biggest disadvantage of a two-
level directory was that one could not create sub-directories in a directory. The
tree-structured directory solved this problem. In a tree-structured directory,
there is a root directory at the peak. The root directory contains directories for

SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in

each user. The users can, however, create subdirectories inside their directory
and also store the files.
This is how things work on our PCs. We can store some files inside a folder and
also create multiple folders inside a folder.
The pictorial representation of a tree-structured directory is shown below. The
root directory is highly secured, and only the system administrator can access it.
We can see how there can be subdirectories inside the user directories. A user
cannot modify the root directory data. Also, a user cannot access another user's
directory.

Introduction to Remote File Systems

Remote file systems enable an application that runs on a client computer to


access files stored on a different computer. Remote file systems also often make
other resources (remote printers, for example) accessible from a client
computer. The remote file and resource access takes place using some form of
local area network (LAN), wide area network (WAN), point-to-point link, or
other communication mechanism. These file systems are often referred as
network file systems or distributed file systems.

SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in

What is File Protection?


Windows File Protection (WFP) prevents programs from replacing critical
Windows system files. Programs must not overwrite these files because they are
used by the operating system and by other programs. Protecting these files
prevents problems with programs and the operating system.

SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in

UNIT-IV

Distributed Operating System


A distributed operating system (DOS) is an essential type of operating system.
Distributed systems use many central processors to serve multiple real-time
applications and users. As a result, data processing jobs are distributed between
the processors.

It connects multiple computers via a single communication channel.


Furthermore, each of these systems has its own processor and memory.
Additionally, these CPUs communicate via high-speed buses or telephone lines.
Individual systems that communicate via a single channel are regarded as a
single entity. They're also known as loosely coupled systems.

SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in

This operating system consists of numerous computers, nodes, and sites joined
together via LAN/WAN lines. It enables the distribution of full systems on a
couple of center processors, and it supports many real-time products and
different users. Distributed operating systems can share their computing
resources and I/O files while providing users with virtual machine abstraction.

Types
There are three types of Distributed OS.
 Client-Server Systems − It is a tightly coupled operating system. It is
used for multiprocessors and homogeneous multicomputer. Client-Server
Systems works as a centralized server because it provides the approval to all
requests, which are generated by the client systems side.
 Peer-to-Peer Systems − It is a loosely coupled system. It is implemented
in the computer network application because it contains a bunch of processors,

SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in

and they are not shareable memories or clocks as well. Every processor consists
of its own local memory, and these processors communicate with each other
through various communication media such as high-speed buses or telephone
lines.
 Middleware − It allows the interoperability in the between of all
applications, which are running on other operating systems. By using these
services those applications are capable of transferring all data to each other. It
allows distribution transparency.

Features of Distributed Operating System


1. Connecting Users and Resources:
The main goal of a distributed system is to make it easy for users to access
remote resources, and to share them with other users in a controlled manner.
Resources can be virtually anything, typical examples of resources are
printers, storage facilities, data, files, web pages, and networks. There are
many reasons for sharing resources. One reason is economics.

2. Transparency:
An important goal of a distributed system is to hide the fact that its process
and resources are physically distributed across multiple computers. A
distributed system that is capable of presenting itself to users and applications
such that it is only a single computer system is called transparent.
The concept of transparency can be applied to many aspects of a distributed
system as shown in table.

3. Performance:
Building a transparent, flexible, reliable distributed system is useless if it is
slow like molasses. In particular application on a distributed system, it should
not deteriorate better than running some application on a single processor.
Various performance metrics can be used. Response time is one, but so are
throughput, system utilization, and amount of network capacity consumed.
Furthermore, the results of any benchmark are often highly dependent on the
nature of the benchmark. A benchmark involves a large number of
independent highly CPU-bound computations which give radically different

SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in

results than a benchmark that consists of scanning a single large file for same
pattern.

Issues in Distributed Systems

 the lack of global knowledge


 naming
 scalability
 compatibility
 process synchronization (requires global knowledge)
 resource management (requires global knowledge)
 security
 fault tolerance, error recovery

What is the Multiprocessing Operating System?


Multiprocessor operating systems are used in operating systems to boost the
performance of multiple CPUs within a single computer system.
Multiple CPUs are linked together so that a job can be divided and executed
more quickly. When a job is completed, the results from all CPUs are compiled
to provide the final output. Jobs were required to share main memory, and they
may often share other system resources. Multiple CPUs can be used to run
multiple tasks at the same time, for example, UNIX.
One of the most extensively used operating systems is the multiprocessing
operating system. The following diagram depicts the basic organisation of a
typical multiprocessing system.

SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in

Pros of Multiprocessing OS
Increased reliability: Processing tasks can be spread among numerous
processors in the multiprocessing system. This promotes reliability because if
one processor fails, the task can be passed on to another.
Increased throughout: More work could be done in less time as the number of
processors increases.
The economy of scale: Multiprocessor systems are less expensive than single-
processor computers because they share peripherals, additional storage devices,
and power sources.

Cons of Multiprocessing OS
Multiprocessing operating systems are more complex and advanced since they
manage many CPUs at the same time.

Introduction to Real-Time Operating Systems (RTOS)


One of the most important components that go into today's embedded systems
is the RTOS or real time operating system, which is responsible for scheduling
tasks to enabling high-level languages.

SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in

Real-time operating systems (RTOS) are used in environments where a large


number of events, mostly external to the computer system, must be accepted
and processed in a short time or within certain deadlines. Such applications
are industrial control, telephone switching equipment, flight control, and real-
time simulations. With an RTOS, the processing time is measured in tenths of
seconds. This system is time-bound and has a fixed deadline. The processing
in this type of system must occur within the specified constraints. Otherwise,
this will lead to system failure.
Examples of the real-time operating systems: Airline traffic control systems,
Command Control Systems, Airlines reservation system, Heart Pacemaker,
Network Multimedia Systems, and Robot etc.

The real-time operating systems can be of 3 types –


1. Hard Real-Time operating system:
These operating systems guarantee that critical tasks be completed within a
range of time.
For example, a robot is hired to weld a car body. If the robot welds too early
or too late, the car cannot be sold, so it is a hard real-time system that requires
complete car welding by robot hardly on the time., scientific experiments,
medical imaging systems, industrial control systems, weapon systems, robots,
air traffic control systems, etc.

2. Soft real-time operating system:


This operating system provides some relaxation in the time limit.
For example – Multimedia systems, digital audio systems etc. Explicit,
programmer-defined and controlled processes are encountered in real-time
systems. A separate process is changed with handling a single external event.
The process is activated upon occurrence of the related event signaled by an
interrupt.
Multitasking operation is accomplished by scheduling processes for execution
independently of each other. Each process is assigned a certain level of
priority that corresponds to the relative importance of the event that it
services. The processor is allocated to the highest priority processes. This type
of schedule, called, priority-based preemptive scheduling is used by real-time
systems.

SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in

3. Firm Real-time Operating System:


RTOS of this type have to follow deadlines as well. In spite of its small
impact, missing a deadline can have unintended consequences, including a
reduction in the quality of the product. Example: Multimedia applications.

The advantages of real-time operating systems are as follows-


1. Maximum consumption –
Maximum utilization of devices and systems. Thus more output from all the
resources.

2. Task Shifting –
Time assigned for shifting tasks in these systems is very less. For example, in
older systems, it takes about 10 microseconds. Shifting one task to another and
in the latest systems, it takes 3 microseconds.

3. Focus On Application –
Focus on running applications and less importance to applications that are in
the queue.

4. Real-Time Operating System In Embedded System –


Since the size of programs is small, RTOS can also be embedded systems like
in transport and others.

5. Error Free –
These types of systems are error-free.

6. Memory Allocation –
Memory allocation is best managed in these types of systems.
Disadvantages:
The disadvantages of real-time operating systems are as follows-

1. Limited Tasks –
Very few tasks run simultaneously, and their concentration is very less on few
applications to avoid errors.

SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in

2. Use Heavy System Resources –


Sometimes the system resources are not so good and they are expensive as
well.

3. Complex Algorithms –
The algorithms are very complex and difficult for the designer to write on.

4. Device Driver and Interrupt signals –


It needs specific device drivers and interrupts signals to respond earliest to
interrupts.

5. Thread Priority –
It is not good to set thread priority as these systems are very less prone to
switching tasks.

6. Minimum Switching – RTOS performs minimal task switching.

Case Study on Linux


• Unix V6, released in 1975 became very popular. Unix V6 was free and was
distributed with its source code.
• In 1983, AT&T released Unix System V which was a commercial version. •
Meanwhile, the University of California at Berkeley started the development of
its own version of UNIX. Berkeley was also involved in the inclusion of
Transmission Control Protocol/Internet Protocol (TCP/IP) networking protocol.
• The following were the major mile stones in UNIX history early 1980's
• AT&T was developing its System V Unix.
• Berkeley took initiative on its own Unix BSD (Berkeley Software
Distribution) UNIX.
• Sun Microsystems developed its own BSD-based UNIX called SunOS and
later was renamed to Sun Solaris.
• Microsoft and the Santa Cruz operation (SCO) were involved in another
version of UNIX called XENIX.

SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in

• Hewlett-Packard developed HP-UX for its workstations. • DEC released


ULTRIX.
• In 1986, IBM developed AIX (Advanced Interactive executive). 2. What is
LINUX operating system? • From smartphones to cars, supercomputers and
home appliances, the Linux operating system is everywhere. What is Linux?
Just like Windows XP, Windows 7, Windows 8, and Mac OS X, Linux is an
operating system. An operating system is software that manages all of the
hardware resources associated with your desktop or laptop. To put it simply –
the operating system manages the communication between your software and
your hardware. Without the operating system (often referred to as the “OS”),
the software wouldn’t function.
The OS is comprised of a number of pieces:
 The Bootloader: The software that manages the boot process of your
computer. For most users, this will simply be a splash screen that pops up and
eventually goes away to boot into the operating system.
 The kernel: This is the one piece of the whole that is actually called “Linux”.
The kernel is the core of the system and manages the CPU, memory, and
peripheral devices. The kernel is the “lowest” level of the OS.
 Daemons: These are background services (printing, sound, scheduling, etc)
that either start up during boot, or after you log into the desktop.
 The Shell: You’ve probably heard mention of the Linux command line. This
is the shell – a command process that allows you to control the computer via
commands typed into a text interface. This is what, at one time, scared people
away from Linux the most (assuming they had to learn a seemingly archaic
command line structure to make Linux work). This is no longer the case. With
modern desktop Linux, there is no need to ever touch the command line.
 Graphical Server: This is the sub-system that displays the graphics on your
monitor. It is commonly referred to as the X server or just “X”.
 Desktop Environment: This is the piece of the puzzle that the users actually
interact with. There are many desktop environments to choose from (Unity,
GNOME, Cinnamon, Enlightenment, KDE, XFCE, etc). Each desktop

SBS @PROPERITARY
BCA-4TH SEM/B.Sc. IT 2nd SEM www.sbs.ac.in

environment includes built-in applications (such as file managers, configuration


tools, web browsers, games, etc).
 Applications: Desktop environments do not offer the full array of apps. Just
like Windows and Mac, Linux offers thousands upon thousands of high-quality
software titles that can be easily found and installed. Most modern Linux
distributions (more on this in a moment) include App Store-like tools that
centralize and simplify application installation. For example: Ubuntu Linux has
the Ubuntu Software Center (Figure 1) which allows you to quickly search
among the thousands of apps and install them from one centralized location.
Linux is also distributed under an open source license. Open source follows the
following key philosophies:
 The freedom to run the program, for any purpose.
 The freedom to study how the program works, and change it to make it do
what you wish.

SBS @PROPERITARY

You might also like