What is OS?
• An Operating System (OS) is a system software that acts as an interface between computer
hardware components and the user.
• The OS helps you to communicate with the computer without knowing how to speak the
computer’s language. It is not possible for the user to use any computer or mobile device
without having an operating system.
• Applications like Browsers, MS Office, Notepad Games, etc., need some environment to run
and perform its tasks.
• The first operating system used for real work was GM-NAA I/O, produced in 1956 by General
Motors' Research division for its IBM 704.
• The first OS built by Microsoft was MS-DOS, built in 1981
• In 1981, Xerox Star workstation introduced, the first commercial GUI operating system.
Basic OS Functions:
Operating System:
• An operating system is a program that controls the execution of application programs and acts
as an interface between the user of a computer and the computer hardware.
• The purpose of an operating system is to provide an environment in which a user can execute
programs conveniently and efficiently.
• It also manages computer hardware.
OS Functions:
Following are some important FUNCTIONS of an operating System:
1) Resource Management: When parallel accessing happens in the OS means when multiple
users are accessing the system the OS works as Resource Manager, Its responsibility is to
provide hardware to the user. It decreases the load in the system. It ensures the use of all the
resources by managing which resource is used by which process and for how much time.
2) Process Management: It includes various tasks like scheduling, termination of the process.
The process is a program under the execution. The operating system manages all the
processes so that each process gets the CPU for a specific time to execute itself, and there
will be less waiting time for each process. This management is also called process scheduling.
Hence all the tasks would be done by the many algorithms that use for scheduling.
3) Storage Management: The file system mechanism used for the management of the storage.
A file system is organized into directories for efficient or easy navigation and usage. OS It
keeps track of where information is stored, user access settings, the status of every file, and
more. All the data stores in various tracks of Hard disks that all managed by the storage
manager.
4) Memory Management: Refers to the management of primary memory. The operating system
has to keep track, how much memory has been used and by whom. It has to decide which
process needs memory space and how much. OS also has to allocate and deallocate the
memory space.
5) Device Management: The operating system manages the communication between the
computer system and the peripheral devices connected to the I/O port of the system. The
operating system determines which program or process is accessed by which connection and
device. It also makes sure when a program is executed or terminated, it will stop the
communication between the device and the computer system.
6) Security and Privacy Management: Computer security is a very important aspect of any
operating system. The reliability of an operating system is determined by how much better
security it provides us. Modern operating systems use a firewall for security. A firewall is a
security system that monitors every activity happening in the computer and blocks that activity
in case of any threat. Privacy is also provided by the Operating system by means of passwords
so that unauthorized applications can’t access programs or data. For example, Windows uses
Kerberos authentication to prevent unauthorized access to data.
OS Services:
Following are a few common SERVICES provided by an operating system
1) Program execution - Operating systems handle many kinds of activities from user programs
to system programs like printer spooler, name servers, file server, etc. Each of these activities
is encapsulated as a process. A process includes the complete execution context (code to
execute, data to manipulate, registers, OS resources in use).
2) I/O Operation - An I/O subsystem comprises of I/O devices and their corresponding driver
software. Drivers hide the peculiarities of specific hardware devices from the users. An
Operating System manages the communication between user and device drivers.
3) File system manipulation - A file represents a collection of related information. Computers
can store files on the disk (secondary storage), for long-term storage purpose. A file system is
normally organized into directories for easy navigation and usage. These directories may
contain files and other directions.
4) Communication - In case of distributed systems which are a collection of processors that do
not share memory, peripheral devices, or a clock, the operating system manages
communications between all the processes. Multiple processes communicate with one another
through communication lines in the network. The OS handles routing and connection
strategies, and the problems of contention and security.
5) Error handling - Errors can occur anytime and anywhere. An error may occur in CPU, in I/O
devices or in the memory hardware.
6) Resource Management - In case of multi-user or multi-tasking environment, resources such
as main memory, CPU cycles and files storage are to be allocated to each user or job.
7) Protection - Considering a computer system having multiple users and concurrent execution
of multiple processes, the various processes must be protected from each other's activities.
Protection refers to a mechanism or a way to control the access of programs, processes, or
users to the resources defined by a computer system.
Resource Abstraction in OS:
• Resource abstraction is a powerful technique that allows the operating system to hide the
details of its implementation from users and programs. By hiding the details of its
implementation, the operating system can provide a simpler and more consistent interface to
users and programs.
• It is used to hide the details of many different types of resources, including hardware
resources, software resources, and data resources.
1) Hardware resources include devices such as printers and disk drives.
2) Software resources include files, network connections, and process control blocks.
3) Data resources include databases and message queues.
Types of OS:
1. Batch Operating 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. Before
the 1970s, it was not possible to directly feed the program to the computer. People used to
give jobs to a computer operators in the form of punch cards. Then computer operator used to
make the batches of all these punch cards of similar requirements to save the setup time. The
main task of the batch operating system is to make the batches of similar types of jobs and
send these batches to the CPU for execution
Advantages of Batch Operating System:
• 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:
• The computer operators should be well known with batch systems.
• Batch systems are hard to debug.
• It is sometimes costly.
• The other jobs will have to wait for an unknown time if any job fails.
2. Multiprogramming Operating System: When more than one program can execute in an
operating system then this is termed a multiprogramming operating system. Multiprogramming
is an extension to batch processing where the CPU is always kept busy. Before the concept of
Multiprogramming, computing takes place in other way which does not use the CPU efficiently.
Earlier, CPU executes only one program at a time. In earlier day’s computing ,the problem is
that when a program undergoes in waiting state for an input/output operation, the CPU
remains idle which leads to underutilization of CPU and thus poor performance .
Multiprogramming addresses this issue and solve this issue. The major task of
multiprogramming is to maximize the utilization of resources.
Advantages of Multiprogramming OS
• Need Single CPU for implementation.
• Switching happens when current process undergoes waiting state.
• CPU idle time is reduced.
• High resource utilization.
• High Performance.
Disadvantages of Multiprogramming OS
• Prior knowledge of scheduling algorithms is required.
• If it has a large number of jobs, then long-term jobs will have to require a long wait.
• Memory management is needed in the operating system because all types of tasks are stored
in the main memory.
• Using multiprogramming up to a larger extent can cause a heat-up issue.
3. Time-Sharing Operating Systems: 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. Examples of Time-Sharing OSs are: Multics,
Unix, etc.
Advantages of Time-Sharing OS:
• Each task gets an equal opportunity.
• Fewer chances of duplication of software.
• CPU idle time can be reduced.
Disadvantages of Time-Sharing OS:
• Reliability problem.
• One must have to take care of the security and integrity of user programs and data.
• Data communication problem.
4. Distributed Operating System: These types of the operating system is a recent
advancement in the world of computer technology and are being widely accepted all over the
world and, that too, with a great pace. Various autonomous interconnected computers
communicate with each other using a shared communication network. Independent systems
possess their own memory unit and CPU. These are referred to as loosely coupled systems or
distributed systems. These system’s processors differ in size and function. The major benefit of
working with these types of the operating system is that it is always possible that one user can
access the files or software which are not actually present on his system but some other
system connected within this network. Examples of Distributed Operating System are: LOCUS,
etc.
Advantages of Distributed Operating System:
• Failure of one will not affect the other network communication, as all systems are independent
from each other.
• Electronic mail increases the data exchange speed.
• Since resources are being shared, computation is highly fast and durable.
• Load on host computer reduces.
• These systems are easily scalable as many systems can be easily added to the network.
• Delay in data processing reduces.
Disadvantages of Distributed Operating System:
• Failure of the main network will stop the entire communication.
• To establish distributed systems the language which is used are not well defined yet.
• These types of systems are not readily available as they are very expensive. Not only that the
underlying software is highly complex and not understood well yet.
5. Network Operating System: These systems run on a server and provide the capability to
manage data, users, groups, security, applications, and other networking functions. These
types of operating systems allow shared access of files, printers, security, applications, and
other networking functions over a small private network. One more important aspect of
Network Operating Systems is that all the users are well aware of the underlying configuration,
of all other users within the network, their individual connections, etc. and that’s why these
computers are popularly known as tightly coupled systems. Examples of Network Operating
System are: Microsoft Windows Server 2003, Microsoft Windows Server 2008, UNIX, Linux,
Mac OS X, Novell NetWare, and BSD, etc.
Advantages of Network Operating System:
• Highly stable centralized servers.
• Security concerns are handled through servers.
• New technologies and hardware up-gradation are easily integrated into the system.
• Server access is possible remotely from different locations and types of systems.
Disadvantages of Network Operating System:
• Servers are costly.
• User has to depend on a central location for most operations.
• Maintenance and updates are required regularly.
6) Real-Time Operating System: In Real-Time Systems, each job carries a certain deadline
within which the job is supposed to be completed, otherwise, the huge loss will be there, or
even if the result is produced, it will be completely useless. These types of OSs serve real-time
systems. The time interval required to process and respond to inputs is very small. This time
interval is called response time. Real-time systems are used when there are time requirements
that are very strict like missile systems, air traffic control systems, robots, etc. Examples of
Real-Time Operating Systems are: Scientific experiments, medical imaging systems, industrial
control systems, weapon systems, robots, air traffic control systems, etc.
Types of real-time systems based on timing constraints:
1) Hard real-time system: This type of system can never miss its deadline. Missing the deadline
may have disastrous consequences. The usefulness of results produced by a hard real-time
system decreases abruptly and may become negative if tardiness increases. Tardiness means
how late a real-time system completes its task with respect to its deadline. Example: Flight
controller system.
2) Soft real-time system: This type of system can miss its deadline occasionally with some
acceptably low probability. Missing the deadline have no disastrous consequences. The
usefulness of results produced by a soft real-time system decreases gradually with an increase
in tardiness. Example: Telephone switches.
3) Firm Real-Time Systems: These are systems that lie between hard and soft real-time
systems. In firm real-time systems, missing a deadline is tolerable, but the usefulness of the
output decreases with time. Examples of firm real-time systems include online trading systems,
online auction systems, and reservation systems.
Advantages of RTOS:
• Maximum Consumption: Maximum utilization of devices and system, thus more output from
all the resources
• Task Shifting: The time assigned for shifting tasks in these systems are very less. For
example, in older systems, it takes about 10 microseconds in shifting one task to another, and
in the latest systems, it takes 3 microseconds.
• Focus on Application: Focus on running applications and less importance to applications
which are in the queue.
• Real-time operating system in the embedded system: Since the size of programs are
small, RTOS can also be used in embedded systems like in transport and others.
• Error Free: These types of systems are error-free.
• Memory Allocation: Memory allocation is best managed in these types of systems.
Disadvantages of RTOS:
• Limited Tasks: Very few tasks run at the same time and their concentration is very less on few
applications to avoid errors.
• Use heavy system resources: Sometimes the system resources are not so good and they
are expensive as well.
• Complex Algorithms: The algorithms are very complex and difficult for the designer to write
on.
• Device driver and interrupt signals: It needs specific device drivers and interrupts signals to
respond earliest to interrupts.
• Thread Priority: It is not good to set thread priority as these systems are very less prone to
switching tasks.
OS for Personal Computers & Workstations:
• A personal operating system is used on an individual computing device that can run without
being part of a network. While these devices may be connected, they don't have to be in order
to run. Examples of these would be regular desktop computers, laptops, tablets and
smartphones. There are a number of different personal operating systems.
• A workstation is a computer intended for individual use that is faster and more capable than a
personal computer. It's intended for business or professional use (rather than home use).
Workstations and applications designed for them are used by small engineering companies,
architects, graphic designers, and any organization, department, or individual that requires a
faster microprocessor, a large amount of random access memory and special features such
as high-speed graphics adapters.
The most widely used ones are Windows, Mac OS and Linux:
1) The Windows OS was created by the Microsoft Corporation in 1985. It is the most widely used
OS for personal computers, or PCs. Some of the different versions of Windows, such as
Windows XP, Vista, 7, 8, 10 and 11. New versions are released to keep up with the changes in
hardware and software and with general trends in the computer industry. For example, the
2013 version (Windows 8) was designed with touch screen technology in mind.
2) The Mac OS is the general name for the operating system developed by Apple Inc. in 1984.
This operating system is unique in the sense that both the operating system and the hardware
are made by the same company. Similar to Windows, there have been a series of different
versions over the years.
3) The Linux OS is a free and open-source operating system developed by Linus Torvalds in
1991. It is based on the original UNIX OS developed by AT&T in 1969. The underlying source
code for the operating system can be freely used, distributed and modified. Partly because it is
free and open-source, it has been adapted to run on many different types of devices, from
desktop PCs, to supercomputers and mobile phones. A number of commercial versions of
Linux are also available, providing additional functionality on top of the regular Linux version.
Process Control System:
• A Process Control System is a type of control system that is used to manage and regulate
the processes within various industries, such as manufacturing, chemical production, and
power generation. The primary goal of a process control system is to maintain the desired
output of a process by manipulating the inputs.
• Process Control Systems make sure industrial processes are carried out efficiently,
consistently and with as little variation as possible. They're installed in industrial settings to:
1. Help maintain throughput, quality, yield and energy efficiency
2. Make sure working practices are carried out safely and profitably
• An example of a simple process that is controlled is keeping the temperature of a room at a
certain temperature using a heater and a thermostat.
Key Components of a Process Control System:
1. Sensors and Transducers: Measure process variables like temperature, pressure, flow rate,
and level.
2. Controllers: Compare the measured process variable to a setpoint and determine the
necessary corrective action. Common types include PID (Proportional-Integral-Derivative)
controllers.
3. Actuators: Devices such as valves, motors, or pumps that implement the controller's
corrective actions by manipulating the process inputs.
4. Human-Machine Interface (HMI): Provides a graphical interface for operators to monitor and
control the process.
5. Communication Networks: Enable data exchange between sensors, controllers, actuators,
and HMIs.
Applications:
• Manufacturing: Automated production lines.
• Chemical Processing: Maintaining chemical reactions at optimal conditions.
• Power Generation: Controlling boilers and turbines.
• Oil and Gas: Managing extraction and refining processes.
Multiprogramming, Multiprocessing, Multitasking, Multithreading:
Multiprogramming
• The concurrent residency of more than one program in the main memory is referred as
multiprogramming.
• Since multiple programs are resident in the memory, as soon as the currently executing
program finishes its execution, the next program is dispatched for its consumption.
• The main objective of multiprogramming is maximum CPU utilization & efficient management
of the main memory.
Multiprocessing
• When one system is connected to more than one processor which collectively work for the
completion of the task, it is called as multiprocessing systems.
• Multiprocessing systems can be divided in two types:
1) Symmetric Multiprocessing: The OS controls all the CPU, each CPU has equal rights. All
the CPU are in peer-to-peer relationship.
2) Asymmetric Multiprocessing: There is a master CPU that gives instructions to all other
CPUs. It contains master-slave relationship.
Multithreading
• Multithreading is a conceptual programming paradigm where a process is divided into a
number of sub-processes called as threads. Each thread is independent and has its own path
of execution with enabled inter thread communication.
• Thread is the path followed while executing a program. Each thread has its own program
counter, stack and register.
• A thread is a light weight process.
Multitasking
• Earlier when computers were invented, a user was allowed to submit only job or task at a time.
But later with availability of high-speed processor, one can submit more than one task.
• So the capability of OS to accept more the one task per user is termed as multitasking.
• Multiple jobs are executed by the CPU simultaneously by switching between them.
• The various job can be accepted from same user or different users. There are 2 types of
multitasking systems:
1) Single User Multitasking
2) Multi User multitasking
Kernel:
Kernel is the core of an operating system that manages system resources. It also acts as a bridge
between the application and hardware of the computer. It is one of the first programs loaded on start-
up and remains in the memory until the Operating System is shut-down. When a process makes a
request to the Kernel, then it is called System Call.
Objectives of Kernel:
1) To establish communication between user level application and hardware.
2) To decide state of incoming processes.
3) To control disk management.
4) To control memory management.
5) To control device management.
Functions of Kernel:
A kernel of an OS is responsible for performing various functions and has control over the system.
Some main functions of Kernel are given below:
1) Device Management
2) Memory Management
3) Resource Management
4) Accessing Computer Resources:
A kernel of an OS is responsible for performing various functions and has control over the system.
Some main functions of Kernel are given below:
1) Device Management: To perform various actions, processes require access to peripheral
devices such as a mouse, keyboard, etc., that are connected to the computer. A kernel is
responsible for controlling these devices using device drivers.
2) Memory Management: The kernel has full control for accessing the computer's memory. Each
process requires some memory to work, and the kernel enables the processes to safely
access the memory.
3) Resource Management: One of the important functionalities of Kernel is to share the
resources between various processes. It must share the resources in a way that each process
uniformly accesses the resource.
4) Accessing Computer Resources: A kernel is responsible for accessing computer resources
such as RAM and I/O devices. RAM or Random-Access Memory is used to contain both data
and instructions. Each program needs to access the memory to execute and mostly wants
more memory than the available. For such a case, Kernel plays its role and decides which
memory each process will use and what to do if the required memory is not available.
Kernel Mode and User Mode :
• A computer operates in two modes which are User Mode and Kernel Mode. When the
computer is running application software, it is in User Mode. After the application software
request for hardware, the computer enters Kernel Mode. The kernel is the core of the
computer system. Most critical tasks of the operating system are executing in the kernel mode.
The key difference between User Mode and Kernel Mode is that user mode is the mode in
which the applications are running and kernel mode is the privileged mode to which the
computer enters when accessing hardware resources.
• A Kernel is provided with a protected Kernel Space which is a separate area of memory and
this area is not accessible by other application programs. So, the code of the Kernel is loaded
into this protected Kernel Space.
• Apart from this, the memory used by other applications is called the User Space. As these are
two different spaces in the memory, so communication between them is a bit slower.
System Calls :
What is a System Call?
A system call is a method for a computer program to request a service from the kernel of the
operating system on which it is running. A system call is a method of interacting with the operating
system via programs. A system call is a request from computer software to an operating system's
kernel.
Why do you need system calls in Operating System?
• There are various situations where you must require system calls in the operating system.
Following of the situations are as follows:
1) It is must require when a file system wants to create or delete a file.
2) Network connections require the system calls to sending and receiving data packets.
3) If you want to read or write a file, you need to system calls.
4) If you want to access hardware devices, including a printer, scanner, you need a system call.
5) System calls are used to create and manage new processes.
System Programs in OS:
What are System Programs?
• In an operating system a user is able to use different types of system programs and the
system program is responsible for all the application software performance of the computer.
• The system programs are responsible for the development and execution of a program and
they can be used by the help of system calls because system calls define different types of
system programs for different tasks.
Purpose of using system program
• System programs communicate and coordinate the activities and functions of hardware and
software of a system and also controls the operations of the hardware. An operating system is
one of the examples of system software. Operating system controls the computer hardware
and acts like an interface between the application software’s.