Unit 1 OS
Unit 1 OS
Unit 1 OS
Definition
An operating system is the most important software that runs on a computer. It manages the computer's memory
and processes, as well as all of its software and hardware. It also allows you to communicate with the computer
without knowing how to speak the computer's language. Without an operating system, a computer is useless.
An Operating System (OS) is a software that acts as an interface between computer hardware components and the
user. Every computer system must have at least one operating system to run other programs. Applications like
Browsers, MS Office, Notepad Games, etc., need some environment to run and perform its tasks.
The OS helps you to communicate with the computer without knowing how to speak the computer's language. It is
not possible for the user to use any computer or mobile device without having an operating system.
Operating System
History Of OS
● Operating systems were first developed in the late 1950s to manage tape storage
● The General Motors Research Lab implemented the first OS in the early 1950s for their IBM 701
● In the mid-1960s, operating systems started to use disks
● In the late 1960s, the first version of the Unix OS was developed
● The first OS built by Microsoft was DOS. It was built in 1981 by purchasing the 86-DOS software from a
Seattle company
● The present-day popular OS Windows first came to existence in 1985 when a GUI was created and paired
with MS-DOS
1. Process management:- Process management helps OS to create and delete processes. It also provides
mechanisms for synchronization and communication among processes.
2. Memory management:- Memory management module performs the task of allocation and deallocation of
memory space to programs in need of these resources.
Operating System
3. File management:- It manages all the file-related activities such as organization storage, retrieval, naming,
sharing, and protection of files.
4. Device Management: Device management keeps tracks of all devices. This module also responsible for this
task is known as the I/O controller. It also performs the task of allocation and deallocation of the devices.
5. I/O System Management: One of the main objects of any OS is to hide the peculiarities of that hardware
device from the user.
6. Secondary-Storage Management: Systems have several levels of storage which includes primary storage,
secondary storage, and cache storage. Instructions and data must be stored in primary storage or cache so
that a running program can reference it.
7. Security:- Security module protects the data and information of a computer system against malware threat
and authorized access.
8. Command interpretation: This module is interpreting commands given by the and acting system resources
to process that commands.
9. Networking: A distributed system is a group of processors which do not share memory, hardware devices,
or a clock. The processors communicate with one another through the network.
10. Job accounting: Keeping track of time & resources used by various jobs and users.
11. Communication management: Coordination and assignment of compilers, interpreters, and another
software resource of the various users of the computer systems.
Operating System
● Allows you to hide details of hardware by creating an abstraction
● Easy to use with a GUI
● Offers an environment in which a user may execute programs/applications
● The operating system must make sure that the computer system convenient to use
● Operating System acts as an intermediary among applications and the hardware components
● It provides the computer system resources with easy to use format
● Acts as an intermediary between all hardware and software of the system
● If any issue occurs in OS, you may lose all the contents which have been stored in your system
● Operating system's software is quite expensive for small size organizations which adds burden on them.
Example Windows
● It is never entirely secure as a threat can occur at any time
Operating System
Advantages:
1. The overall time taken by the system to execute all the programmes will be reduced.
2. The Batch Operating System can be shared between multiple users.
Disadvantages:
1. Manual interventions are required between two batches.
2. The CPU utilization is low because the time taken in loading and unloading of batches is very high as
compared to execution time.
Operating System
Advantages:
1. Since equal time quantum is given to each process, so each process gets equal opportunity to execute.
2. The CPU will be busy in most of the cases and this is good to have case.
Disadvantages:
1. Process having higher priority will not get the chance to be executed first because the equal opportunity is
given to each process.
Operating System
Advantages:
1. Since the systems are connected with each other so, the failure of one system can't stop the execution of
processes because other systems can do the execution.
2. Resources are shared between each other.
3. The load on the host computer gets distributed and this, in turn, increases the efficiency.
Disadvantages:
1. Since the data is shared among all the computers, so to make the data secure and accessible to few
computers, you need to put some extra efforts.
2. If there is a problem in the communication network then the whole communication will be broken.
Operating System
Disadvantages:
Hard Real-time: In this type, a small delay can lead to drastic change. So, when the time constraint is very
important then we use the Hard Real-time.
Soft Real-time: Here, the time constraint is not that important but here also we are dealing with some real-time
data.
Advantages:
Disadvantages:
Operating System
Multitasking operating system provides the interface for executing the multiple program tasks by single user at a
same time on the one computer system. For example, any editing task can be performed while other programs are
executing concurrently. Other example, user can open Gmail and Power Point same time.True multitasking is the
capable for executing and process multiple tasks concurrently without taking delay instead of switching tasks from
one processor to other processor. It can perform couple of tasks in parallel with underlying the H/W or S/W.
Preemptive Multitasking
Preemptive multitasking is special task that is assigned to computer operating system, in which it takes decision that
how much time spent by one task before assigning other task for using the operating system. Operating system has
control for completing this entire process, so it is known as “Preemptive”.
Cooperative Multitasking
Time Shareable- In which, all tasks are allocated specific piece of time, so they do not need for waiting time for
CPU.
Manage Several Users- This operating system is more comfort for handling the multiple users concurrently, and
several programs can run smoothly without degradation of system‟s performance.
Secured Memory- Multitasking operating system has well defined memory management, because this operating
system does not provide any types of permissions of unwanted programs to wasting the memory.
Great Virtual Memory- Multitasking operating system contains the best virtual memory system. Due to virtual
memory, any program do not need long waiting g time for completion their tasks, if this problem is occurred then
those programs are transferred to virtual memory.
Background Processing- Multitasking operating system creates the better environment to execute the background
Operating System
programs. These background programs are not transparent for normal users, but these programs help to run other
programs smoothly such as firewall, antivirus software, and more.
Good Reliability- Multitasking operating system provides the several flexibilities for multiple users, and they are
more satisfied to them. On which, every users can operate single or multiple programs with smoothly.
Use Multiple Programs- Users can operate multiple programs such as internet browser, PowerPoint, MS Excel,
games, and other utilities concurrently.
Optimize Computer Resources- Multitasking operating system is able to handle smoothly multiple computers‟
resources such as RAM, input/output devices, CPU, hard disk, and more.
Memory Boundation- Computer can get slow performance, due to run multiple programs at a same time because
main memory gets more load while loading multiple programs. CPU is not able to provide separate time for every
program, and its response time gets increase. Main reason of occurring this problem is that it uses to less capacity
RAM. So, for getting solution can be increased the RAM capacity.
Processor Boundation- Computer can run programs slowly due to slow speed of their processors, and its response
time can increase while handling multiple programs. Need better processing power, to overcome this problem.
CPU Heat up- Multiple processors become busier at a time for executing any task in multitasking nature, So CPU
produces more heat.
Operating System
File Management
A file is a set of related information which is should define by its creator. It commonly represents programs, both
source and object forms, and data. Data files can be numeric, alphabetic, or alphanumeric.
Process Management
The process management component is a procedure for managing the many processes that are running
simultaneously on the operating system. Every software application program has one or more processes associated
with them when they are running.
For example, when you use a browser like Google Chrome, there is a process running for that browser program.
The OS also has many processes running, which performing various functions.
Operating System
All these processes should be managed by process management, which keeps processes for running efficiently. It
also uses memory allocated to them and shutting them down when needed.
The execution of a process must be sequential so, at least one instruction should be executed on behalf of the
process.
One of the important use of an operating system that helps you to hide the variations of specific hardware devices
from the user.
Network Management
Network management is the process of administering and managing computer networks. It includes performance
management, fault analysis, provisioning of networks, and maintaining the quality of service.
A distributed system is a collection of computers/processors that never share their own memory or a clock. In this
type of system, all the processors have their local Memory, and the processors communicate with each other using
different communication lines, like fiber optics or telephone lines.
The computers in the network are connected through a communication network, which can be configured in a
number of different ways. With the help of network management, the network can be fully or partially connected,
which helps users to design routing and connection strategies that overcome connection and security issues.
Operating System
● Distributed systems help you to various computing resources in size and function. They may involve
microprocessors, minicomputers, and many general-purpose computer systems.
● A distributed system also offers the user access to the various resources the network shares.
● It helps to access shared resources that help computation to speed-up or offers data availability and
reliability.
Main Memory is a large array of storage or bytes, which has an address. The memory management process is
conducted by using a sequence of reads or writes of specific memory addresses.
In order to execute a program , it should be mapped to absolute addresses and loaded inside the Memory. The
selection of a memory management method depends on several factors.
However, it is mainly based on the hardware design of the system. Each algorithm requires corresponding hardware
support. Main Memory offers fast storage that can be accessed directly by the CPU. It is costly and hence has a
lower storage capacity. However, for a program to be executed, it must be in the main Memory.
Secondary-Storage Management
The most important task of a computer system is to execute programs. These programs, along with the data, helps
you to access, which is in the main memory during execution.
This Memory of the computer is very small to store all data and programs permanently. The computer system offers
secondary storage to back up the main Memory. Today modern computers use hard drives/SSD as the primary
storage of both programs and data. However, the secondary storage management also works with storage devices,
like a USB flash drive, and CD/DVD drives.
Programs like assemblers, compilers, stored on the disk until it is loaded into memory, and then use the disk as a
source and destination for processing.
Operating System
Functions of Secondary storage management in OS:
Here, are major functions of secondary storage management in OS:
● Storage allocation
● Free space management
● Disk scheduling
Security Management
The various processes in an operating system need to be secured from each other's activities. For that purpose,
various mechanisms can be used to ensure that those processes which want to operate files, memory CPU, and other
hardware resources should have proper authorization from the operating system.
For example, Memory addressing hardware helps you to confirm that a process can be executed within its own
address space. The time ensures that no process has control of the CPU without renouncing it.
Lastly, no process is allowed to do its own I/O, to protect, which helps you to keep the integrity of the various
peripheral devices.
● User interface -Almost all operating systems have a user interface (UI),Varies between Command-Line
(CLI), Graphics User Interface (GUI), Batch
● Program execution -The system must be able to load a program into memory and to run that program, end
execution, either normally or abnormally (indicating error)
● I/O operations -A running program may require I/O, which may involve a file or an I/O device
● File-system manipulation -The file system is of particular interest. Obviously, programs need to read and
write files and directories, create and delete them, search them, list file Information, permission
management.
● Communications –Processes may exchange information, on the same computer or between computers over
a network
Communications may be via shared memory or through message passing (packets moved by the OS)
● Error detection –OS needs to be constantly aware of possible errors. May occur in the CPU and memory
hardware, in I/O devices, in user program. For each type of error, OS should take the appropriate action to
ensure correct and consistent computing. Debugging facilities can greatly enhance the user‟s and
programmer‟s abilities to efficiently use the system
Operating System
● Resource allocation -When multiple users or multiple jobs running concurrently, resources must be
allocated to each of them. Many types of resources -Some (such as CPU cycles, main memory, and file
storage) may have special allocation code, others (such as I/O devices) may have general request and release
code.
● Accounting -To keep track of which users use how much and what kinds of computer resources
● Protection and security -The owners of information stored in a multiuser or networked computer system
may want to control use of that information, concurrent processes should not interfere with each other.
Protection involves ensuring that all access to system resources is controlled. Security of the system from
outsiders requires user authentication, extends to defending external I/O devices from invalid access
attempts. If a system is to be protected and secure, precautions must be instituted throughout it. A chain is
only as strong as its weakest link.
A system call is a mechanism that provides the interface between a process and the operating system. It is a
programmatic method in which a computer program requests a service from the kernel of the OS. System call offers
the services of the operating system to the user programs via API (Application Programming Interface). System
calls are the only entry points for the kernel system.
Operating System
Why do you need System Calls in OS?
Following are situations which need system calls in OS:
Operating System
Process Control
This system calls perform the task of process creation, process termination, etc.
Functions:
File Management
File management system calls handle file manipulation jobs like creating a file, reading, and writing, etc.
Functions:
Operating System
● Create a file
● Delete file
● Open and close file
● Read, write, and reposition
● Get and set file attributes
Device Management
Device management does the job of device manipulation like reading from device buffers, writing into device
buffers, etc.
Functions
Information Maintenance
It handles information and its transfer between the OS and the user program.
Functions:
Communication:
These types of system calls are specially used for interprocess communications.
Functions:
Operating System
What is context switch ? actions taken by a kernel to context switch between processes
● Interrupt causes the operating system to change a CPU from its current task and to run a kernel routine.
● When an interrupt occurs, the system need to save the current context of the process running on the CPU, so
that it can later restore when needed.
● Switching the CPU to another process required performing a state save of the current process and state
restore of different process and this task is known as context switching.
● When a context switch occur the kernel switching context of old process in d‟s PCB and loads the saved
context of its new process scheduled to run.
● Context switch time is pare overhead, because system does not do any useful work during this time.
● It is highly depending on hardware support like if processor having large number of register so it wont need
to unload old PCB as it has space enough to store all frequently used processes PCB.
● Action taken by kernel to context switch between processes.
Operating System
● In response to clock interrupt, the OS saves the PC and user stack pointer of the current executing process
and transfer control to kernel clock interrupt handler.
● The clock interrupt handler saves the rest of the register as well as other machine state such as state of
floating pointer registers in the process PCB.
Operating System
System Programs can be divided into these categories :
● File Management –
A file is a collection of specific information stored in memory of computer system. File management is
defined as process of manipulating files in computer system, it management includes process of
creating, modifying and deleting files.
○ It helps to create new files in computer system and placing them at specific locations.
○ It helps in easily and quickly locating these files in computer system.
○ It makes process of sharing of files among different users very easy and user friendly.
○ It helps to stores files in separate folders known as directories.
○ These directories help users to search file quickly or to manage files according to their types
or uses.
○ It helps user to modify data of files or to modify he name of file in directories.
● Status Information –
Information like date, time amount of available memory, or disk space is asked by some of users. Others
providing detailed performance, logging and debugging information which is more complex. All this
Operating System
information is formatted and displayed on output devices or printed. Terminal or other output devices or
files or a window of GUI is used for showing output of programs.
● File Modification –
For modifying contents of files we use this. For Files stored on disks or other storage devices we used
different types of editors. For searching contents of files or perform transformations of files we use
special commands.
● Programming-Language support –
For common programming languages we use Compilers, Assemblers, Debuggers and interpreters which
are already provided to user. It provides all support to users. We can run any programming languages.
All languages of importance are already provided.
● Communications –
Virtual connections among processes, users and computer systems are provided by programs. User can
send messages to other user on their screen, User can send e-mail, browsing on web pages, remote login,
transformation of files from one user to another.
Operating System
2. Monolithic Approach
Functionality of the OS is invoked with simple function calls within the kernel, which is one large program. Device
drivers are loaded into the running kernel and become part of the kernel.
Operating System
3. Layered Approach
● This allows implementers to change the inner workings, and increases modularity.
● As long as the external interface of the routines don‟t change, developers have more freedom to change the
inner workings of the routines.
● With the layered approach, the bottom layer is the hardware, while the highest layer is the user interface.
○ The main advantage is simplicity of construction and debugging.
○ The main difficulty is defining the various layers.
○ The main disadvantage is that the OS tends to be less efficient than other
implementations.
Operating System
4. Microkernel Approach
This structures the operating system by removing all nonessential portions of the kernel and implementing them as
system and user level programs.
● Generally they provide minimal process and memory management, and a communications
facility.
● Communication between components of the OS is provided by message passing.
The benefits of the microkernel are as follows:
Operating System
Main disadvantage is poor performance due to increased system overhead from message passing.
Virtual Memory is a storage allocation scheme in which secondary memory can be addressed as though it were part
of main memory. The addresses a program may use to reference memory are distinguished from the addresses the
memory system uses to identify physical storage sites, and program generated addresses are translated
automatically to the corresponding machine addresses.
The size of virtual storage is limited by the addressing scheme of the computer system and amount of secondary
memory is available not by the actual number of the main storage locations.
A computer can address more memory than the amount physically installed on the system. This extra memory is
actually called virtual memory and it is a section of a hard disk that's set up to emulate the computer's RAM.
The main visible advantage of this scheme is that programs can be larger than physical memory. Virtual memory
serves two purposes. First, it allows us to extend the use of physical memory by using disk. Second, it allows us to
have memory protection, because each virtual address is translated to a physical address.
Following are the situations, when entire program is not required to be loaded fully in main memory.
● User written error handling routines are used only when an error occurred in the data or computation.
● Certain options and features of a program may be used rarely.
● Many tables are assigned a fixed amount of address space even though only a small amount of the table is
actually used.
● The ability to execute a program that is only partially in memory would counter many benefits.
Operating System
● Less number of I/O would be needed to load or swap each user program into memory.
● A program would no longer be constrained by the amount of physical memory that is available.
● Each user program could take less physical memory, more programs could be run the same time, with a
corresponding increase in CPU utilization and throughput.
Modern microprocessors intended for general-purpose use, a memory management unit, or MMU, is built into the
hardware. The MMU's job is to translate virtual addresses into physical addresses
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 Design Goals
▪ User Goals
The operating system should be convenient, easy to use, reliable, safe and fast according to the users.
However, these specifications are not very useful as there is no set method to achieve these goals.
▪ System Goals
The operating system should be easy to design, implement and maintain. These are specifications required
by those who create, maintain and operate the operating system. But there is not specific method to achieve these
goals as well.
Operating systems were written in assembly language. But today high-level languages are used to implement the
systems. Although high-level languages are less efficient in some aspects (like their requirement for more memory
and their low speed etc.), they have their own merits:
▪ The code produced using a compiler can be made more efficient by recompiling it with another good compiler.
▪ An operating system written in the high-level language is easier to port. For example, if an operating system is
written in assembly language on a specific CPU, it can be used only on that system. But the operating systems
written in a high-level language can be used on any system having any CPU. For example, UNIX, written in C
language, can be used on any system.
▪ At first, operating systems were written in assembly, but now C/C++ is the language commonly used.
▪ Small blocks of assembly code are still needed, especially related to some low level I/O functions in device
drivers, turning interrupts on and off and the Test and Set Instruction for Synchronization Facilities.
▪ Using higher level languages allows the code to be written faster. It also makes the OS much easier to port to
different hardware platforms.
Operating System
Operating System Generations
Operating Systems have evolved over the years. So, their evolution through the years can be mapped using
generations of operating systems. There are four generations of operating systems. These can be described as
follows −
These early computers were designed, built and maintained by a single group of people. Programming languages
were unknown and there were no operating systems so all the programming was done in machine language. All the
problems were simple numerical calculations.
By the 1950‟s punch cards were introduced and this improved the computer system. Instead of using plugboards,
programs were written on cards and read into the system.
Operating System
● Few Examples are:
1. ENIAC
2. EDVAC
3. UNIVAC
4. IBM-701
5. IBM-650
● Advantages:
1. It made use of vacuum tubes which are the only electronic component available during those
days.
2. These computers could calculate in milliseconds.
● Disadvantages:
1. These were very big in size, weight was about 30 tones.
2. These computers were based on vacuum tubes.
3. These computers were very costly.
4. It could store only a small amount of information due to the presence of magnetic drums.
5. As the invention of first generation computers involves vacuum tubes, so another
disadvantage of these computers was, vacuum tubes require a large cooling system.
6. Very less work efficiency.
7. Limited programming capabilities and punch cards were used to take inputs.
8. Large amount of energy consumption.
9. Not reliable and constant maintenance is required.
Operating System
4. CDC 3600
5. UNIVAC 1108
● Advantages:
1. Due to the presence of transistors instead of vacuum tubes, the size of electron component
decreased. This resulted in reducing the size of a computer as compared to first generation
computers.
2.
Less energy and not produce as much heat as the first generation.
3.
Assembly language and punch cards were used for input.
4.
Low cost than first generation computers.
5.
Better speed, calculate data in microseconds.
6.
Better portability as compared to first generation
● Disadvantages:
1. A cooling system was required.
2. Constant maintenance was required.
3. Only used for specific purposes.
● Advantages:
Operating System
1. These computers were cheaper as compared to second-generation computers.
2. They were fast and reliable.
3. Use of IC in the computer provides the small size of the computer.
4. IC not only reduce the size of the computer but it also improves the performance of the
computer as compared to previous computers.
5. This generation of computers has big storage capacity.
6. Instead of punch cards, mouse and keyboard are used for input.
7. They used an operating system for better resource management and used the concept of time-
sharing and multiple programming.
8. These computers reduce the computational time from microseconds to nanoseconds.
● Disadvantages:
1. IC chips are difficult to maintain.
2. The highly sophisticated technology required for the manufacturing of IC chips.
3. Air conditioning is required.
The advent of personal computers also led to the growth of networks. This created network operating systems and
distributed operating systems. The users were aware of a network while using a network operating system and
could log in to remote machines and copy files from one machine to another.
Operating System
● Disadvantages:
1. The Microprocessor design and fabrication are very complex.
2. Air conditioning is required in many cases due to the presence of ICs.
3. Advance technology is required to make the ICs.
The computers that emerged after 1985 with further improved technology are considered as the fifth generation
computers. These machines are designed to incorporate "Artificial Intelligence" and use stored reservoirs of
knowledge to make expert judgments and decisions like human beings. They are also designed to process non
numerical information like pictures and graphs using the very large scale integrated circuits. The period of the fifth
generation in 1980-onwards. This generation is based on artificial intelligence. The aim of the fifth generation is to
make a device which could respond to natural language input and are capable of learning and self-organization.
This generation is based on ULSI(Ultra Large Scale Integration) technology resulting in the production of
microprocessor chips having ten million electronic components. Fifth generation computers are based on artificial
intelligence and biochips, and we can say that they are still in the development phase; Though there are some
applications, such as voice recognition, that is being used today to make things easier. The use of parallel
processing and supercomputers is helping to make artificial intelligence a reality.
● Advantages:
1. It is more reliable and works faster.
2. It is available in different sizes and unique features.
3. It provides computers with more user-friendly interfaces with multimedia features.
Their intelligence: Intelligent robots that could „see‟ their environment (visual input – for example, a video
camera) and could be programmed to carry out certain tasks without step-by-step instructions. The robot should be
able to decide for itself how the task should be accomplished, based on the observations it made of its environment.
Technology Advances: VLSI and ULSI; The period of the fifth generation is a 1980-till date. In the fifth
generation, VLSI technology became ULSI (Ultra Large Scale Integration) technology, resulting in the production
of microprocessor chips having ten million electronic components. AI includes.
● Robotics
● Neural Networks
● Game Playing
● Development of expert systems to make decisions in real-life situations
● Natural language understanding and generation
Operating System
● Disadvantages:
1. They need very low-level languages.
2. They may make the human brains dull and doomed.
3. They tend to be sophisticated and complex tools.
4. They can give more power to companies to watch what you are doing and even allow them to
infect your computer.
● ULSI technology
● Development of true artificial intelligence
● Development of Natural language processing
● Advancement in Parallel Processing
● Advancement in Superconductor technology
● More user-friendly interfaces with multimedia features
● Availability of very powerful and compact computers at cheaper rates.
● The fifth generation computers will use super large scale integrated chips.
● They will have artificial intelligence.
● They will be able to recognize image and graphs.
● Fifth generation computer aims to be able to solve the highly complex problem including decision
making, logical reasoning.
● They will be able to use more than one CPU for faster processing speed.
● Fifth generation computers are intended to work with natural language.
● These computers are much faster than other generation computers.
● It is easier to repair these computers.
● These computers are much smaller in size than other generation computers
● They are portable and easy to handle.
● Development of true artificial intelligence.
● Advancement in Parallel Processing.
● Advancement in Superconductor technology
Operating System
Operating System