Unit 1
Unit 1
Resources:
https://www.tutorialspoint.com/operating-system-generations
https://www.geeksforgeeks.org/what-is-an-operating-system/
https://www.geeksforgeeks.org/difference-between-multitasking-multithreading-and-
multiprocessing/
Introduction:
1) What is Operating System?
Definition - Operating system is a software that acts as an intermediary between the
user and computer hardware.
It is a program with the help of which we are able to run various applications.
It is the one program that is running all the time.
Every computer must have an operating system to smoothly execute other programs.
The OS coordinates the use of the hardware and application programs for various
users. It provides a platform for other application programs to work. The operating
system is a set of special programs that run on a computer system that allows it to
work properly. It controls input-output devices, execution of programs, managing
files, etc.
operating system is the most important type of system software in a computer system.
Let us now see some of the objectives of the operating system, which are mentioned below.
Convenient to use: One of the objectives is to make the computer system more
convenient to use in an efficient manner.
User Friendly: To make the computer system more interactive with a more
convenient interface for the users.
Easy Access: To provide easy access to users for using resources by acting as an
intermediary between the hardware and its users.
Management of Resources: For managing the resources of a computer in a
better and faster way.
Controls and Monitoring: By keeping track of who is using which resource,
granting resource requests, and mediating conflicting requests from different
programs and users.
Fair Sharing of Resources: Providing efficient and fair sharing of resources
between the users and programs.
How To Choose the Correct Operating System?
There are so many factors to be considered while choosing the best Operating System for
our use. These factors are mentioned below.
Price Factor: Price is one of the factors to choose the correct Operating System
as there are some OS that is free, like Linux, but there is some more OS that is
paid like Windows and macOS.
Accessibility Factor: Some Operating Systems are easy to use like macOS and
iOS, but some OS are a little bit complex to understand like Linux. So, you must
choose the Operating System in which you are more accessible.
Compatibility factor: Some Operating Systems support very less applications
whereas some Operating Systems supports more application. You must choose
the OS, which supports the applications which are required by you.
Security Factor: The security Factor is also a factor in choosing the correct OS,
as macOS provide some additional security while Windows has little fewer
security features.
Examples of Operating Systems
Features of BPOS:
Batch OS is an operating system designed specifically for batch processing. It
includes a command line interface, a library for scheduling tasks, and a user
interface for managing tasks. Batch OS is designed to simplify the process of
managing and scheduling tasks across a network of computers.
Batch OS includes a library for scheduling tasks. This library allows tasks to be
scheduled in a hierarchical manner, which makes it easy to manage and schedule
tasks across a network of computers. The user interface allows users to view and
manage tasks in a graphical manner.
There are many types of batch operating systems.
One popular type is the scheduled batch system. This type of system is used to
control the execution of a series of tasks or jobs.
Other types of batch systems include the interactive batch system, the real-time
batch system, and the concurrent batch system.
Advantages:
There are many advantages to using a batch operating system. One of the most important is
the speed at which a batch job can be executed. Batch systems are designed to handle large
numbers of tasks quickly and efficiently. They are also well-suited for automated tasks and
processes.
Another advantage of using a batch system is the ability to automate tasks. This can save
time and effort for administrators and users. Batch systems can also be used to manage
large files and data sets. This is especially important in environments that are prone to data
breaches.
Lastly, batch systems are stable and reliable. This is important in environments where the
systems are used for long periods of time. Batch systems are also easier to learn and use
than other types of operating systems.
The advantages of batch processing operating systems include:
1. Efficient use of resources: Batch processing operating systems allow for the
efficient use of computing resources, as jobs are processed in batches and
scheduled to run when resources are available.
2. High throughput: Batch processing operating systems can process a large
number of jobs quickly, allowing for high throughput and fast turnaround times.
3. Reduced errors: As batch processing operating systems do not require user
intervention, they can help reduce errors that may occur during manual job
processing.
4. Simplified job management: Batch processing operating systems simplify job
management by automating job submission, scheduling, and execution.
5. Cost-effective: Batch processing operating systems can be cost-effective, as they
allow for the efficient use of resources and can help reduce errors and processing
time.
6. Scalability: Batch processing operating systems can easily handle a large
number of jobs, making them scalable for large organizations that require high-
volume data processing.
Disadvantages:
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.
Multiprogramming was developed in 1950s. It was first used in mainframe computing.
The major task of multiprogramming is to maximize the utilization of resources.
Multiprogramming is broadly classified into two types namely
Multiuser and Multitasking both are different in every aspect and multitasking is an operating
system that allows you to run more than one program simultaneously. The operating system
does this by moving each program in and out of memory one at a time. When a program runs
out of memory, it is temporarily stored on disk until it is needed again.
A multi-user operating system allows many users to share processing time on a powerful
central computer on different terminals. The operating system does this by quickly switching
between terminals, each receiving a limited amount of CPU time on the central computer.
Operating systems change so rapidly between terminals that each user appears to have
constant access to the central computer. If there are many users on such a system, the time it
takes for the central computer to respond may become more apparent.
The multiprogramming operating system has many features. The following are some of the
features of a multiprogramming operating system:
Disadvantages of Multiprogramming
1. Prior knowledge of scheduling algorithms is required.
2. If it has a large number of jobs, then long-term jobs will have to require a long
wait.
3. Memory management is needed in the operating system because all types of tasks
are stored in the main memory.
4. Using multiprogramming up to a larger extent can cause a heat-up issue.
A powerful central computer can be shared by many users from various terminals thanks
to a multiuser operating system. This is done by the operating system quickly switching
between terminals, each of which is allotted a certain amount of processor time on the
main computer. Each user appears to have continuous access to the main computer
because the operating system changes between terminals so quickly. On a system like this,
the number of users increases the likelihood that the response time of the central computer
will be more noticeable.
4)Time Sharing Operating System
In the above figure the user 5 is active state but user 1, user 2, user 3, and user 4 are in
a waiting state whereas user 6 is in a ready state.
1. Active State – The user’s program is under the control of the CPU. Only one
program is available in this state.
2. Ready State – The user program is ready to execute but it is waiting for its turn
to get the CPU. More than one user can be in a ready state at a time.
3. Waiting State – The user’s program is waiting for some input/output operation.
More than one user can be in a waiting state at a time.
Requirements of Time Sharing Operating System: An alarm clock mechanism to send
an interrupt signal to the CPU after every time slice. Memory Protection mechanism to
prevent one job’s instructions and data from interfering with other jobs.
What are some of the key features of a Time-Sharing Operating System?
A Time-Sharing Operating System’s key characteristics include the capacity to support
multiple concurrent users and the capacity to reduce response times for all users.
Additionally, because they permit multiple users to use the system without needing to
purchase individual licenses, time-sharing operating systems may be more cost-effective for
businesses.
The ability for multiple users to use the system at various terminals simultaneously is one
advantage of using a time-sharing operating system. All users’ response times can be cut
down, and the system’s resources can be used more effectively.
Additionally, because they permit multiple users to use the system without needing to
purchase individual licenses, time-sharing operating systems may be more cost-effective for
businesses.
Advantages
1. Each task gets an equal opportunity.
2. Fewer chances of duplication of software.
3. CPU idle time can be reduced.
Disadvantages
1. Reliability problem.
2. One must have to take of the security and integrity of user programs and data.
3. Data communication problem.
Answer:
A time-sharing operating system is an operating system design that allows multiple users or
processes to concurrently share the same system resources, such as the CPU, memory, and
peripherals. It enables each user or process to have the illusion of having dedicated access
to the system while effectively sharing resources in a time-sliced manner.
Answer:
In a time-sharing operating system, the CPU time is divided into small time intervals called
time slices or quantum. Each user or process is allocated a time slice during which it can
execute its tasks. The operating system switches between processes rapidly, giving the
illusion of parallel execution.
The operating system uses scheduling algorithms, such as round-robin or priority-based
scheduling, to determine which process should be allocated the CPU next. Context
switching, which involves saving and restoring the execution context of each process, is
performed to switch between pr
ocesses.
Answer:
Yes, time-sharing systems can prioritize certain processes or users based on specific
criteria. Scheduling algorithms often include priority-based scheduling, where processes
with higher priority are allocated more CPU time or given preference in execution. This
allows critical or interactive tasks to receive faster response times. However, it’s important
to balance priorities to ensure fairness and prevent lower priority processes from being
starved of resources.
5) Multiprocessor Systems
In a uni-processor system, only one process executes at a time. Multiprocessing is
the use of two or more CPUs (processors) within a single Computer system. The
term also refers to the ability of a system to support more than one processor within
a single computer system. Now since there are multiple processors available,
multiple processes can be executed at a time. These multi-processors share the
computer bus, sometimes the clock, memory and peripheral devices also. Multi
processing system’s working –
With the help of multiprocessing, many processes can be executed
simultaneously. Say processes P1, P2, P3 and P4 are waiting for
execution. Now in a single processor system, firstly one process will
execute, then the other, then the other and so on.
But with multiprocessing, each process can be assigned to a different
processor for its execution. If its a dual-core processor (2 processors), two
processes can be executed simultaneously and thus will be two times
faster, similarly a quad core processor will be four times as fast as a single
processor.
Why use multi processing –
The main advantage of multiprocessor system is to get more work done in
a shorter period of time. These types of systems are used when very high
speed is required to process a large volume of data. Multi processing
systems can save money in comparison to single processor systems
because the processors can share peripherals and power supplies.
It also provides increased reliability in the sense that if one processor fails,
the work does not halt, it only slows down. e.g. if we have 10 processors
and 1 fails, then the work does not halt, rather the remaining 9 processors
can share the work of the 10th processor. Thus the whole system runs only
10 percent slower, rather than failing altogether.
Multiprocessing refers to the hardware (i.e., the CPU units) rather than the software
(i.e., running processes). If the underlying hardware provides more than one
processor then that is multiprocessing. It is the ability of the system to leverage
multiple processors’ computing power.
6) Distributed Systems
Distributed System is a collection of autonomous computer systems that are
physically separated but are connected by a centralized computer network that is
equipped with distributed system software. The autonomous computers will
communicate among each system by sharing resources and files and performing the
tasks assigned to them.
Example of Distributed System:
Any Social Media can have its Centralized Computer Network as its Headquarters
and computer systems that can be accessed by any user and using their services will
be the Autonomous Systems in the Distributed System Architecture.
Cluster operating systems are a combination of software and hardware clusters. Hardware
clusters aid in the sharing of high-performance disks among all computer systems, while
software clusters give a better environment for all systems to operate. A cluster system
consists of various nodes, each of which contains its cluster software. The cluster software is
installed on each node in the clustered system, and it monitors the cluster system and ensures
that it is operating properly. If one of the clustered system's nodes fails, the other nodes take
over its storage and resources and try to restart.
Cluster components are generally linked via fast area networks, and each node executing its
instance of an operating system. In most cases, all nodes share the same hardware and
operating system, while different hardware or different operating systems could be used in
other cases. The primary purpose of using a cluster system is to assist with weather
forecasting, scientific computing, and supercomputing systems.
Advantages
Various advantages of Clustered Operating System are as follows:
1. High Availability - Although every node in a cluster is a standalone computer, the failure of a
single node doesn't mean a loss of service.
2. Cost Efficiency- When compared to highly reliable and larger storage mainframe
computers, these types of cluster computing systems are thought to be more cost-effective
and cheaper.
3. Additional Scalability- A cluster is set up in such a way that more systems could be added
to it in minor increments. Clusters may add systems in a horizontal fashion. It means that
additional systems could be added to clusters to improve their performance, fault tolerance,
and redundancy.
4. Fault Tolerance - Clustered systems are quite fault-tolerance, and the loss of a single node
does not result in the system's failure. They might also have one or more nodes in hot standby
mode, which allows them to replace failed nodes.
5. Performance -The clusters are commonly used to improve the availability and
performance over the single computer systems, whereas usually being much more cost-
effective than the single computer system of comparable speed or availability.
6. Processing Speed - The processing speed is also similar to mainframe systems and other
types of supercomputers on the market.
Disadvantages
Various disadvantages of the Clustered Operating System are as follows:
1. Cost-Effective
One major disadvantage of this design is that it is not cost-effective. The cost is high, and the
cluster will be more expensive than a non-clustered server management design since it
requires good hardware and a design.
2. Required Resources
Clustering necessitates the use of additional servers and hardware, making monitoring and
maintenance difficult. As a result, infrastructure must be improved.
3. Maintenance
It isn't easy to system establishment, monitor, and maintenance this system.
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, Robot etc.
The real-time operating systems can be of 3 types –
Advantages:
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.
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.
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.
Multiprogrammin Multiprocessin
Feature Multitasking Multithreading
g g
Running
Running Running
multiple
Running multiple multiple multiple
tasks
Definition programs on a threads within processes on
(applications
single CPU a single task multiple CPUs
) on a single
(application) (or cores)
CPU
Uses
priority- Uses priority-
Uses round-robin Each process
based or based or time-
or priority-based can have its
time-slicing slicing
Scheduling scheduling to own
scheduling scheduling to
allocate CPU scheduling
to allocate allocate CPU
time to programs algorithm
CPU time to time to threads
tasks
Each task
Each program has Threads share Each process
Memory has its own
its own memory memory space has its own
Management memory
space within a task memory space
space
Uses inter-
Uses Uses thread
process
message synchronizatio
Inter-Process Uses message communicatio
passing or n mechanisms
Communicatio passing or shared n mechanisms
shared (e.g., locks,
n (IPC) memory for IPC (e.g., pipes,
memory for semaphores)
sockets) for
IPC for IPC
IPC