Unit-1 Os
Unit-1 Os
Operating System lies in the category of system software. It basically manages all the resources of the
computer. An operating system acts as an interface between the software and different parts of the
computer or the computer hardware. The operating system is designed in such a way that it can manage
the overall resources and operations of the computer.
Operating System is a fully integrated set of specialized programs that handle all the operations of the
computer. It controls and monitors the execution of all other programs that reside in the computer, which
also includes application programs and other system software of the computer. Examples of Operating
Systems are Windows, Linux, Mac OS, etc.
An Operating System (OS) is a collection of software that manages computer hardware resources and
provides common services for computer programs. The operating system is the most important type of
system software in a computer system.
An operating system is software that enables applications to interact with a computer's hardware. The
software that contains the core components of the operating system is called the kernel.
Some popular Operating Systems include Linux Operating System, Windows Operating System, VMS,
OS/400, AIX, z/OS, etc. Today, Operating systems are found almost in every device like mobile phones,
personal computers, mainframe computers, automobiles, TV, Toys etc.
The purpose of this operating system was mainly to transfer control from one job to another as soon as the
job was completed. It contained a small set of programs called the resident monitor that always resided in
one part of the main memory. The remaining part is used for servicing jobs.
Advantages of Batch OS
The use of a resident monitor improves computer efficiency as it eliminates CPU time between two jobs.
Disadvantages of Batch OS
1. Starvation
Batch processing suffers from starvation.
For Example:
There are five jobs J1, J2, J3, J4, and J5, present in the batch. If the execution time of J1 is very high, then
the other four jobs will never be executed, or they will have to wait for a very long time. Hence the other
processes get starved.
2. Not Interactive
Batch Processing is not suitable for jobs that are dependent on the user's input. If a job requires the input
of two numbers from the console, then it will never get it in the batch processing scenario since the user is
not present at the time of execution.
Advantages of Multiprogramming OS
Throughout the system, it increased as the CPU always had one program to execute.
Disadvantages of Multiprogramming OS
Multiprogramming systems provide an environment in which various systems resources are used
efficiently, but they do not provide any user interaction with the computer system.
o Increased reliability: Due to the multiprocessing system, processing tasks can be distributed
among several processors. This increases reliability as if one processor fails, the task can be given
to another processor for completion.
o Increased throughout: As several processors increase, more work can be done in less.
o Multiprocessing operating system is more complex and sophisticated as it takes care of multiple
CPUs simultaneously.
Multitasking Operating System is simply a multiprogramming Operating System with having facility of a
Round-Robin Scheduling Algorithm. It can run multiple programs simultaneously.
There are two types of Multi-Tasking Systems which are listed below.
● Preemptive Multi-Tasking
● Cooperative Multi-Tasking
Advantages of Multi-Tasking Operating System
● Multiple Programs can be executed simultaneously in Multi-Tasking Operating System.
● It comes with proper memory management.
Each task is given some time to execute so that all the tasks work smoothly. Each user gets the
time of the 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.
Advantages of Time-Sharing OS
● Each task gets an equal opportunity.
● Fewer chances of duplication of software.
● CPU idle time can be reduced.
● Resource Sharing: Time-sharing systems allow multiple users to share hardware resources
such as the CPU, memory, and peripherals, reducing the cost of hardware and increasing
efficiency.
● Improved Productivity: Time-sharing allows users to work concurrently, thereby reducing
the waiting time for their turn to use the computer. This increased productivity translates to
more work getting done in less time.
● Improved User Experience: Time-sharing provides an interactive environment that allows
users to communicate with the computer in real time, providing a better user experience than
batch processing.
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.
● High Overhead: Time-sharing systems have a higher overhead than other operating systems
due to the need for scheduling, context switching, and other overheads that come with
supporting multiple users.
● Complexity: Time-sharing systems are complex and require advanced software to manage
multiple users simultaneously. This complexity increases the chance of bugs and errors.
● Security Risks: With multiple users sharing resources, the risk of security breaches increases.
Time-sharing systems require careful management of user access, authentication, and
authorization to ensure the security of data and software.
These types of operating system are a recent advancement in the world of computer technology
and are being widely accepted all over the world and, that too, at 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 systems’ 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 i.e., remote access is
enabled within the devices connected in that network.
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 to 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.
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.
Types of Real-Time Operating Systems
● Hard Real-Time Systems: Hard Real-Time OSs are meant for applications where time
constraints are very strict and even the shortest possible delay is not acceptable. These
systems are built for saving life like automatic parachutes or airbags which are required to be
readily available in case of an accident. Virtual memory is rarely found in these systems.
● Soft Real-Time Systems: These OSs are for applications where time-constraint is less strict.
Advantages of RTOS
● Maximum Consumption: Maximum utilization of devices and systems, thus more output
from all the resources.
● Task Shifting: The time assigned for shifting tasks in these systems is very less. For
example, in older systems, it takes about 10 microseconds in shifting from one task to
another, and in the latest systems, it takes 3 microseconds.
● Focus on Application: Focus on running applications and less importance on applications
that are in the queue.
● Real-time operating system in the embedded system: Since the size of programs is 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 a
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 signal
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.
1. Processor (CPU):
o The operating system must support the type of CPU architecture used in the
computer (e.g., x86, x64, ARM).
o Support for multiple cores and threading is also important for efficient
multitasking.
2. Memory (RAM):
o Adequate RAM capacity to run the operating system and applications smoothly.
o Operating systems have minimum RAM requirements that must be met for
installation and optimal performance.
3. Storage (Hard Drive or SSD):
o Sufficient storage space for the operating system, applications, and user data.
o Compatibility with the storage interface (e.g., SATA, NVMe) and file system
(e.g., NTFS, exFAT).
4. Graphics Processing Unit (GPU):
o Basic display support for rendering the graphical user interface (GUI).
o More advanced support may be required for 3D rendering, video playback, and
GPU-accelerated tasks.
5. Input Devices:
o Support for keyboards and mice, including USB and Bluetooth interfaces.
o Touch screen support for devices like tablets and laptops.
6. Network Interfaces:
o Support for Ethernet and/or Wi-Fi connections.
o Drivers for network cards to enable internet connectivity.
1. Peripheral Devices:
o Compatibility with USB devices (e.g., printers, scanners, external drives).
o Support for Bluetooth devices such as headphones, speakers, and input devices.
2. Power Management:
o Capabilities for managing power states (sleep, hibernate) to conserve battery life
on laptops and mobile devices.
o Compatibility with ACPI (Advanced Configuration and Power Interface) for
managing hardware power states.
3. Security Features:
o Support for hardware-based security features like Secure Boot and Trusted
Platform Module (TPM).
o Integration with antivirus software and firewall capabilities.
4. System Firmware (BIOS/UEFI):
o Compatibility with the system's firmware for booting the operating system and
hardware initialization.
o Secure and reliable boot process support.
⮚ SERVICES PROVIDED BY OS
● Program execution
● Input Output Operations
● Communication between Process
● File Management
● Memory Management
● Process Management
● Security and Privacy
● Resource Management
● User Interface
● Networking
● Error handling
● Time Management
Program Execution
It is the Operating System that manages how a program is going to be executed. It loads the
program into the memory after which it is executed. The order in which they are executed
depends on the CPU Scheduling Algorithms. A few are FCFS, SJF, etc. When the program is in
execution, the Operating System also handles deadlock i.e. no two processes come for execution
at the same time. The Operating System is responsible for the smooth execution of both user and
system programs. The Operating System utilizes various resources available for the efficient
running of all types of functionalities.
Input Output Operations
Operating System manages the input-output operations and establishes communication between
the user and device drivers. Device drivers are software that is associated with hardware that is
being managed by the OS so that the sync between the devices works properly. It also provides
access to input-output devices to a program when needed.
File Management
The operating system helps in managing files also. If a program needs access to a file, it is the
operating system that grants access. These permissions include read-only, read-write, etc. It also
provides a platform for the user to create, and delete files. The Operating System is responsible
for making decisions regarding the storage of all types of data or files, i.e, floppy disk/hard
disk/pen drive, etc. The Operating System decides how the data should be manipulated and
stored.
Memory Management
Let’s understand memory management by OS in simple way. Imagine a cricket team with limited
number of player . The team manager (OS) decide whether the upcoming player will be in
playing 11 ,playing 15 or will not be included in team , based on his performance . In the same
way, OS first check whether the upcoming program fulfil all requirement to get memory space or
not ,if all things good, it checks how much memory space will be sufficient for program and then
load the program into memory at certain location. And thus , it prevents program from using
unnecessary memory.
Process Management
Let’s understand the process management in unique way. Imagine, our kitchen stove as the
(CPU) where all cooking(execution) is really happen and chef as the (OS) who uses
kitchen-stove(CPU) to cook different dishes(program). The chef(OS) has to cook different
dishes(programs) so he ensure that any particular dish(program) does not take long
time(unnecessary time) and all dishes(programs) gets a chance to cooked(execution) .The
chef(OS) basically scheduled time for all dishes(programs) to run kitchen(all the system)
smoothly and thus cooked(execute) all the different dishes(programs) efficiently.
User Interface
User interface is essential and all operating systems provide it. Users either interface with the
operating system through the command-line interface or graphical user interface or GUI. The
command interpreter executes the next user-specified command.
A GUI offers the user a mouse-based window and menu system as an interface.
Networking
This service enables communication between devices on a network, such as connecting to the
internet, sending and receiving data packets, and managing network connections.
Error Handling
The Operating System also handles the error occurring in the CPU, in Input-Output devices, etc.
It also ensures that an error does not occur frequently and fixes the errors. It also prevents the
process from coming to a deadlock. It also looks for any type of error or bugs that can occur
while any task. The well-secured OS sometimes also acts as a countermeasure for preventing any
sort of breach of the Computer System from any external source and probably handling them.
Time Management
Imagine traffic light as (OS), which indicates all the cars(programs) whether it should be
stop(red)=>(simple queue), start(yellow)=>(ready queue),move(green)=>(under execution) and
this light (control) changes after a certain interval of time at each side of the road(computer
system) so that the cars(program) from all side of road move smoothly without traffic.
Design goals are the objectives of the operating system. They must be met to fulfill design
requirements and they can be used to evaluate the design. These goals may not always be
technical, but they often have a direct impact on how users perceive their experience with
an operating system. While designers need to identify all design goals and prioritize them,
they also need to ensure that these goals are compatible with each other as well as
compatible with user expectations or expert advice
Designers also need to identify all possible ways in which their designs could conflict with
other parts of their systems—and then prioritize those potential conflicts based on
cost-benefit analysis (CBA). This process allows for better decision-making about what
features make sense for inclusion into final products versus those which would require
extensive rework later down the road. It’s also important to note that CBA is not just about
financial costs; it can also include other factors like user experience, time to market, and
the impact on other systems.
The process of identifying design goals, conflicts, and priorities is often referred to as
“goal-driven design.” The goal of this approach is to ensure that each design decision is
made with the best interest of users and other stakeholders in mind.
Implementation: