0% found this document useful (0 votes)
12 views21 pages

UNIT1 CA213

The document provides an overview of operating systems, defining their role as an interface between users and hardware while managing resources and processes. It discusses various components, types, and objectives of operating systems, including examples like Windows and Linux, and outlines different structures such as monolithic and micro-kernel. Additionally, it highlights the advantages and disadvantages of various operating system types, including batch, multiprogramming, time-sharing, real-time, multiprocessing, distributed, and parallel systems.

Uploaded by

24zaid7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views21 pages

UNIT1 CA213

The document provides an overview of operating systems, defining their role as an interface between users and hardware while managing resources and processes. It discusses various components, types, and objectives of operating systems, including examples like Windows and Linux, and outlines different structures such as monolithic and micro-kernel. Additionally, it highlights the advantages and disadvantages of various operating system types, including batch, multiprogramming, time-sharing, real-time, multiprocessing, distributed, and parallel systems.

Uploaded by

24zaid7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

DEPARTMENT OF COMPUTER APPLICATION

PRINCIPLES OF OPERATING SYSTEM


(CA213)
Notes

UNIT - 1

 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.
 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 can be defined as an interface between user and hardware.
It is responsible for the execution of all the processes, Resource
Allocation, CPU management, File Management and many other tasks.”

The purpose of an operating system is to provide an environment in which a user can execute
programs in convenient and efficient manner.

By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 1
By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 2
By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 3
By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 4
SERVICES OF OPERATING SYSTEM

By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 5
By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 6
By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 7
The process operating system as User Interface:
1. User
2. System and application programs
3. Operating system
4. Hardware
Every general-purpose computer consists of hardware, an operating system(s), system
programs, and application programs. The hardware consists of memory, CPU, ALU, I/O
devices, peripheral devices, and storage devices. The system program consists of compilers,
loaders, editors, OS, etc. The application program consists of business programs and
database programs.

Every computer must have an operating system to run other programs. The operating
system coordinates the use of the hardware among the various system programs and
application programs for various users. It simply provides an environment within which
other programs can do useful work.

The operating system is a set of special programs that run on a computer system that allows
it to work properly. It performs basic tasks such as recognizing input from the keyboard,
keeping track of files and directories on the disk, sending output to the display screen, and
controlling peripheral devices.

By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 8
Components of an Operating Systems

There are two basic components of an Operating System.


 Shell
 Kernel

Shell
Shell is the outermost layer of the Operating System and it handles the interaction with the
user. The main task of the Shell is the management of interaction between the User and OS.
Shell provides better communication with the user and the Operating System Shell does it
by giving proper input to the user it also interprets input for the OS and handles the output
from the OS. It works as a way of communication between the User and the OS.

Kernel
The kernel is one of the components of the Operating System which works as a core
component. The rest of the components depends on Kernel for the supply of the important
services that are provided by the Operating System. The kernel is the primary interface
between the Operating system and Hardware.
Functions of Kernel
The following functions are to be performed by the Kernel.
 It helps in controlling the System Calls.
 It helps in I/O Management.
 It helps in the management of applications, memory, etc.

Types of Kernel
There are four types of Kernel that are mentioned below.
 Monolithic Kernel
 Microkernel
 Hybrid Kernel
 Exokernel

Examples of Operating Systems


 Windows (GUI-based, PC)
 GNU/Linux (Personal, Workstations, ISP, File, and print server, Three-tier
client/Server)
 macOS (Macintosh), used for Apple’s personal computers and workstations (MacBook,
iMac).
 Android (Google’s Operating System for smartphones/tablets/smartwatches)
 iOS (Apple’s OS for iPhone, iPad, and iPod Touch)

By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 9
Objectives of Operating Systems
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.

By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 10
Classification(Types) of Operating system

Batch Operating System

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.

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

Example of Batch based Operating System: Bank Statements.

By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 11
Multi Programming Operating System
Main objective of multiprogramming is to maximize CPU utilization.

More than one process can reside in main memory which are ready to execute i.e. more than one process
is in ready state.

In this system if any running process performs I/O or other event which does not require CPU, then
instead of sitting idle, CPU performs context switching and picks another process for execution

Advantages

High CPU utilization

Less wanting time, response time etc.

Useful in current scenario when load is high

Disadvantages

Process scheduling is difficult

Main memory management is required

Problems like memory fragmentation may occur

Time-Sharing or Multi Tasking 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.

By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 12
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.

By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 13
 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.

Real-Time Operating System


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.

Two types of Real-Time Operating System which are as follows:

Hard Real-Time Systems:

These 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 any accident. Virtual memory is rarely found in these systems.

Soft Real-Time Systems:

These OSs are for applications where for time-constraint is less strict.

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.

By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 14
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.

Memory Allocation: Memory allocation is best managed in these types of systems.

Error Free: These types of systems are error-free.

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.

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.

Multiprocessing System
A system is called multiprocessing system if two or more CPU within a single computer communicate
with each other and share system bus memory and I/O devices.

It provides true parallel execution of processes.

Type of Multiprocessing system

Asymmetric Multiprocessing System: In this system, each processor is assigned a specific task. A
master processor controls the system. The other processors called slave processors either look to master for
instruction or have predefined tasks i.e. master-slave relationship hold in this type of system.

