OS - UNIT - 1 - PPT Notes
OS - UNIT - 1 - PPT Notes
Operating Systems
Unit-I
Introduction:
Concept of Operating Systems
Generations of Operating systems
Types of Operating Systems
OS Services
System Calls
Structure of an OS - Layered, Monolithic, Microkernel Operating Systems
Concept of Virtual Machine
Case Studies-Unix system.
G.Sravan Rao, Assistant Professor
E. Kiran Kumar, Asst.Profesor(CSE), GNITC.
R22_CSE( AI&ML )
Concept to OS Operating Systems Notes
An operating system is an interface between the computer user and the hardware device.
An operating system is a construct that allows the user application programs to interact with the system
hardware.
Operating system by itself does not provide any function but it provides an atmosphere in which different
applications and programs can do useful work.
Operating system coordinates between the hardware and the application programs.
One or more CPUs, device controllers connect through common bus providing access to shared memory
Concurrent execution of CPUs and devices competing for memory cycles
I/O devices and the CPU can execute concurrently
Each device controller is in charge of a particular device type
Each device controller has a local buffer
CPU moves data from/to main memory to/from local buffers
I/O is from the device to local buffer of controller
Device controller informs CPU that it has finished its operation by causing an interrupt
The operating system mainly controls the allocation and use of the computing System’s resources among the
various user and tasks.
It mainly provides an interface between the computer hardware and the programmer that simplifies and
makes feasible for coding, creation of application programs and debugging
In general, an operating system has three major goals. These are:
Convenience
An operating system should make a computer easy and convenient to use. The interface should make the
interaction with a computer system simple and hassle free.
Efficiency
The operating system should provide hardware resources to the different application programs in such a way to
maximize efficiency.
Evolution Ability
The operating system should not hinder the evolution of the computer system. This means that any new
functions should be easily integrated with the computer without disrupting the working of the 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.
In these, the jobs with similar needs were batched up and executed together. Then the results of these jobs were
sent back to the respective programmer.
Advantages:
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:
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
Examples of Batch based Operating System: Payroll System, Bank Statements, etc.
To overcome the problem of under utilization of CPU and main memory, the multi-programming was
introduced. The multi-programming is interleaved execution of multiple jobs by the same computer.
In Multiprogramming system, CPU will never be idle and keeps on processing. In this the operating system
picks up and begins to execute one of the jobs from memory. Once this job needs an I/O operation operating
system switches to another job (CPU and OS always busy).
Advantages
High and efficient CPU utilization.
User feels that many programs are allotted CPU almost simultaneously.
Disadvantages
CPU scheduling is required.
To accommodate many jobs in memory, memory management is required.
In this operating system allows multiple users to share the system simultaneously.
Each user is provided a time slice and the processor switches rapidly among the users according to it.
More than one processes are being executed at a particular time with the help of the time-sharing concept.
So, in the time-sharing environment, we decide a time that is called time quantum and when the process starts
its execution then the execution continues for only that amount of time and after that, other processes will be
given chance for that amount of time only. In the next cycle, the first process will again come for its execution
and it will be executed for that time quantum only and again next process will come. This process will
continue.
TQ= 1 min
TQ = time quantum
TASK 1
TQ= 1 min
TASK 2
TASK 3
Advantages:
Since equal time quantum is given to each process, so each process gets equal opportunity to execute.
CPU will be busy in most of the cases.
Provides the advantage of quick response.
Avoids duplication of software.
Reduces CPU idle time.
Disadvantages:
Reliability problem
One must have to take care of the security and integrity of user programs and data
Data communication problem
These operating systems have multiple processors working together in parallel. These processors share the
system resources such as bus, clock, memory etc.
The main advantage of multiprocessor system is to get more work done in a shorter period of time. Moreover,
multiprocessor systems prove more reliable in the situations of failure of one processor.
Example: Windows NT, 2000, XP, and Unix
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 and executed
based on the priority.
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.
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.
Examples of Real-Time Operating Systems are: Scientific experiments, medical imaging systems, industrial control
systems, weapon systems, robots, air traffic control systems, etc.
G.Sravan Rao, Assistant Professor
E. Kiran Kumar, Asst.Profesor(CSE), GNITC.
R22_CSE( AI&ML )
Network Operating System Operating Systems Notes
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. (with different operating 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.
It is an Operating System for mobiles, tablets, 2-in-1 PC’s (that can be convert to laptop mode or detach and
work as tablet mode.
Mobile OS have majority use since (2017)
Previously (1993)---Embedded systems
1993-1999---Pen Point OS (APRIL 1993)
APPLE LAUNCHES (NEWTON OS)
1994---MARCH---Magic Cap OS
AUG---first smart phone(IBM) with touch screen
1996----march ---palm OS
AUG---Nokia---(PEN/GEOS)
2019------jan /windows 10----IOS/android
September—Apple-ios13-----Iphone11
Smart Watch OS6---ipad---7th Gen
And soon………..
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.
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 i.e., remote access is enabled within the devices connected in that network.
Advantages:
Failure of one system will not affect the other network communication, as all systems are independent from
each other
Electronic mail increases the data exchange speed (sending the data through Email)
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:
Failure of the main network will stop the entire communication
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
Example: LOCUS(LOCUS is a distributed operating system which supports transparent access to data through a
network wide file system, permits automatic replication of storage, supports transparent distributed process
execution) , etc.
Objective Network OS provides local services to remote clients. Distributed OS manages the hardware
1 (can make use of different operating systems) resources(multitasking)(same OS is used in all the
systems.
Communication Communication is file-based, shared folder based. Communication is message-based or shared memory-
2 based.
Scalability Network OS is highly scalable. A new machine can be Distributed OS is less scalable. The process to add new
3 added very easily. hardware is complex.
Fault tolerance Less fault tolerance as compared to distributed OS.(less Distributed OS has very high fault tolerance.(when
chances of tolerating the fault) something goes wrong the system will work
4 continuously without any delay)
Autonomy Each machine can acts on its own thus autonomy Distributed OS has a poor rate of autonomy.(one
5 (independency) is high. system is dependant on others)
Implementation Network OS-based systems are easy to built and Distributed OS implementation is difficult.
6 maintain.
Operating System Network OS-based systems have their own copy of Distributed OS-based nodes have the same copy of the
7 operating systems.(windows , linux , etc..) operating system.(all systems are windows)
G.Sravan Rao, Assistant Professor
R22_CSE( AI&ML )
Clustered Operating System Operating Systems Notes
The clustered systems are a combination of hardware clusters and software clusters. The hardware clusters
help in sharing of high performance disks between the systems. The software clusters makes all the systems
work together .
Each node in the clustered systems contains the cluster software. This software monitors the cluster system
and makes sure it is working as required. If any one of the nodes in the clustered system fail, then the rest of
the nodes take control of its storage and resources and try to restart.
Advantages:
Clustered system has great scalability because we can easily add new node with this system.
It can be stopped server while managing over load from one server to another server.
It is more reliable and easy to configure.
It can recover automatic from failure without user intervention.
Better resource availability
Disadvantages:
It is more costly because it contains expensive hardware and its design.
Required multiple servers and other hardware components for making one
It is very hard to monitor and maintenance this system. G.Sravan Rao, Assistant Professor
E. Kiran Kumar, Asst.Profesor(CSE), GNITC.
R22_CSE( AI&ML )
OS Services Operating Systems Notes
Program execution
User Interface
I/O Management
File Management
Communication
Error Detection
Accounting
Resource Allocation
File Protection and Security
Program execution
Loads a program into memory.
Executes the program.
Handles program's execution.
Provides a mechanism for process synchronization.
Provides a mechanism for process communication.
Provides a mechanism for deadlock handling.
User Interface:
GUI: graphical user interface : windows environment (ex: window interface by using the pointer
device(mouse) we will operate the system and keyboard to enter text etc…
Batch Interface: all commands and directives are entered in to files (these files are executed to control the
commands or access the system
CLI: Command Line Interface: user enters commands to access system (unix / linux commands in terminal )
I/O Management:
A running program may require I/O, which may involve a file or an I/O device.
For efficiency and protection , users cannot control I/O devices directly, therefore, the operating system must
provide a means to do I/O.(ex: user wants to take printouts OS should provide connection between file and
printer device)
File system Management:
The file system is of particular interest (how to manage files)
Obviously programs need to read and write files and directories.
They also need to create and delete them by name, search for given file etc…
Some operating systems include permissions management to allow or deny access to files or directories based
on file ownership(personal file).
Communications:
There are many circumstances in which one process needs to exchange information with another processes
This communication may be on the same computer or on different computers(tied into a network) via shared
memory or message passing (distributed/network OS) which is done by operating system
Error Detection:
The OS needs to be detecting and correcting errors constantly.
Errors may occur in the
CPU and Memory hardware(such as memory error or power failure)
I/O devices(such as parity error on disk, a connection failure on network, or lack of paper in the printer)
A parity error is an error that results from irregular changes to data.
User program(such as arithmetic overflow, an attempt to access an illegal memory location etc..
In the above cases the OS should take appropriate action to control the errors. In worst cases the system itself
will hang / struck. So we need to restart the computer.
Accounting:
we want to keep track of which users use how much and what kind of computer resources.
This record keeping may be used for accounting or for usage statistics (may be valuable tool for researchers
who wish to reconfigure the system to improve computing services)
Resource allocation:
when multiple jobs or users running at same time then resources must be allocated to each of them
The OS manages many different types of resources
CPU cycles(scheduling algorithms), main memory, file storage (special allocation code)
I/O devices(request and release codes)(request for printer, scanner, mouse, keyboard etc..)
File Protection and Security:
Protection:
When several separate processes execute concurrently , it should not be possible for one process to interfere
with another (one process execution should not interrupt another process)
Each process should access the system resources in control(resources should not be wasted unnecessarily).
Security:
Security for system from outsiders is also important
So each user has to authenticate himself/herself to the system
By using password to (Access the system resources).
a system call is the programmatic way in which a computer program requests a service from the kernel of
the operating system it is executed on.
The interface between a process and an operating system is provided by system calls
In general, system calls are available as assembly language instructions.
System calls are usually made when a process in user mode requires access to a resource. Then it requests
the kernel to provide the resource via a system call.
There are mainly five types of system calls. These are explained in detail as follows
1. Process Control
These system calls deal with processes such as create, end, abort, terminate, allocate and free memory, etc.
Functions:
End and Abort
Load and Execute
Create Process and Terminate Process
Wait and Signed Event
Allocate and free memory
2. File Management
These system calls are responsible for file manipulation such as creating a file, reading a file, writing into a file etc.
Functions:
• Create a file
• Delete file
• Open and close file
• Read, write, and reposition
• Get and set file attributes
G.Sravan Rao, Assistant Professor
E. Kiran Kumar, Asst.Profesor(CSE), GNITC.
R22_CSE( AI&ML )
Types of System Calls Operating Systems Notes
3. Device Management: These system calls are responsible for device manipulation such as reading from device buffers,
writing into device buffers etc.
Functions:
Request and release device
Logically attach/ detach devices
Get and Set device attributes
4. Information Maintenance: These system calls handle information and its transfer between the operating system and the
user program.
Functions:
Get or set time and date
Get process and device attributes
5. Communication: These system calls are useful for inter process communication. They also deal with creating and deleting a
communication connection.
Functions:
Create, delete communications connections
Send, receive message
Help OS to transfer status information
Attach or detach remote devices
G.Sravan Rao, Assistant Professor
E. Kiran Kumar, Asst.Profesor(CSE), GNITC.
R22_CSE( AI&ML )
Types of System Calls Operating Systems Notes
Operating system can be implemented with the help of various structures. The structure of the OS depends mainly
on how the various common components of the operating system are interconnected and melded into the kernel.
Depending on this we have following structures of the operating system:
1. Simple structure:
Such operating systems do not have well defined structure and are small, simple and limited systems.
The interfaces and levels of functionality are not well separated.
MS-DOS is an example of such operating system. In MS-DOS application programs are able to access the
basic I/O routines.
These types of operating system cause the entire system to crash if one of the user programs fails.
Diagram of the structure of MS-DOS is shown below.
Advantages:
Simple structure: This type of operating system has a simple structure. All the components needed for
processing are embedded into the kernel.
Works for smaller tasks: It works better for performing smaller tasks as it can handle limited resources.
Communication between components: All the components can directly communicate with each other and
also with the kernel.
Fast operating system: The code to make monolithic kernel is very fast and robust.
Disadvantages:
Code written in this operating system (OS) is difficult to port.
Monolithic OS has more tendency to generate errors and bugs. The reason is that user processes use same
address locations as the kernel.
Adding and removing features from monolithic OS is very difficult. All the code needs to be rewritten and
recompiled to add or remove any feature.
3.Layered structure:
An OS can be broken into pieces and retain much more control on system.
In this structure the OS is broken into 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 only.
This simplifies the debugging process as 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.
messages messages
microkernel
Kernel: A kernel is an important part of an OS that manages system resources. It also acts as a bridge between
the software and hardware of the computer. It is one of the first program which is loaded on start-up after the
bootloader. The Kernel is also responsible for offering secure access to the machine's hardware for various
programs. It also decides when and how long a certain application uses specific hardware.
Advantages:
Easier to port the operating system to new architectures
All new services need to be added to user space and does not require the kernel to be modified.
More reliable (less code is running in kernel mode)
More secure
The architecture of this kernel is small and isolated hence it can function better.
Expansion of the system is easier, it is simply added in the system application without disturbing the
kernel.
Disadvantages:
Performance overhead of user space to kernel space communication
Example: Mac OS, Eclipse IDE G.Sravan Rao, Assistant Professor
E. Kiran Kumar, Asst.Profesor(CSE), GNITC.
R22_CSE( AI&ML )
Concept of Virtual Machine Operating Systems Notes
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 basic hardware. Each process is provided with a virtual copy of the underlying computer system.
We can create a virtual machine for several reasons, all of which are fundamentally related to the ability to share the same
basic hardware yet can also support different execution environments, i.e., different operating systems simultaneously.
Types of VMs:
Windows virtual machines.
Android virtual machines.
Mac virtual machines.
iOS virtual machines.
Java virtual machines.
Python virtual machines.
Linux virtual machines.
VMware virtual machines.
Advantages:
There are no protection problems because each virtual machine is completely isolated from all other virtual
machines.
Virtual machine can provide an instruction set architecture that differs from real computers.
Easy maintenance, availability and convenient recovery.
Disadvantages:
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. G.Sravan Rao, Assistant Professor
Virtual machines are not as efficient as a real one when accessing the hardware. E. Kiran Kumar, Asst.Profesor(CSE), GNITC.
R22_CSE( AI&ML )
Case Studies- UNIX System Operating Systems Notes
UNIX Commands