Unit III OS (Ecse)
Unit III OS (Ecse)
• A system software that intermediates between the user of computer and the computer hardware.
• That is user gives a command and the OS translates the command into a form that the machine can
understand and execute.
Objectives:
To make the computer system easy to use for the user.
OS hides the working of hardware from the user and makes it convenient for the user to use the machine.
For example: displaying the apps user interface, loading program into memory, using I/O devices.
The user need not get into the details.
To use the computer H/W in an efficient way.
This includes managing the communication between different devices, controlling the sequence and
execution of processes, allocating space on HD, etc. This is done by handling the details of operations of H/W.
Functions of an Operating System:
Resource Allocator:
Functions of an Operating System:
Memory Management:
In a computer there are multiple processes executing at the same time.
Every process that executes requires some memory.
Memory management is one of the tasks done by OS. It the process of allocating some amount of main
memory to the process.
On completion of the process execution, the memory is de-allocated and allocated to some other process.
Different processes that are allocated memory should not interfere. This requires memory protection and
sharing mechanism.
Processor Management:
A process is a program in a state of execution. It is a unit of work for OS. A program can have two or
more processes running.
To accomplish a task, a process needs to have access to many system resources like I\O devices,
CPU, etc. therefore, process management function of an OS handles allocation of resources to the
process in an efficient manner.
In multiprogramming, OS keeps the track of order in which processes need to execution and also
the execution time of the process. This component is known as process scheduler.
There also another program which keeps track of the status of the process known as traffic
controller.
The concurrent execution of process requires process synchronization.
Device Management:
OS keeps track of every device connected to the system.
It manages device communication using the device drivers.
It allocates particular device, when required by the process and also keeps track of time required to
the particular device accessibility by the process.
It de-allocates when not required.
File Management:
File system consists of directories and files.
OS keeps track of where the information is stored, status of file, user access, etc.
User interaction or command interpreter:
User interacts with system through OS.
User interface can be GUI or CUI.
Through this interface user can interact with applications and computer H/W.
Booting:
Booting is the process of restarting the computer.
We have cold booting and warm booting.
In warm booting we use OS to restart the system.
Security:
OS provides password mechanism to protect user data.
It also safeguards the system from unauthorized access.
Control over system performance:
OS keeps track of overall system health by calculating the response time of each process.
Job accounting:
OS maintains a record of all the resources used by processes and users using the system.
Error Detecting Aids:
OS constantly monitors system for any errors and avoid malfunctioning.
Coordination between software and other users:
OS provides coordination between different softwares like interpreters, compilers,etc.
Performs basic computer task:
The management of various peripheral devices is carried out by OS.
Most OS are plug and play.
Network management:
OS provides network connectivity and manages communication between computers on a network.
Also manages network security by providing firewalls and other security measures.
Batch Operating System:
Description:
• The batch-processing operating system was very popular in the 1970s as people were used to having a
single computer which was called a mainframe.
• In batch operating system the jobs were performed in batches. This means Jobs having similar requirements
are grouped and executed as a group to speed up processing.
• Users using batch operating systems do not interact with the computer directly. Each user prepares their job
using an offline device for example a punch card and submits it to the computer operator.
• Once the programmers have left their programs with the operator, they sort the programs with similar
needs into batches.
Example of Batch Operating System
Some examples of batch-processing operating systems include:
• IBM’s z/OS
• Unisys MCP
• Burroughs MCP/BCS
These systems are usually used in large organizations that require high-volume data processing, such as
banks, airlines, and government agencies, pharmaceuticals.
Advantages:
• Resource Efficiency: These systems improve the use of computation resources by processing jobs in groups
and scheduling them during stages of resource accessibility.
• High Throughput: Batch processing systems can handle and complete a large number of tasks quickly.
• Cost Efficiency: By producing well-organized use of resources and reducing processing time and errors,
batch processing systems can be a cost-effective option.
Disadvantages:
• Limited functionality: A batch operating system can solve only simple tasks not solve more complex
tasks. this can make them difficult to use for certain tasks, like managing files or software.
• Security issues: Batch operating systems are not more secure because they are not typically used for
day-to-day tasks, so they are not as secure as more common operating systems. This can lead to
security risks if the system is used by people who should not have access to it.
• Interruptions Batch systems can be interrupted frequently, which can lead to missed deadlines or
mistakes.
• Inefficiency: Batch systems are often slow and difficult to use, which can lead to inefficiency in the
workplace.
Multiprogramming:
Description:
• Multiprogramming means more than one program can be active at the same time.
• The idea of multiprogramming is to assign CPUs to other processes while the current process might not be
finished.
• Context switch between process. Switching happens when current process undergoes waiting state.
Disadvantages of Multiprogramming
• Prior knowledge of scheduling algorithms (An algorithm that decides which next process will get hold of
the CPU) is required.
• If it has a large number of jobs, then short-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.
Multitasking Operating system:
It is a multiprogramming OS with facility of scheduling algorithm.
Types of Multitasking:
preemptive multitasking: the operating system can initiate a context switching from the running process to
another process. In other words, the operating system allows stopping the execution of the currently running
process and allocating the CPU to some other process.
The OS uses some criteria to decide for how long a process should execute before allowing another process to use
the operating system. The mechanism of taking control of the operating system from one process and giving it to
another process is called preempting or preemption.
cooperative multitasking, the operating system never initiates context switching from the running process
to another process. A context switch occurs only when the processes voluntarily yield control periodically or
when idle or logically blocked to allow multiple applications to execute simultaneously. Also, in this
multitasking, all the processes cooperate for the scheduling scheme to work.
Advantages:
• Multiple programs can be executed simultaneously.
• Comes with proper memory management.
Disadvantages of Multiprogramming
• The system gets heated in case of heavy programs multiple times.
Multiprocessing Operating System:
Description:
• A type of operating system that makes use of more than one CPU to improve performance.
• Multiple processors work in parallel to perform the given task.
• All the available processors are connected to peripheral devices, computer buses, physical memory, and clocks.
Examples:
UNIX, LINUX, and Solaris are the most widely used multi-processing operating system.
Advantages
• Failure of one processor does not affect the functioning of other processors.
• It increases the throughput of the system.
• It divides all the workload equally to the available processors.
• Makes use of available resources efficiently.
Time sharing Operating System:
Description:
• Computer systems that were originally built for batch processing have been converted to time-sharing systems.
• In the late 1950s and early 1960s, time-sharing was created to make better use of expensive processor time.
• Time sharing OS allows many users to use the computer resources simultaneously. These systems are also called
multitasking systems.
• Users access the system simultaneously through different terminals.
• It is an extension of multiprogramming.
• Time slicing is a technique, where at each clock interrupt, the OS regains the control and assigns the processor to another
user.
• The primary distinction between Batch Systems and Time-Sharing Systems is that with batch systems, the goal is to
maximise processor utilisation. In Time-Sharing Systems, on the other hand, the goal is to reduce reaction time.
Advantages:
• Each user task gets an equal opportunity.
• Provides minimum response time for multiple users.
• Reduce CPU idle time similar to multiprogramming.
• Resource sharing leads less cost.
• Improved productivity.
• Improved user experience than compared to batch OS.
Disadvantages:
• It does not completely secure the user programs and data from others.
• Expensive to develop as it very complex to implement.
• Sometimes switching between jobs may crash the system.
Examples:
TSO(Time Sharing Option):
• Introduced in 1960 by IBM for its mainframe system.
• It allows multiple users to access the system simultaneously, to run their applications.
IBM VM/CMS:
• Introduced in 1972.
• Provides a virtual working environment i.e, every user has their own instances of OS and applications.
Windows Terminal Services:
• Terminal service is called as remote desktop service.
• Remote Desktop Services allows computers on a local area network (LAN) to connect to a server (also called a remote
computer) and run programs located on the server.
Distributed Operating System:
Description:
• A distributed operating system is one in which several computer systems connected through a single communication
channel.
• These systems have their individual processors and memory.
• These processors communicate through high-speed buses or telephone lines.
• The individual components or systems of the network are nodes.
• Systems connected on distributed operating are loosely coupled systems because memory is not shared among other
nodes.
Advantages:
• Load balancing i.e, work is evenly distributed.
• Computation speedup.
• Need for specialized hardware at different location.
• Instead of importing files, process can be executed at the available location.
Disadvantages:
• Failure one network will stop entire communication.
• To establish this OS, language is not well defined.
• These types of systems are very complex and very expensive to implement.
Network Operating System:
Description:
• It creates and manages the accounts of users on the network.
• It controls access to resources in the network.
• It configures and manages the resources on the network.
• It implements protocols over the network for better implementation of network functionalities.
• It facilitates a secure connection between two workstations by access control and user authentication.
Advantages:
• Highly stable centralized servers.
• Upgradation of technology is easier.
• Server access can be done remotely.
• Security is handled by server.
Disadvantages:
• Servers are costly.
• Need to maintain and upgrade on a regular basis.
Real time Operating System:
Description:
• These systems serve the real time systems are also
called time-bound systems.
• The response time (the time required to process and respond
to inputs for these systems is very less.
• Unlike general-purpose operating systems, such as Windows or Linux,
which prioritize resource sharing, RTOS prioritizes responsiveness.
Types of Real-Time Systems
• Hard Real-Time Systems:
• In hard real-time systems, missing a deadline can have catastrophic consequences.
• These systems are used in critical applications such as aerospace, medical devices, and industrial control systems,
where timing accuracy is of utmost importance.
• Soft Real-Time Systems:
• Soft real-time systems have more relaxed timing requirements.
• While missing a deadline in a soft real-time system may not result in catastrophic failure, it can lead to degraded
performance or reduced system efficiency. Multimedia streaming, video games, and interactive applications often fall
into this category.
Device and Resource Management:
Resource Management:
A process requires resources like main memory, access to disk drives or file access.
OS allocates resources to the processes if they are available and control is given to the CPU. Otherwise the
process needs to wait until the resource is available.
Device Management:
Device management is the process of controlling input/output devices like keyboard, mouse, camcorder, etc.
OS has special program called device controller which keeps track of available devices.