Chapter 1
Chapter 1
An Operating System (OS) is an interface between a computer user and computer hardware. An
operating system is a software which performs all the basic tasks like file management, memory
management, process management, handling input and output, and controlling peripheral
devices such as disk drives and printers.
1. Security
The operating system uses password protection to protect user data and similar other
techniques. it also prevents unauthorized access to programs and user data.
Monitors overall system health to help improve performance. records the response time
between service requests and system response to having a complete view of the system health.
This can help improve performance by providing important information needed to troubleshoot
problems.
3. Job accounting
Operating system Keeps track of time and resources used by various tasks and users, this
information can be used to track resource usage for a particular user or group of users.
The operating system constantly monitors the system to detect errors and avoid the
malfunctioning of a computer system.
Operating systems also coordinate and assign interpreters, compilers, assemblers, and other
software to the various users of the computer systems.
6. Memory Management
The operating system manages the Primary Memory or Main Memory. Main memory is made
up of a large array of bytes or words where each byte or word is assigned a certain address.
Main memory is fast storage and it can be accessed directly by the CPU. For a program to be
executed, it should be first loaded in the main memory. An Operating System performs the
following activities for memory management:
It keeps track of primary memory, i.e., which bytes of memory are used by which user program.
The memory addresses that have already been allocated and the memory addresses of the
memory that has not yet been used. In multiprogramming, the OS decides the order in which
processes are granted access to memory, and for how long. It Allocates the memory to a
process when the process requests it and deallocates the memory when the process has
terminated or is performing an I/O operation.
7. Processor Management
In a multi-programming environment, the OS decides the order in which processes have access
to the processor, and how much processing time each process has. This function of OS is called
process scheduling. An Operating System performs the following activities for processor
management.
Keeps track of the status of processes. The program which performs this task is known as a
traffic controller. Allocates the CPU that is a processor to a process. De-allocates processor
when a process is no more required.
8. Device Management
An OS manages device communication via their respective drivers. It performs the following
activities for device management. Keeps track of all devices connected to the system.
designates a program responsible for every device known as the Input/Output controller.
Decides which process gets access to a certain device and for how long. Allocates devices in an
effective and efficient way. Deallocates devices when they are no longer required.
9. File Management
A file system is organized into directories for efficient or easy navigation and usage. These
directories may contain other directories and other files. An Operating System carries out the
following file management activities. It keeps track of where information is stored, user access
settings and status of every file, and more… These facilities are collectively known as the file
system.
This type of operating system does not interact with the computer directly. There is an
operator which takes similar jobs having the same requirement and group them into
batches. It is the responsibility of the operator to sort jobs with similar needs.
• It is very difficult to guess or know the time required for any job to complete. Processors
of the batch systems know how long the job would be when it is in queue
• Multiple users can share the batch systems
• The idle time for the batch system is very less
• It is easy to manage large work repeatedly in batch systems
Disadvantages of Batch Operating System:
Examples of Batch based Operating System: Payroll System, Bank Statements, etc.
Each task is given some time to execute so that all the tasks work smoothly. Each user gets
the time of CPU as they use a single system. These systems are also known as Multitasking
Systems. The task can be from a single user or different users also. The time that each task
gets to execute is called quantum. After this time interval is over OS switches over to the
next task.
• Reliability problem
• One must have to take care of the security and integrity of user
programs and data
• Data communication problem
Examples of Time-Sharing OSs are: Multics, Unix, etc.
Multiprocessing Operating System is the type of Operating System that uses multiple
processors to operate within a single system. Multiple CPUs are connected to divide and
execute a job more quickly. After the task is finished, the output from all Processors is
compiled to provide a final result. Jobs are required to share main memory and they may
often share other system resources.
The organization of a typical Multiprocessing Operating System is shown in the image given
below.
Multiprocessing Operating Systems have the following advantages over the other types of
Operating Systems.
• Multiprocessing Operating System uses multiple processors to execute the tasks which
results in faster execution and better performance of the system.
• In case a processor fails to work, the other processors can continue to execute the tasks.
Thus, Multiprocessing Operating Systems ensure the high availability of the system.
• Multiprocessing Operating Systems are scalable which means that can handle the
increased amount of workload without affecting the performance of the system.
• Multiprocessing Operating Systems efficiently utilize the resources.
Because the processors share memory and the Input-output bus or data route, the
symmetric multiprocessing operating system is sometimes known as a "shared
everything" system. Processors in this system are hardly greater than 16.
For multitasking to take place, firstly there should be multiprogramming i.e. presence of
multiple programs ready for execution. And secondly the concept of time sharing.
Types of Multitasking Operating Systems
Now let’s delve into the detailed analysis of both types of multitasking operating systems.
• Multitasking operating systems possess a robust virtual memory system that eliminates
long wait times for program execution by shifting applications to virtual memory if
necessary.
• Additionally, to prevent CPU wait times, all jobs in Multitasking Operating System are
given a predetermined duration.
• Multitasking operating systems can efficiently manage computer resources such as I/O
devices, RAM, hard disks, and CPUs.
• Users can concurrently run several programs, such as internet browsers, games,
Microsoft Excel, PowerPoint, and other utilities in a Multitasking Operating System.
• Due to the slower pace of the processors in a Multitasking Operating System, the
computer system may perform slowly and experience longer response times when
running multiple programs. In order to fix this issue, additional processing power may
be required.
• By doing multitasking, the processor becomes busy all the time and CPU heats up. To
solve this problem, you have to attach the cooling system to your CPU. This normally
happens when you play heavy games on your PC.
The real-time operating systems are used in real-time systems where the time constraints are
fixed and followed strictly. This means that the time for processing and responding is very
small. Moreover, the system should perform the given task in a fixed time otherwise, it results
in a system failure.
Response Time is the time within which the system takes the input, processes the data, and
gives the results. Moreover, they are used in systems like robots, missile launches, airplanes,
etc.
The various examples of Real-time operating systems are MTS, PCOS, Lynx, RT Linux, QNX,
VxWorks, etc.
Types of RTOS
There are three types of real-time operating systems. They are as follows:
In this, the time constraint is very short and strict. Even seconds of delay is not acceptable.
Therefore, it is compulsory to complete the task within the given time only.
In these systems, although the deadline is given but, missing them does not result in great loss.
There can be some unwanted side effects in the system if the deadline is not followed.
As the name suggests, the system handles the deadlines softly. This means that if there are
small delays in the system, it is acceptable.
Examples are Online Transaction systems, Livestock price quotation systems, Computer games,
etc.
Applications of Real-time Operating System (RTOS)
A distributed operating system is one in which several computer systems connected through a
single communication channel. Moreover, these systems have their individual processors
and memory. Furthermore, these processors communicate through high-speed buses or
telephone lines. These individual systems that connect through a single channel are considered
as a single unit. We can also call them loosely coupled systems. The individual components or
systems of the network are nodes.
Examples of Distributed OS: Mach OS, Solaris OS, Locus OS, etc.
There are various types of Distributed Operating systems. Some of them are as follows:
1. Client/Server Systems
In a client-server distributed operating system, the server provides a specific set of services or resources
to the client. The client makes requests to the server, and the server responds by providing the
requested service or resource. The clients and servers connect through a computer network in the
system. Client-server distributed operating systems are commonly used in enterprise applications.
In a peer-to-peer (P2P) distributed operating system, each computer or node is equal in terms of
functionality and can act as a client or server. Nodes can share resources such as processing power,
storage, and bandwidth with each other. P2P systems are often used in file sharing, instant messaging,
and gaming applications. They are also known as “Loosely Coupled Systems”.
3. Middleware:
In contrast to the other distributed operating systems, middleware is a software layer that sits between
the operating system and application software. It provides a set of services that enable communication
between different applications running on different machines. Middleware is used to create distributed
systems that can run across multiple platforms.
4. Three-tier Systems
A three-tier distributed operating system is a specific type of N-tier system that consists of a
presentation tier, an application tier, and a data storage tier. The presentation tier provides the user
interface, the application tier handles the business logic, and the data storage tier handles data storage
and retrieval.
5. N-tier Systems:
In an N-tier architecture, applications are structured into multiple tiers or layers beyond the traditional
three-tier model. Each tier performs specific functions, such as presentation, logic, data processing, and
storage, with the flexibility to add more tiers as needed. In a distributed operating system, this
architecture enables complex applications to be divided into modular components distributed across
multiple nodes or servers.
1. Openness: Openness here is that the services of the system are freely displayed through the
interfaces. This characteristic is mainly concerned with extensions and improvements of distributed
systems. This system must be open in terms of software and hardware. New components can be
easily integrated with existing components.
3. Resource sharing: Resources such as memory, storage, and processing power can be shared across
multiple machines.
4. Scalability: The system can easily be scaled up or down by adding or removing nodes, making it
highly adaptable to changing demands.
5. Fault tolerance: Distributed operating systems are designed to continue functioning even in the
event of node failures.
6. Transparency: The system makes it appear as if all resources are available locally, even though they
may be located on a different machine.
7. Heterogeneity: Distributed operating systems can support a wide variety of hardware and software
configurations across different machines.
Advantages of Distributed OS
5. The majority of distributed systems are composed of multiple nodes that work together to provide
fault tolerance. Even if one machine malfunctions, the system still functions.
Disadvantages of Distributed OS
1. It is hard to implement adequate security in DOS since the nodes and connections must be secured.
2. The database connected to a DOS is relatively complicated and hard to manage in contrast to a
single-user system.
3. The underlying software is extremely complex and is not understood very well compared to other
systems.
4. The system must decide which jobs must be executed when they must be executed, and where they
must be executed. A scheduler has limitations, which can lead to underutilized hardware and
unpredictable runtimes.
5. Installation and initial configuration costs are high due to the wide variety of hardware and software
devices. Other maintenance costs associated with the system add up to the total cost, making it
even more expensive.
The user interface (UI) is the point of human-computer interaction and communication in a device. This
can include display screens, keyboards, a mouse and the appearance of a desktop. It is also how a user
interacts with an application or a website, using visual and audio elements, such as type fonts, icons,
buttons, animations and sounds.
a) Command User Interface
CUI stands for Character User Interface (Command-Line User Interface or Console User Interface). It is a
user interface where the user interacts with the computer solely through the keyboard and requires a
command to perform any task. CUI is the precursor of GUI and was utilized in most of the early
computers. Most computers use GUI rather than CUI. It works by permitting the user to provide
commands to a program in multiple text lines (command lines).
CUIs basic instances are MS-DOS and the Windows Command Prompt.
Advantages:
• Efficiency and Speed: Experienced users can perform complex tasks quickly.
• Resource Usage: CLIs use minimal system resources compared to graphical interfaces.
Disadvantages:
• Error-Prone: Typing errors or incorrect syntax in commands can lead to system errors or task
failures.
GUI stands for Graphical User Interface. It is a visual representation of communication presented to the
user for easy interaction with the machine. The actions in a GUI are usually performed through direct
manipulation of graphical elements like buttons and icons. Communication can be performed by
interacting with these icons rather than the usual text-based or command-based communication.
It is a visual-based interface that allows users to interact with the OS through graphical elements like
windows, icons, menus, and pointers (WIMP model). Graphical user interface design principles follow
the model-view-controller software pattern, which separates internal representations of information
from how information is presented to the user, resulting in a platform where users are shown which
functions are possible rather than requiring the input of command codes.
Some of the GUI based OS are Microsoft Windows, Linux, Android, Apple iOS, macOS, etc.
Advantages:
• User-Friendly: Intuitive and easy to use, suitable for all user levels.
Disadvantages:
• Complex and Expensive: Uses high power and computer memory than other interfaces due to
all graphical representations.
Peripherals used GUI operating system requires CUI operating system requires
a keyboard, mouse or any the only keyboard.
other pointing device.
a) Single User OS
A single-user operating system is a type of operating system developed and intended for use on a
computer or similar machine that will only have a single user at any given time. Single user operating
system is also known as a single-tasking operating system, and a single-user operating system is
designed especially for home computers. The computers based on this operating system have a single
processor to execute only a single program at all times. This system provides all the resources such as
CPU, and I/O devices, to a single user at a time.
A single task operating system can only run one program or application at a time. So, it is not as useful
for a computer or other device intended to run multiple programs at once. This is where a multitasking
single-user operating system is used instead. A multitasking OS can run multiple applications and
programs at once.
Even though this type of operating system can connect to other computers through a network, it is still
only being used by a single user. As long as the computer only has one monitor, keyboard and other
input devices, then it is a single-user system.
Advantages:
• In these systems, one user is only active at a time. So, there will be no other user interfering
with the applications.
• These systems use fewer resources, and their complexity is less, making them easy to maintain
and debug.
• These systems include fewer requests to hardware and software at a time, so they have less
chance to damage. This is a single-user interface it allows only one user’s tasks to execute in a
given time.
Disadvantages:
• The OS remains idle for most of the time and is not utilized to its maximum.
• Many tasks are waiting for the CPU if no multiple tasks run at a time. Thus, tasks take longer to
complete.
Single user operating system can be classified into two parts, such as:
In the Single-User Single-Tasking operating system, only one user is permitted for performing a single
task at a time. Some functions such as printing a document and downloading images and videos are
performed in one given frame. This operating system is designed especially for wireless phones as well
as two-way messaging devices. For example, MS-DOS, Palm OS, etc. It has the following advantages:
• It is cost-effective.
Disadvantages:
• Less Optimized
Single-User Multi-Tasking operating system is developed especially for one user, but this single user can
perform multiple tasks simultaneously. For example, you can write any text while surfing the internet,
downloading images, watching movies, etc., on Windows, Linux, Mac O/S. It has the following
advantages:
• Time-saving.
Disadvantages:
• More complexity
b) Multi User OS
A multi-user operating system is an operating system that allows multiple users to access underlying
hardware resources simultaneously. Multiple users access the operating system with the help of many
terminals connected to a network. The objective of a multi-user operating system is time-
sharing and batch processing.
A multi-user operating system has four types of software components. Let us learn about each of them
in detail.
• Kernel - The Kernel is the low-level component of a Multi-user operating system written in a
low-level programming language. It is present in the main memory of the computer system. It
can interact directly with the hardware of the system.
• Device handler - Every input and output device has its device handler. The primary goal of a
device handler is to provide requests from the entire device request pool, which is a queue that
follows the first-in, first-out method. The device handler cycle works continuously, discarding
the request blocks of the input/output received from the queue side.
• Spooler - A Spooler in a Multi-user operating system stands for Simultaneous Peripheral Output
On Line and is responsible for executing all processes running on the computer. It also provides
relevant results at the same time. It mediates between a computer application and peripheral
devices such as a printer.
• User Interface - A user interface sets up interaction and communication between humans
(users) and computers (software/hardware) in a device. Its objective is to create an easily
accessible and simplified working platform that serves the needs of all users.
• Resource sharing - A multi-user operating system can share multiple peripherals or resources,
such as printers, hard drives, fax machines, plotters, etc. This feature helps to share files,
documents, and data among users. This feature maps to time-slicing, where a tiny slice of CPU
time gets allocated to all users.
• Background processing - A multi-user operating system can process tasks in the backend if they
are not allowed to process in the front. It also allows simultaneous processing and interaction of
programs with the system.
• Invisibility - Many functions of multi-user operating systems are invisible to the user.
Advantages:
• It avoids disruption if any one computer fails it does not affect any other computer present on
that network.
• The services of the multi-user operating systems are very stable and systematic.
Disadvantages:
• When multiple users log on or work on the same system it reduces the overall performance of
the system.
The entire system in the distributed operating system is a network through which the end-users
communicate or operate. Distributed operating system, also called distributed computing, is a
compilation of multiple components. The components are distributed over multiple computers to help
the end-user interact and coordinate like a single coherent system.
It is a system where each user task is assigned a short period of CPU time. The CPU time gets divided
into time slices where each slice is too small for the user. This method of dividing the CPU time is known
as time slicing. Time slicing is a scheduling algorithm also called Round Robin Scheduling. It gives equal
opportunity to all the processes running in the system to use CPU time.
3. Multiprocessor Systems
Multiprocessor systems are systems that use multiple processors at the same time. Using multiple
processors increases the system performance as all the processors run side by side. It works at a pace
that is faster than the single-processor operating system. In a multiprocessor system, if one processor
fails, another processor completes its assigned tasks.
The difference between single-user operating systems and multi-user operating systems are given
below:
Bootloader The bootloader loads all the The bootloader distributes the
resources of the CPU in the resources of the CPU based on
profile of a single superuser. the priority of the users.
Super User A superuser gets all the powers Superuser does not exist for a
of maintaining the system and multi-user operating system as
making changes to ensure the each entity has control over
system runs smoothly. their working.
Performance Only one task at one time gets Schedules different tasks for
performed. performance at any rate.