Symmetric Multiprocessing System: In this system each processor performs all tasks within the
operating system i.e. all processor are peers, no master-slaver relationship exists between processors.

Distributed Operating System


These types of operating system is 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

By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 15
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.

Advantages of Distributed Operating System


 Failure of one will not affect the other network communication, as all systems are
independent of 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 is used 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.

Parallel Systems

Parallel Systems are designed to speed up the execution of programs by dividing the
programs into multiple fragments and processing these fragments at the same time. Flynn
has classified computer systems into four types based on parallelism in the instructions and
in the data streams.
1. Single Instruction stream, single data stream
2. Single Instruction stream, multiple data stream
3. Multiple Instruction stream, single data stream
4. Multiple Instruction stream, multiple data stream
Advantages of Parallel Systems:
 High Performance: Parallel systems can execute computationally intensive tasks more
quickly compared to single processor systems.

By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 16
 Cost Effective: Parallel systems can be more cost-effective compared to distributed
systems, as they do not require additional hardware for communication.
Disadvantages of Parallel Systems:
 Limited Scalability: Parallel systems have limited scalability as the number of
processors or cores in a single computer is finite.
 Complexity: Parallel systems are more complex to program and debug compared to
single processor systems.
 Synchronization Overhead: Synchronization between processors in a parallel system
can add overhead and impact performance.

By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 17
Structures of Operating Systems
The operating system can be implemented with the help of various structures. The structure of
the OS depends mainly on how the various standard components of the operating system are
interconnected and melded into the kernel.

Depending on this, we have the following structures in the operating system.

1. Simple/Monolithic Structure
2. Micro-Kernel Structure
3. Hybrid-Kernel Structure
4. Exo-Kernel Structure
5. Layered Structure
6. Modular Structure
7. Virtual Machines

Simple/Monolithic structure

Such operating systems do not have well-defined structures and are small, simple,
and limited. The interfaces and levels of functionality are not well separated. MS-
DOS is an example of such an operating system.

In MS-DOS, application programs are able to access the basic I/O routines. These
types of operating systems cause the entire system to crash if one of the user
programs fails.

A diagram of the structure of MS-DOS is shown below.

By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 18
Micro-kernel Structure

This structure designs the operating system by removing all non-essential


components from the kernel and implementing them as system and user programs.
This results in a smaller kernel called the micro-kernel. Advantages of this structure
are that all new services need to be added to user space and does not require the
kernel to be modified. Thus it is more secure and reliable as if a service fails, then
rest of the operating system remains untouched. Mac OS is an example of this
type of OS.

Hybrid-Kernel Structure

Hybrid-kernel structure is nothing but just a combination of both monolithic-kernel


structure and micro-kernel structure. Basically, it combines properties of both
monolithic and micro-kernel and make a more advance and helpful approach. It
implement speed and design of monolithic and modularity and stability of micro-
kernel structure.

Exo-Kernel Structure

Exokernel is an operating system developed at MIT to provide application-level


management of hardware resources. By separating resource management from
protection, the exokernel architecture aims to enable application-specific
customization. Due to its limited operability, exo kernel size typically tends to be
minimal.
The OS will always have an impact on the functionality, performance, and scope of
the apps that are developed on it because it sits in between the software and the
hardware. The exokernel operating system makes an attempt to address this
problem by rejecting the notion that an operating system must provide abstractions
upon which to base applications. The objective is to limit developers use of
abstractions as little as possible while still giving them freedom.

By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 19
Layered structure

An OS can be broken into pieces and retain much more control over the system. In
this structure, the OS is broken into a number of layers (levels). The bottom layer
(layer 0) is the hardware, and the topmost layer (layer N) is the user interface.
These layers are so designed that each layer uses the functions of the lower-level
layers. This simplifies the debugging process, if lower-level layers are debugged
and an error occurs during debugging, then the error must be on that layer only, as
the lower-level layers have already been debugged.
The main disadvantage of this structure is that at each layer, the data needs to be
modified and passed on which adds overhead to the system. Moreover, careful
planning of the layers is necessary, as a layer can use only lower-level
layers. UNIX is an example of this structure.

VMs (virtual machines)

Virtual Machine abstracts the hardware of our personal computer such as CPU,
disk drives, memory, NIC (Network Interface Card) etc, into many different
execution environments as per our requirements, hence giving us a feel that each
execution environment is a single computer. For example, VirtualBox.
When we run different processes on an operating system, it creates an illusion that
each process is running on a different processor having its own virtual memory,
with the help of CPU scheduling and virtual-memory techniques. There are
additional features of a process that cannot be provided by the hardware alone like
system calls and a file system. The virtual machine approach does not provide
these additional functionalities but it only provides an interface that is same as

By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 20
basic hardware. Each process is provided with a virtual copy of the underlying
computer system.

Advantages:
1. There are no protection problems because each virtual machine is completely
isolated from all other virtual machines.
2. Virtual machine can provide an instruction set architecture that differs from real
computers.
3. Easy maintenance, availability and convenient recovery.
Disadvantages:
1. When multiple virtual machines are simultaneously running on a host computer,
one virtual machine can be affected by other running virtual machines,
depending on the workload.
2. Virtual machines are not as efficient as a real one when accessing the
Hardware.

By-FARHA ZIA
DEPARTMENT OF COMPUTER APPLICATION,IUL Page 21

You might also like